Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

reduce locking in propagated check for VoteStateUpdate #33997

Merged
merged 1 commit into from
Nov 15, 2023

Conversation

AshwinSekar
Copy link
Contributor

@AshwinSekar AshwinSekar commented Nov 8, 2023

Problem

logic is not updated for VoteStateUpdate, end up checking all 31 slots every time which grabs the lock shared with replay

Summary of Changes

filter out seen slots, no need to be precise and check every single slot, can filter by latest slot because propagated check rolls up to parent anyway.

potentially helps #33017

@AshwinSekar AshwinSekar changed the title reduce locking in gossip propagated check pipeline for VoteStateUpdate reduce locking in propagated check for VoteStateUpdate Nov 8, 2023
Copy link

codecov bot commented Nov 9, 2023

Codecov Report

Merging #33997 (29a33f9) into master (04e4efd) will increase coverage by 0.0%.
The diff coverage is 95.8%.

@@           Coverage Diff           @@
##           master   #33997   +/-   ##
=======================================
  Coverage    81.9%    81.9%           
=======================================
  Files         811      811           
  Lines      219424   219497   +73     
=======================================
+ Hits       179761   179830   +69     
- Misses      39663    39667    +4     

@@ -733,6 +752,8 @@ impl ClusterInfoVoteListener {
.or_insert(is_gossip_vote);
}

*latest_vote_slot = max(*latest_vote_slot, last_vote_slot);

if is_new_vote {
subscriptions.notify_vote(*vote_pubkey, vote, vote_transaction_signature);
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to move this RPC notification before the new check as well so that we still get notified of last voted slots X in votes where X < latest_vote_slot

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This RPC notification is outside the loop, the behavior should remain unchanged. If the last vote was for a new slot as decided by the vote tracker, it will still notify.

Copy link
Contributor

Choose a reason for hiding this comment

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

ah dam the github formatting messed me up, thanks

carllin
carllin previously approved these changes Nov 11, 2023
@AshwinSekar AshwinSekar merged commit fb76b4c into solana-labs:master Nov 15, 2023
@AshwinSekar AshwinSekar deleted the vote-listener-filter branch November 15, 2023 06:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants