Add module-level documentation to ERA consumer and producer

This commit is contained in:
dapplion
2026-03-08 19:45:34 -05:00
parent f368a9a31e
commit 676ad5dbba
2 changed files with 18 additions and 0 deletions

View File

@@ -1,3 +1,12 @@
//! Import ERA files into a Lighthouse database.
//!
//! `EraFileDir` reads a directory of ERA files and imports them sequentially into the cold DB.
//! Each ERA file is verified against `historical_roots` / `historical_summaries` from the
//! highest-numbered ERA state, ensuring block and state integrity without trusting the files.
//!
//! Block roots are cross-checked against the ERA boundary state's `block_roots` vector.
//! Block signatures are NOT verified — ERA files are trusted at that level.
use bls::FixedBytesExtended;
use rayon::prelude::*;
use reth_era::common::file_ops::StreamReader;

View File

@@ -1,3 +1,12 @@
//! Export ERA files from a Lighthouse database.
//!
//! Reads blocks and states from the cold DB and writes them into the standardized ERA format.
//! ERA files are produced either during historical reconstruction (backfilling) or upon
//! finalization of new eras. Each file is named `{network}-{era_number}-{short_root}.era`.
//!
//! Files are written atomically (temp file + rename) so partial writes never appear as valid
//! ERA files. Existing files are skipped, making production idempotent.
use rand::random;
use reth_era::common::file_ops::{EraFileFormat, EraFileId, StreamWriter};
use reth_era::era::file::{EraFile, EraWriter};