Skip to content
This repository has been archived by the owner on Feb 6, 2025. It is now read-only.

fix: unwind_to should be exclusive #137

Merged
merged 1 commit into from
Sep 9, 2024
Merged
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
3 changes: 2 additions & 1 deletion crates/stages/stages/src/stages/headers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,9 @@ where

// First unwind the db tables, until the unwind_to block number. use the walker to unwind
// HeaderNumbers based on the index in CanonicalHeaders
// unwind from the next block number since the unwind_to block is exclusive
provider.unwind_table_by_walker::<tables::CanonicalHeaders, tables::HeaderNumbers>(
input.unwind_to..,
(input.unwind_to + 1)..,
)?;
provider.unwind_table_by_num::<tables::CanonicalHeaders>(input.unwind_to)?;
provider.unwind_table_by_num::<tables::HeaderTerminalDifficulties>(input.unwind_to)?;
Expand Down