Expand description
Moves block history between ERA files (reth_era) and node storage (reth_storage_api).
Each ERA format plugs into a shared pipeline through a per-format seam (EraBlockReader).
Structs§
- Era1
EraBlockReaderfor.era1files.- Ere
EraBlockReaderfor.ere/.eraefiles.- Export
Block - One block’s data, gathered by
exportand handed to anEraBlockWriter. - Export
Config - Configuration to export block history to ERA files.
Traits§
- EraBlock
Reader - Reads execution
(header, body)pairs out of an ERA file. - EraBlock
Writer - Writes a chunk of consecutive blocks as a single ERA file.
Functions§
- build_
index - Dumps the contents of
hash_collectorintotables::HeaderNumbers. - calculate_
td_ by_ number - Calculates the total difficulty for a given block number by summing the difficulty of all blocks from genesis to the given block.
- decode
- Extracts a pair of [
FullBlockHeader] and [FullBlockBody] fromBlockTuple. - export
- Fetches block history from
providerand writes it to ERA files in theWformat, chunked byExportConfig::max_blocks_per_file. - import
- Imports blocks from
downloader, decoding each file with theEraBlockReaderS. - open
- Opens the ERA file at
metawith the format’sStreamReader. - process
- Reads
metawith theEraBlockReaderS, appends its blocks withinblock_numbers, and marksmetaprocessed if the file was fully consumed. Returns last block height. - process_
iter - Extracts block headers and bodies from
iterand appends them usingwriterandprovider. - save_
stage_ checkpoints - Saves progress of ERA import into stages sync.