Make ShredFetchStage refresh root bank even if no shreds arrive #33078
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
#31576 introduced a QUIC receiver for turbine. From the networking perspective, this code is currently dormant and doesn't really do anything given that we aren't broadcasting shreds over QUIC / to QUIC TVU port.
ShredFetchStage
implements some basic verification inmodify_packets
. Some of this verification currently relies on having a (root) bank in order to check feature status as well as to check number of slots in an epoch (number of slots in an epoch could be calculated and thenArc<Bank>
could be dropped). The root bank is fetched here:solana/core/src/shred_fetch_stage.rs
Lines 57 to 59 in b13589b
At the time that the bank is fetched, the node just unpacked its' snapshot. So, this initial root bank corresponds to the load-snapshot-slot. Later in the function, we currently use a blocking method to pull shred out of the crossbeam receiver:
solana/core/src/shred_fetch_stage.rs
Line 65 in b13589b
Since we're not getting any QUIC turbine packets, execution is blocked waiting for a shred to show up, and the following code that updates the root bank is never executed:
solana/core/src/shred_fetch_stage.rs
Lines 69 to 70 in b13589b
As a result, the initial root bank at startup (ie the snapshot slot) is held by the
solTvuFetchQuic
thread that is spawned below for the duration of the process.solana/core/src/shred_fetch_stage.rs
Lines 224 to 237 in b13589b
Summary of Changes
Rework the code to timeout on reading from the crossbeam channel so that the root bank is updated even if no shreds are actually showing up.
I have some scaffolding code that tracks creation / drop of new banks.