feat(bin): unhide and enable full flag (#4327)

This commit is contained in:
Alexey Shekhirin
2023-08-23 23:08:27 +01:00
committed by GitHub
parent fca6404fc7
commit bfa130d187
2 changed files with 8 additions and 7 deletions

View File

@ -13,30 +13,27 @@ use std::sync::Arc;
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)]
#[arg(long, default_value_t = false)]
pub full: bool,
}
impl PruningArgs {
/// Returns pruning configuration.
pub fn prune_config(&self, _chain_spec: Arc<ChainSpec>) -> eyre::Result<Option<PruneConfig>> {
pub fn prune_config(&self, chain_spec: Arc<ChainSpec>) -> eyre::Result<Option<PruneConfig>> {
Ok(if self.full {
eyre::bail!("full node is not supported yet, keep an eye on next releases");
#[allow(unreachable_code)]
Some(PruneConfig {
block_interval: 5,
parts: PruneModes {
sender_recovery: Some(PruneMode::Distance(MINIMUM_PRUNING_DISTANCE)),
transaction_lookup: None,
receipts: _chain_spec
receipts: chain_spec
.deposit_contract
.as_ref()
.map(|contract| PruneMode::Before(contract.block)),
account_history: Some(PruneMode::Distance(MINIMUM_PRUNING_DISTANCE)),
storage_history: Some(PruneMode::Distance(MINIMUM_PRUNING_DISTANCE)),
receipts_log_filter: ReceiptsLogPruneConfig(
_chain_spec
chain_spec
.deposit_contract
.as_ref()
.map(|contract| (contract.address, PruneMode::Before(contract.block)))

View File

@ -332,6 +332,10 @@ Dev testnet:
Parses strings using [humantime::parse_duration]
--dev.block-time 12s
Pruning:
--full
Run full node. Only the most recent 128 block states are stored. This flag takes priority over pruning configuration in reth.toml
Logging:
--log.persistent