Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/optimism/cli/src/commands/op_proofs/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ impl<C: ChainSpecParser<ChainSpec = OpChainSpec>> InitCommand<C> {
.into();

// Check if already initialized
if let Some((block_number, block_hash)) = storage.get_earliest_block_number().await? {
if let Some((block_number, block_hash)) = storage.get_earliest_block_number()? {
info!(
target: "reth::cli",
block_number = block_number,
Expand All @@ -80,7 +80,7 @@ impl<C: ChainSpecParser<ChainSpec = OpChainSpec>> InitCommand<C> {
provider_factory.database_provider_ro()?.disable_long_read_transaction_safety();
let db_tx = db_provider.into_tx();

InitializationJob::new(storage.clone(), db_tx).run(best_number, best_hash).await?;
InitializationJob::new(storage, db_tx).run(best_number, best_hash)?;
}

info!(
Expand Down
6 changes: 3 additions & 3 deletions crates/optimism/cli/src/commands/op_proofs/prune.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ impl<C: ChainSpecParser<ChainSpec = OpChainSpec>> PruneCommand<C> {
)
.into();

let earliest_block = storage.get_earliest_block_number().await?;
let latest_block = storage.get_latest_block_number().await?;
let earliest_block = storage.get_earliest_block_number()?;
let latest_block = storage.get_latest_block_number()?;
info!(
target: "reth::cli",
?earliest_block,
Expand All @@ -77,7 +77,7 @@ impl<C: ChainSpecParser<ChainSpec = OpChainSpec>> PruneCommand<C> {
self.proofs_history_window,
self.proofs_history_prune_batch_size,
);
pruner.run().await;
pruner.run();
Ok(())
}
}
Expand Down
8 changes: 4 additions & 4 deletions crates/optimism/cli/src/commands/op_proofs/unwind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ pub struct UnwindCommand<C: ChainSpecParser> {

impl<C: ChainSpecParser> UnwindCommand<C> {
/// Validates that the target block number is within a valid range for unwinding.
async fn validate_unwind_range<Store: OpProofsStore>(
fn validate_unwind_range<Store: OpProofsStore>(
&self,
storage: &OpProofsStorage<Store>,
) -> eyre::Result<bool> {
let (Some((earliest, _)), Some((latest, _))) =
(storage.get_earliest_block_number().await?, storage.get_latest_block_number().await?)
(storage.get_earliest_block_number()?, storage.get_latest_block_number()?)
else {
warn!(target: "reth::cli", "No blocks found in proofs storage. Nothing to unwind.");
return Ok(false);
Expand Down Expand Up @@ -80,7 +80,7 @@ impl<C: ChainSpecParser<ChainSpec = OpChainSpec>> UnwindCommand<C> {
.into();

// Validate that the target block is within a valid range for unwinding
if !self.validate_unwind_range(&storage).await? {
if !self.validate_unwind_range(&storage)? {
return Ok(());
}

Expand All @@ -92,7 +92,7 @@ impl<C: ChainSpecParser<ChainSpec = OpChainSpec>> UnwindCommand<C> {
})?;

info!(target: "reth::cli", block_number = block.number, block_hash = %block.hash(), "Unwinding to target block");
storage.unwind_history(block.block_with_parent()).await?;
storage.unwind_history(block.block_with_parent())?;

Ok(())
}
Expand Down
Loading
Loading