-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Open
Description
Description
When running a reth node on snapshot data that begins with a custom (non-zero) genesis block number — common in L2 rollups — the node panics during static file initialization. The static file system expects files named with ranges starting from block 0 (e.g., multiples computed by find_fixed_range), but the actual files on disk start at the genesis block number.
Root Cause
The canonical file range computed by find_fixed_range always starts at 0, but when the genesis block is non-zero, the actual first static file starts at the genesis block number. This mismatch causes three distinct issues:
set_expected_block_startrecomputes an incorrect end boundary — It usesfind_fixed_rangeto derive the end block, which produces a wrong value when the range start has been adjusted for a non-zero genesis.update_indexattempts to load a non-existent file — It computes a fixed range starting below the genesis block, then tries to load a file with that range which doesn't exist on disk.- Static file writer looks up the wrong segment — The
open()method uses an incorrect block number for segment lookup and creates new files with ranges that don't account for the genesis offset.
Impact
- Node panic on startup when using snapshot data with non-zero genesis blocks
- Affects L2 rollup deployments that use reth with custom genesis configurations
- Prevents proper static file initialization and indexing
Expected Behavior
Static file range calculations should account for non-zero genesis block numbers by:
- Preserving existing end boundaries in
set_expected_block_startinstead of recomputing them viafind_fixed_range - Clamping the fixed range start to the genesis block number in
update_index - Using the actual block number for segment lookup in the static file writer and creating new files with genesis-aware ranges
Affected Components
crates/static-file/types/src/segment.rs—set_expected_block_startcrates/storage/provider/src/providers/static_file/manager.rs—update_indexcrates/storage/provider/src/providers/static_file/writer.rs—open()
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Backlog