Skip to content

Commit

Permalink
fix: correctly prune transactions during on-disk reorgs
Browse files Browse the repository at this point in the history
  • Loading branch information
klkvr committed Nov 18, 2024
1 parent 5056a08 commit f0d355f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/storage/provider/src/writer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ where
let tx_range = self
.database()
.transaction_range_by_block_range(block_number + 1..=highest_static_file_block)?;
let total_txs = tx_range.end().saturating_sub(*tx_range.start());
let total_txs = (tx_range.end() + 1).saturating_sub(*tx_range.start());

// IMPORTANT: we use `block_number+1` to make sure we remove only what is ABOVE the block
debug!(target: "provider::storage_writer", ?block_number, "Removing blocks from database above block_number");
Expand Down

0 comments on commit f0d355f

Please sign in to comment.