Skip to main content

Crate reth_era_utils

Crate reth_era_utils 

Source
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
EraBlockReader for .era1 files.
Ere
EraBlockReader for .ere/.erae files.
ExportBlock
One block’s data, gathered by export and handed to an EraBlockWriter.
ExportConfig
Configuration to export block history to ERA files.

Traits§

EraBlockReader
Reads execution (header, body) pairs out of an ERA file.
EraBlockWriter
Writes a chunk of consecutive blocks as a single ERA file.

Functions§

build_index
Dumps the contents of hash_collector into tables::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] from BlockTuple.
export
Fetches block history from provider and writes it to ERA files in the W format, chunked by ExportConfig::max_blocks_per_file.
import
Imports blocks from downloader, decoding each file with the EraBlockReader S.
open
Opens the ERA file at meta with the format’s StreamReader.
process
Reads meta with the EraBlockReader S, appends its blocks within block_numbers, and marks meta processed if the file was fully consumed. Returns last block height.
process_iter
Extracts block headers and bodies from iter and appends them using writer and provider.
save_stage_checkpoints
Saves progress of ERA import into stages sync.