From 9ecef47aff22a63862f7c9a1eab3ab7ec51c5bc9 Mon Sep 17 00:00:00 2001 From: Georgios Konstantopoulos Date: Tue, 17 Feb 2026 11:15:03 -0800 Subject: [PATCH] fix(provider): skip sender pruning during reorg when sender_recovery is full (#22271) Co-authored-by: Amp --- .changelog/rich-lakes-bark.md | 5 +++++ crates/storage/provider/src/providers/database/provider.rs | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 .changelog/rich-lakes-bark.md diff --git a/.changelog/rich-lakes-bark.md b/.changelog/rich-lakes-bark.md new file mode 100644 index 0000000000..9ef7ccc7c8 --- /dev/null +++ b/.changelog/rich-lakes-bark.md @@ -0,0 +1,5 @@ +--- +reth-provider: patch +--- + +Fixed sender pruning during block reorg to skip when sender_recovery is fully pruned, preventing a fatal crash when no sender data exists in static files. diff --git a/crates/storage/provider/src/providers/database/provider.rs b/crates/storage/provider/src/providers/database/provider.rs index 5d1750b446..5659d3b250 100644 --- a/crates/storage/provider/src/providers/database/provider.rs +++ b/crates/storage/provider/src/providers/database/provider.rs @@ -3576,7 +3576,12 @@ impl BlockWriter })?; } - EitherWriter::new_senders(self, last_block_number)?.prune_senders(unwind_tx_from, block)?; + // Skip sender pruning when sender_recovery is fully pruned, since no sender data + // exists in static files or the database. + if self.prune_modes.sender_recovery.is_none_or(|m| !m.is_full()) { + EitherWriter::new_senders(self, last_block_number)? + .prune_senders(unwind_tx_from, block)?; + } self.remove_bodies_above(block)?;