v2.2: consensus: remove early return in OC loop to fix RPC notifications (backport of #6645) #6680
+1
−1
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
#3136 changed the OC processing loop to aggregate every slot in the vote tower instead of only considering the last slot. It kept the early exit logic in case we processed a slot we had seen before.
This ends up with us always exiting early since the tower is incremental e.g:
We vote
Tower: [1, 0]
Tower: [5, 4, 3, 2, 1, 0]
The code will aggregate
5, 4, 3, and 2
and early exit once we get to1
.This is fine for the OC and propagation check aggregation, but this early exit causes us to omit the RPC notification send logic at the very end of the processing.
Summary of Changes
Instead of early exiting, break out of the loop so that the RPC notification is still sent.
Original report
https://discord.com/channels/428295358100013066/489504501749907468/1384735277578453022
I believe the reason this sometimes work is because we don't perform this early exit for gossip votes. I'm guessing that
solana-test-validator
could rarely end up consuming its own gossip vote before its replay vote.Testing
With this fix, we receive notifications again from
solana-test-validator --rpc-pubsub-enable-vote-subscription
: