From a0dcea8aa85d14d929e19c0ed4dc6cadc5028d64 Mon Sep 17 00:00:00 2001 From: Roshan Date: Thu, 24 Oct 2024 11:40:12 +0800 Subject: [PATCH] fix: do removing sidecars in `remove_blocks_above` --- crates/storage/provider/src/writer/mod.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/storage/provider/src/writer/mod.rs b/crates/storage/provider/src/writer/mod.rs index 20ef7eac7..3135b71fa 100644 --- a/crates/storage/provider/src/writer/mod.rs +++ b/crates/storage/provider/src/writer/mod.rs @@ -327,6 +327,14 @@ where .prune_receipts(total_txs, block_number)?; } + let highest_static_file_block = self + .static_file() + .get_highest_static_file_block(StaticFileSegment::Sidecars) + .expect("todo: error handling, headers should exist"); + self.static_file() + .get_writer(block_number, StaticFileSegment::Sidecars)? + .prune_sidecars(highest_static_file_block.saturating_sub(block_number))?; + Ok(()) } }