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:

  1. Add some way to map a slot number to block height
    • I don’t know how this would work. Is it even possible?
  2. 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.
  3. 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.
  4. Update gossips for crds_value::IncrementalSnapshotHashes to 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)

Most upvoted comments

@behzadnouri Can I get your thoughts on this too, since option 4 would add a u64 to base in IncrementalSnapshotHashes.

The way to do it is to rename current IncrementalSnapshotHashes to LegcyIncrementalSnapshotHashes and then introduce the new IncrementalSnapshotHashes crds value. Kind of similar to Version -> LegacyVersion done in: https://github.com/solana-labs/solana/pull/12376