gossip: remove vote buffer, send all verified votes to banking_stage #2509
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Gossip has a buffer that stores the latest vote from each validator, starting up to
3 * 512
slots before our next leader slot, and sends these votes tobanking_stage
once we have aworking_bank
.This buffer is unnecessary, as
banking_stage
already holds the latest vote per validator in it's own buffer,latest_unprocessed_votes
until it is time to produce a block.Furthermore,
3 * 512
is a somewhat arbitrary number. We can place no lower bound on the block height of the leader's fork, so votes from before3 * 512
could be included (and not expired) in the next leader block if a validator has been stuck not voting for a while.The removal of this buffer allows
latest_unprocessed_votes
to maintain a consistent view of the latest vote per validator for both gossip and tpu votes, and makes reported metrics for vote ingestion more accurate.Summary of Changes
Remove
verified_vote_packets
and the buffering incluster_info_vote_listener
. Forward verified votes directly tobanking_stage
As explained here #2183 (comment),
verified_vote_packets
performed an additional check to only send votes that were part of the leader fork tobanking_stage
. #2465 added this logic tolatest_unprocessed_votes
so it still applies to these gossip votes, and now to tpu votes as well.Fixes #2183