diff --git a/crates/storage/provider/src/providers/database/mod.rs b/crates/storage/provider/src/providers/database/mod.rs index e9da00b85059..525d4c7ba822 100644 --- a/crates/storage/provider/src/providers/database/mod.rs +++ b/crates/storage/provider/src/providers/database/mod.rs @@ -468,6 +468,10 @@ mod tests { { let provider = factory.provider_rw().unwrap(); assert_matches!(provider.insert_block(block.clone(), None, None), Ok(_)); + assert_matches!( + provider.transaction_sender(0), Ok(Some(sender)) + if sender == block.body[0].recover_signer().unwrap() + ); assert_matches!(provider.transaction_id(block.body[0].hash), Ok(Some(0))); } @@ -478,12 +482,14 @@ mod tests { block.clone(), None, Some(&PruneModes { + sender_recovery: Some(PruneMode::Full), transaction_lookup: Some(PruneMode::Full), ..PruneModes::none() }) ), Ok(_) ); + assert_matches!(provider.transaction_sender(0), Ok(None)); assert_matches!(provider.transaction_id(block.body[0].hash), Ok(None)); } } diff --git a/crates/storage/provider/src/providers/database/provider.rs b/crates/storage/provider/src/providers/database/provider.rs index d811e9ab3ccc..efdf2edbb181 100644 --- a/crates/storage/provider/src/providers/database/provider.rs +++ b/crates/storage/provider/src/providers/database/provider.rs @@ -1980,7 +1980,15 @@ impl<'this, TX: DbTxMut<'this> + DbTx<'this>> BlockWriter for DatabaseProvider<' for (transaction, sender) in tx_iter { let hash = transaction.hash(); - self.tx.put::(next_tx_num, sender)?; + + if prune_modes + .and_then(|modes| modes.sender_recovery) + .filter(|prune_mode| prune_mode.is_full()) + .is_none() + { + self.tx.put::(next_tx_num, sender)?; + } + self.tx.put::(next_tx_num, transaction.into())?; if prune_modes