-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Sub function getting vetted RPC nodes #30946
Conversation
Codecov Report
@@ Coverage Diff @@
## master #30946 +/- ##
=======================================
Coverage 81.5% 81.5%
=======================================
Files 728 728
Lines 205475 205480 +5
=======================================
+ Hits 167560 167578 +18
+ Misses 37915 37902 -13 |
gossip: &Option<(Arc<ClusterInfo>, Arc<AtomicBool>, GossipService)>, | ||
cluster_entrypoints: &[ContactInfo], | ||
validator_config: &ValidatorConfig, | ||
blacklisted_rpc_nodes: &RwLock<HashSet<Pubkey>>, |
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.
Well... this is unfortunate... I wish get_rpc_node()
and fail_rpc_node()
didn't modify blacklisted_rpc_nodes
. I think for this PR the refactoring here is fine. Maybe future PRs can help clean this up!
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.
Looked into this. Unfortunately, there is a place we might clear blacklisted_rpc_nodes
that is deep in the depths of the call stack. Going to be really difficult to allow blacklisted_rpc_nodes
to be immutable at this level.
Tried to improve things slightly by stripping the RwLock from blacklisted_rpc_nodes
here: #30987
// Populates `vetted_rpc_nodes` with a list of RPC nodes that are ready to be | ||
// used for downloading latest snapshots and/or the genesis block. Guaranteed to | ||
// find at least one viable node or terminate the process. | ||
fn get_vetted_rpc_nodes( |
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.
And similarly to the previous comment, it'd be nice if this function returned the vetted rpc nodes, instead of mutating them internally. Nothing to do for this PR (maybe future ones though)!
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
Problem
rpc_bootstrap
function is pretty unwieldy. Sub-functioning the process to get vetted RPC nodes improves readability. This also sets the stage for decoupling parts of the full/incremental snapshot downloadSummary of Changes
Add function for getting vetted RPC nodes