Skip to content

Commit

Permalink
add trace, commit & default value for lookback
Browse files Browse the repository at this point in the history
  • Loading branch information
rkrasiuk committed Aug 8, 2023
1 parent e08fee4 commit dd9b7a3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bin/reth/src/recover/storage_tries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ pub struct Command {
)]
chain: Arc<ChainSpec>,

#[arg(long, default_value_t)]
/// The number of blocks in the past to look through.
#[arg(long, default_value_t = 100)]
lookback: u64,
}

Expand Down Expand Up @@ -82,12 +83,13 @@ impl Command {
let hashed_address = keccak256(address);
if storage_trie_cursor.seek_exact(hashed_address)?.is_some() {
deleted_tries += 1;
trace!(target: "reth::cli", ?address, ?hashed_address, "Deleting storage trie");
storage_trie_cursor.delete_current_duplicates()?;
}
}

provider.commit()?;
info!(target: "reth::cli", deleted = deleted_tries, "Finished recovery");
// provider.commit()?;

Ok(())
}
Expand Down

0 comments on commit dd9b7a3

Please sign in to comment.