Skip to content

Commit

Permalink
save_stage_checkpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
joshieDo committed Sep 25, 2024
1 parent 1e67b5e commit 2995031
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions crates/optimism/cli/src/commands/import_receipts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ use reth_node_core::version::SHORT_VERSION;
use reth_optimism_primitives::bedrock::is_dup_tx;
use reth_primitives::Receipts;
use reth_provider::{
writer::UnifiedStorageWriter, DatabaseProviderFactory, OriginalValuesKnown, ProviderFactory,
StageCheckpointReader, StateWriter, StaticFileProviderFactory, StaticFileWriter, StatsReader,
writer::UnifiedStorageWriter, DatabaseProviderFactory, OriginalValuesKnown, ProviderFactory, StageCheckpointReader, StageCheckpointWriter, StateWriter, StaticFileProviderFactory, StaticFileWriter, StatsReader
};
use reth_stages::StageId;
use reth_stages::{StageCheckpoint, StageId};
use reth_static_file_types::StaticFileSegment;
use tracing::{debug, info, trace, warn};

Expand Down Expand Up @@ -242,6 +241,9 @@ where
eyre::bail!("Receipt block height ({highest_block_receipts}) inconsistent with transactions' {highest_block_transactions}")
}

// Required or any access-write provider factory will attempt to unwind to 0.
provider.save_stage_checkpoint(StageId::Execution, StageCheckpoint::new(highest_block_receipts))?;

UnifiedStorageWriter::commit(provider, static_file_provider)?;

Ok(ImportReceiptsResult { total_decoded_receipts, total_filtered_out_dup_txns })
Expand Down

0 comments on commit 2995031

Please sign in to comment.