Skip to content
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

Merged
merged 7 commits into from
Mar 12, 2024

Conversation

steviez
Copy link

@steviez steviez commented Mar 8, 2024

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

@steviez steviez force-pushed the rpc_notif_threads branch 2 times, most recently from 3aac3a3 to e71eeac Compare March 8, 2024 22:19
@@ -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 }
Copy link
Author

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

validator/src/cli.rs Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Mar 9, 2024

Codecov Report

Attention: Patch coverage is 93.54839% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 81.8%. Comparing base (e027a8b) to head (9d8c493).
Report is 18 commits behind head on master.

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     

@steviez steviez force-pushed the rpc_notif_threads branch 2 times, most recently from dbf8de8 to 9d8c493 Compare March 11, 2024 22:54
@steviez steviez requested a review from CriesofCarrots March 12, 2024 01:20
validator/src/cli.rs Outdated Show resolved Hide resolved
Comment on lines -1385 to +1387
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),
Copy link
Author

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 passed
  • n-thread ==> --rpc-pubsub-notification-threads N passed
  • n-thread value ==> The resulting value that is parsed and set in pubsub_config.notification_threads

@steviez steviez force-pushed the rpc_notif_threads branch from 6fc7b20 to b9e7173 Compare March 12, 2024 18:02
@steviez
Copy link
Author

steviez commented Mar 12, 2024

Had to force push in order to rebase and pull in some unrelated item that was making CI fail

Copy link

@CriesofCarrots CriesofCarrots left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@steviez steviez merged commit f8bb98b into anza-xyz:master Mar 12, 2024
46 checks passed
@steviez steviez deleted the rpc_notif_threads branch March 12, 2024 21:11
codebender828 pushed a commit to codebender828/agave that referenced this pull request Oct 3, 2024
…-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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

4 participants