-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
73 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
//! Pruning and full node arguments | ||
|
||
use clap::Args; | ||
use reth_config::config::PruneConfig; | ||
use reth_primitives::{ChainSpec, PruneMode, PruneModes}; | ||
use std::sync::Arc; | ||
|
||
/// Parameters for pruning and full node | ||
#[derive(Debug, Args, PartialEq, Default)] | ||
#[command(next_help_heading = "Pruning")] | ||
pub struct PruningArgs { | ||
/// Run full node. Only the most recent 128 block states are stored. This flag takes | ||
/// priority over pruning configuration in reth.toml. | ||
// TODO(alexey): unhide when pruning is ready for production use | ||
#[arg(long, hide = true, default_value_t = false)] | ||
pub full: bool, | ||
} | ||
|
||
impl PruningArgs { | ||
/// Returns pruning configuration. | ||
pub fn prune_config(&self, chain_spec: Arc<ChainSpec>) -> Option<PruneConfig> { | ||
if self.full { | ||
Some(PruneConfig { | ||
block_interval: 5, | ||
parts: PruneModes { | ||
sender_recovery: Some(PruneMode::Distance(128)), | ||
transaction_lookup: None, | ||
receipts: chain_spec.deposit_contract_deployment_block.map(PruneMode::Before), | ||
account_history: Some(PruneMode::Distance(128)), | ||
storage_history: Some(PruneMode::Distance(128)), | ||
}, | ||
}) | ||
} else { | ||
None | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters