-
Notifications
You must be signed in to change notification settings - Fork 4.5k
SlotMeta is_connected field isn't updated as expected #27820
Comments
Quick thought that needs more examination would be to change Ultimately, it'd be nice to not have to change the struct layout of |
In regards to my previous comment, I think we need two bits of state:
My defense for that is that when we start from a snapshot at slot We can capture both of these bits in the same amount of space that the boolean previously occupied; however, this is a compatibility issue regardless as trying to decode a byte that is not one of |
For completeness, another option that would avoid adding the extra bit of state to
|
oh. i thought this all seemed familiar 😅 |
Problem
The
SlotMeta::is_connected
field was originally designed to indicate whether a given slotn
had a full replayable sequence back to genesis without any holes. It follows that all slots in this sequence must be full in order to be replayable. In a more compact form, we're sayingwhere
n
is the direct child ofparent_of_n
.What this design failed to account for is that validators might start from a snapshot at some slot
s
> 0. This is a perfectly valid way for a validator to bootstrap (recall that by definition,s
is a root); however, that validator doesn't / didn't have a path back to genesis. As such,is_connected
will be false for all slots that this validator processes. This has a potential ripple effect as theis_connected
field is currently being used to signal toReplayStage
when there is more work to do. See #27786, which is what sparked the dig into this issue.Proposed Solution
From some discussion, an initial idea is to expand
is_connected
to link back to geneiss OR to a slot that we load snapshot from.[b_start, b_end]
and we fetch a snapshot at slots
:s > b_end
has no issues;s
marked as connected and progresses onward (so functionally similar to starting without any blockstore)b_start < s < b_end
would marks
as connected, but if slots(s, b_end]
are already present in blockstore, their connected status wouldn't change.blockstore_process::load_frozen_forks()
to mark these slots as connected ?s < b_start
would be similar to above case; marks
connected and then potentially need to update slots as connected inload_frozen_forks()
Technically, when we fetch a snapshot at slot
s
, we don't actually needs
in the blockstore as the bank unpacked from the snapshot is frozen after playings
. There might be some subtlety with getting this correctAdditional Context / Reading
The original design doc for blockstore is here, and below is the
SlotMeta
struct in code.solana/ledger/src/blockstore_meta.rs
Lines 16 to 45 in 1a4b8b5
The text was updated successfully, but these errors were encountered: