-
Notifications
You must be signed in to change notification settings - Fork 255
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
Move default value for --rpc-pubsub-notification-threads to CLI #158
Conversation
3aac3a3
to
e71eeac
Compare
@@ -50,6 +50,7 @@ solana-net-utils = { workspace = true } | |||
solana-perf = { workspace = true } | |||
solana-poh = { workspace = true } | |||
solana-program-runtime = { workspace = true } | |||
solana-rayon-threadlimit = { workspace = true } |
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 crates goes away long-term, just bubbling this up so that this PR does not alter existing behavior
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #158 +/- ##
========================================
Coverage 81.8% 81.8%
========================================
Files 838 838
Lines 226389 226525 +136
========================================
+ Hits 185342 185483 +141
+ Misses 41047 41042 -5 |
dbf8de8
to
9d8c493
Compare
notification_threads: if full_api { | ||
value_of(&matches, "rpc_pubsub_notification_threads") | ||
} else { | ||
Some(0) | ||
}, | ||
notification_threads: value_t!(matches, "rpc_pubsub_notification_threads", usize) | ||
.ok() | ||
.and_then(NonZeroUsize::new), |
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.
Use of .requires()
and .default_value_if()
allow us to simplify this check. The scenarios are
full-rpc | n-thread | n-thread value
------------------------------------
false | false | value_t() will yield a None
false | true | CLAP errors out
true | false | value_t() will match the default
true | true | value_t() will match N (user value)
where:
full-rpc
==>--full-rpc-api
passedn-thread
==>--rpc-pubsub-notification-threads N
passedn-thread value
==> The resulting value that is parsed and set inpubsub_config.notification_threads
The default value was previously being determined down where the thread pool is being created. Providing a default value at the CLI level is consistent with other args, and gives an operator better visibility into what the default will actually be
6fc7b20
to
b9e7173
Compare
Had to force push in order to rebase and pull in some unrelated item that was making CI fail |
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.
lgtm
…-xyz#158) The default value was previously being determined down where the thread pool is being created. Providing a default value at the CLI level is consistent with other args, and gives an operator better visibility into what the default will actually be
Problem
The default value was previously being determined down where the thread pool is being created. Providing a default value at the CLI level is consistent with other args, and gives an operator better visibility into what the default will actually be.
Related to #105 - was doing something else and figured I'd clean this up
Things previously failed in CI when
--full-rpc-api
became required because of the CLAP bug; I should get all greens on CI but I also manually started up a validator and did these sanity checks:--full-rpc-api
is not required--full-rpc-api
can be used without--rpc-pubsub-notification-threads
--rpc-pubsub-notification-threads
errors without--full-rpc-api
--rpc-pubsub-notification-threads
proceeds with--full-rpc-api