fix(cli): set receipts pruning for chain without deposit contract (#9782)

This commit is contained in:
Emilia Hane
2024-07-25 19:21:49 +02:00
committed by GitHub
parent 05135c41ef
commit f175f6ec9f

View File

@ -21,15 +21,18 @@ impl PruningArgs {
if !self.full {
return None
}
Some(PruneConfig {
block_interval: 5,
segments: PruneModes {
sender_recovery: Some(PruneMode::Full),
transaction_lookup: None,
// prune all receipts if chain doesn't have deposit contract specified in chain spec
receipts: chain_spec
.deposit_contract
.as_ref()
.map(|contract| PruneMode::Before(contract.block)),
.map(|contract| PruneMode::Before(contract.block))
.or(Some(PruneMode::Full)),
account_history: Some(PruneMode::Distance(MINIMUM_PRUNING_DISTANCE)),
storage_history: Some(PruneMode::Distance(MINIMUM_PRUNING_DISTANCE)),
receipts_log_filter: ReceiptsLogPruneConfig(