solana: Bootstrap with incremental snapshots will never get a snapshot that's a multiple of our full snapshot
Problem
When incremental snapshots are enabled, bootstrap tries to download a snapshot that is a multiple of its full snapshot archive interval. However, snapshots are taken based on the block height, but named based on the slot… So basically the check for is snapshot a multiple of our full snapshot archive interval will (almost) always be false…
Proposed Solution
Possible options:
- Add some way to map a slot number to block height
- I don’t know how this would work. Is it even possible?
- Put the block height in the snapshot’s filename so it can be parsed by bootstrap
- Would be possible. Would also either cause code bifurcation on snapshot filename parsing, or render old snapshots incompatible for bootstrap.
- Change when we take snapshots to be based on slot not block height
- Not a good idea, as then there’s a risk snapshots are not taken if slot numbers are skipped. Missing a full snapshot would be bad.
- Update gossips for
crds_value::IncrementalSnapshotHashesto include the block height for the base snapshot hash.- Could be doable. Would need to make this change ASAP to not cause more backwards incompatibility/issues when upgrading.
Of these options, I’m leaning towards option 4. Are there other possibilities?
Related to #17088
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 18 (18 by maintainers)
The way to do it is to rename current
IncrementalSnapshotHashestoLegcyIncrementalSnapshotHashesand then introduce the newIncrementalSnapshotHashescrds value. Kind of similar toVersion->LegacyVersiondone in: https://github.com/solana-labs/solana/pull/12376