diff --git a/crates/stages/stages/src/stages/headers.rs b/crates/stages/stages/src/stages/headers.rs index 71c57cae40..1065869915 100644 --- a/crates/stages/stages/src/stages/headers.rs +++ b/crates/stages/stages/src/stages/headers.rs @@ -317,7 +317,7 @@ where // First unwind the db tables, until the unwind_to block number. use the walker to unwind // HeaderNumbers based on the index in CanonicalHeaders provider.unwind_table_by_walker::( - input.unwind_to, + input.unwind_to.., )?; provider.unwind_table_by_num::(input.unwind_to)?; provider.unwind_table_by_num::(input.unwind_to)?; diff --git a/crates/storage/provider/src/providers/database/provider.rs b/crates/storage/provider/src/providers/database/provider.rs index 970c77b399..9e8e3bf355 100644 --- a/crates/storage/provider/src/providers/database/provider.rs +++ b/crates/storage/provider/src/providers/database/provider.rs @@ -1078,13 +1078,16 @@ impl DatabaseProvider { } /// Unwind a table forward by a [`Walker`][reth_db_api::cursor::Walker] on another table - pub fn unwind_table_by_walker(&self, start_at: T1::Key) -> Result<(), DatabaseError> + pub fn unwind_table_by_walker( + &self, + range: impl RangeBounds, + ) -> Result<(), DatabaseError> where T1: Table, T2: Table, { let mut cursor = self.tx.cursor_write::()?; - let mut walker = cursor.walk(Some(start_at))?; + let mut walker = cursor.walk_range(range)?; while let Some((_, value)) = walker.next().transpose()? { self.tx.delete::(value, None)?; }