-
Notifications
You must be signed in to change notification settings - Fork 313
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
rpc-sts: add config options for stake-weighted qos #197
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #197 +/- ##
=========================================
- Coverage 81.9% 81.9% -0.1%
=========================================
Files 837 837
Lines 226898 226912 +14
=========================================
- Hits 185871 185862 -9
- Misses 41027 41050 +23 |
Is this ready for review? |
sure! i was trying to think of an easy way to test it. probably gonna have to hijack devnet or something 🤕 |
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.
Generally, the addressing logic looks good. Couple small config comments, and we need to make the change twice if the initial send should go to flagged tpu_peers.
@@ -115,6 +115,8 @@ pub struct Config { | |||
pub batch_send_rate_ms: u64, | |||
/// When the retry pool exceeds this max size, new transactions are dropped after their first broadcast attempt | |||
pub retry_pool_max_size: usize, | |||
pub tpu_peers: Option<Vec<SocketAddr>>, |
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.
What's the value of an Option here, instead of just a Vec that may be empty (when flag isn't set)?
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.
pedantry mostly. preference for type safety over implicit sentinels
04c1579
to
fae62c8
Compare
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.
I have a preference for pub tpu_peers: Vec<SocketAddr>
because it makes call/iteration site an easier read. But I'm guessing you feel more strongly about this than I do, so okay to ship as-is 😅
let mut addresses = config | ||
.tpu_peers | ||
.as_ref() | ||
.map(|addrs| addrs.iter().map(|a| (a, 0)).collect::<Vec<_>>()) |
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.
This line would be so much simpler and easier to read if tpu_peers was just a Vec.
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.
it would also be easier to read if we didn't collect the leader id with the leader slot just for the sake of a debug-level log message :upside:
i started to remove it but refrained for the sake of staying on topic
v1.18 backport? |
prolly 1.17 too |
Backports to the stable branch are to be avoided unless absolutely necessary for fixing bugs, security issues, and perf regressions. Changes intended for backport should be structured such that a minimum effective diff can be committed separately from any refactoring, plumbing, cleanup, etc that are not strictly necessary to achieve the goal. Any of the latter should go only into master and ride the normal stabilization schedule. |
Backports to the beta branch are to be avoided unless absolutely necessary for fixing bugs, security issues, and perf regressions. Changes intended for backport should be structured such that a minimum effective diff can be committed separately from any refactoring, plumbing, cleanup, etc that are not strictly necessary to achieve the goal. Any of the latter should go only into master and ride the normal stabilization schedule. Exceptions include CI/metrics changes, CLI improvements and documentation updates on a case by case basis. |
* rpc-sts: plumb options for swqos config * rpc-sts: send to specific tpu peers when configured (cherry picked from commit f41fb84) # Conflicts: # send-transaction-service/src/send_transaction_service.rs # validator/src/cli.rs # validator/src/main.rs
* rpc-sts: plumb options for swqos config * rpc-sts: send to specific tpu peers when configured (cherry picked from commit f41fb84) # Conflicts: # send-transaction-service/src/send_transaction_service.rs # validator/src/cli.rs # validator/src/main.rs
* rpc-sts: plumb options for swqos config * rpc-sts: send to specific tpu peers when configured (cherry picked from commit f41fb84) # Conflicts: # send-transaction-service/src/send_transaction_service.rs # validator/src/cli.rs # validator/src/main.rs
* rpc-sts: plumb options for swqos config * rpc-sts: send to specific tpu peers when configured (cherry picked from commit f41fb84) # Conflicts: # send-transaction-service/src/send_transaction_service.rs # validator/src/cli.rs # validator/src/main.rs
…#197) (#340) rpc-sts: add config options for stake-weighted qos (#197) * rpc-sts: plumb options for swqos config * rpc-sts: send to specific tpu peers when configured (cherry picked from commit f41fb84) # Conflicts: # send-transaction-service/src/send_transaction_service.rs # validator/src/cli.rs # validator/src/main.rs Co-authored-by: Trent Nelson <490004+t-nelson@users.noreply.github.com>
…#197) (#341) rpc-sts: add config options for stake-weighted qos (#197) * rpc-sts: plumb options for swqos config * rpc-sts: send to specific tpu peers when configured (cherry picked from commit f41fb84) # Conflicts: # send-transaction-service/src/send_transaction_service.rs # validator/src/cli.rs # validator/src/main.rs Co-authored-by: Trent Nelson <490004+t-nelson@users.noreply.github.com>
…anza-xyz#197) (anza-xyz#341) rpc-sts: add config options for stake-weighted qos (anza-xyz#197) * rpc-sts: plumb options for swqos config * rpc-sts: send to specific tpu peers when configured (cherry picked from commit f41fb84) # Conflicts: # send-transaction-service/src/send_transaction_service.rs # validator/src/cli.rs # validator/src/main.rs Co-authored-by: Trent Nelson <490004+t-nelson@users.noreply.github.com>
* rpc-sts: plumb options for swqos config * rpc-sts: send to specific tpu peers when configured
Problem
no simple way to configure an rpc node to send transactions to staked peer(s), as per stake-weighted qos
Summary of Changes
--rpc-send-transaction-tpu-peer HOST:PORT
to specify a specific tpu peer to send transctions to, instead of the current leader. this argument may be passed multiple times.--rpc-send-transaction-also-leader
to continue sending to the current leader even though tpu peers have been specified with--rpc-send-transaction-tpu-peer HOST:PORT