feat(pruner): transaction senders (#3912)

This commit is contained in:
Alexey Shekhirin
2023-08-01 12:30:02 +01:00
committed by GitHub
parent 3a4419625a
commit 4688fd2ae0
4 changed files with 221 additions and 17 deletions

View File

@@ -10,7 +10,12 @@ use serde::{Deserialize, Serialize};
#[serde(default)]
pub struct PruneModes {
/// Sender Recovery pruning configuration.
#[serde(skip_serializing_if = "Option::is_none")]
// TODO(alexey): removing min blocks restriction is possible if we start calculating the senders
// dynamically on blockchain tree unwind.
#[serde(
skip_serializing_if = "Option::is_none",
deserialize_with = "deserialize_opt_prune_mode_with_min_blocks::<64, _>"
)]
pub sender_recovery: Option<PruneMode>,
/// Transaction Lookup pruning configuration.
#[serde(skip_serializing_if = "Option::is_none")]
@@ -126,7 +131,7 @@ impl PruneModes {
}
impl_prune_parts!(
(sender_recovery, "SenderRecovery", None),
(sender_recovery, "SenderRecovery", Some(64)),
(transaction_lookup, "TransactionLookup", None),
(receipts, "Receipts", Some(64)),
(account_history, "AccountHistory", Some(64)),