-
Notifications
You must be signed in to change notification settings - Fork 1k
feat: add weighted rpc steering #6090
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feature/add-weighted-random-steering-load-balancing
Are you sure you want to change the base?
feat: add weighted rpc steering #6090
Conversation
…ing-and-weights Enable weighted RPC steering in test config
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds weighted random steering functionality to Graph Node's Ethereum RPC provider selection system, allowing operators to configure fractional weights (0.0-1.0) for load balancing across different RPC endpoints.
Key Changes
- Added weighted random steering configuration flag and CLI option
- Implemented weight-based provider selection using fractional values (0.0-1.0)
- Modified adapter selection logic to support both weighted and traditional selection strategies
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
File | Description |
---|---|
node/src/opt.rs | Added CLI flag for enabling weighted RPC steering |
node/src/config.rs | Added weight field to Provider struct with validation and serde support |
node/src/network_setup.rs | Integrated weighted steering flag into network configuration |
node/src/chain.rs | Updated adapter creation to pass weight parameter |
chain/ethereum/src/network.rs | Implemented weighted selection algorithm using WeightedIndex |
node/resources/tests/full_config.toml | Updated test configuration with weight examples |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Update chain/ethereum/src/network.rs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Update chain/ethereum/src/network.rs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Update chain/ethereum/src/network.rs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Update chain/ethereum/src/network.rs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Update chain/ethereum/src/network.rs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Update chain/ethereum/src/network.rs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
50b2cca
to
c3d0c5b
Compare
Summary
Adds weighted random steering to Graph Node’s Ethereum RPC provider selection, enabling per-endpoint load balancing with fractional weights and optional runtime control via a new CLI/config flag.
Key Changes
f64
fractions (0.0–1.0
), defaulting to1.0
.--weighted-rpc-steering
(and corresponding config option) toggles the new load-balancing strategy.1.0
.Configuration Format
Enable weighted steering with custom fractions:
Implementation Details
weight
field andweighted_rpc_steering
flag innode/src/config.rs
withserde
support.node/src/opt.rs
exposes--weighted-rpc-steering
flag.node/src/network_setup.rs
forwards weights to adapter creation.chain/ethereum/src/network.rs
implements weighted sampling logic in RPC selection.Future Extensions
Test Plan
--weighted-rpc-steering
.cargo test -p graph-node -p graph-chain-ethereum
onceprotoc
and proto dependencies are available.