Skip to content

Commit

Permalink
chore(chainspec): remove MAINNET usage from ChainSpec::default (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes authored Feb 18, 2025
1 parent c0a30f0 commit 3485ce4
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
4 changes: 4 additions & 0 deletions crates/chainspec/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ use alloy_primitives::b256;

/// Gas per transaction not creating a contract.
pub const MIN_TRANSACTION_GAS: u64 = 21_000u64;

/// Mainnet prune delete limit.
pub const MAINNET_PRUNE_DELETE_LIMIT: usize = 20000;

/// Deposit contract address: `0x00000000219ab540356cbb839cbe05303d7705fa`
pub(crate) const MAINNET_DEPOSIT_CONTRACT: DepositContract = DepositContract::new(
MAINNET_DEPOSIT_CONTRACT_ADDRESS,
Expand Down
4 changes: 2 additions & 2 deletions crates/chainspec/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
extern crate alloc;

/// Chain specific constants
pub(crate) mod constants;
pub use constants::MIN_TRANSACTION_GAS;
mod constants;
pub use constants::*;

mod api;
/// The chain info module.
Expand Down
7 changes: 5 additions & 2 deletions crates/chainspec/src/spec.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
pub use alloy_eips::eip1559::BaseFeeParams;

use crate::{constants::MAINNET_DEPOSIT_CONTRACT, EthChainSpec};
use crate::{
constants::{MAINNET_DEPOSIT_CONTRACT, MAINNET_PRUNE_DELETE_LIMIT},
EthChainSpec,
};
use alloc::{boxed::Box, collections::BTreeMap, string::String, sync::Arc, vec::Vec};
use alloy_chains::{Chain, NamedChain};
use alloy_consensus::{
Expand Down Expand Up @@ -320,7 +323,7 @@ impl Default for ChainSpec {
hardforks: Default::default(),
deposit_contract: Default::default(),
base_fee_params: BaseFeeParamsKind::Constant(BaseFeeParams::ethereum()),
prune_delete_limit: MAINNET.prune_delete_limit,
prune_delete_limit: MAINNET_PRUNE_DELETE_LIMIT,
blob_params: Default::default(),
}
}
Expand Down
4 changes: 2 additions & 2 deletions crates/prune/prune/src/builder.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{segments::SegmentSet, Pruner};
use alloy_eips::eip2718::Encodable2718;
use reth_chainspec::MAINNET;
use reth_chainspec::MAINNET_PRUNE_DELETE_LIMIT;
use reth_config::PruneConfig;
use reth_db_api::{table::Value, transaction::DbTxMut};
use reth_exex_types::FinishedExExHeight;
Expand Down Expand Up @@ -129,7 +129,7 @@ impl Default for PrunerBuilder {
Self {
block_interval: 5,
segments: PruneModes::none(),
delete_limit: MAINNET.prune_delete_limit,
delete_limit: MAINNET_PRUNE_DELETE_LIMIT,
timeout: None,
finished_exex_height: watch::channel(FinishedExExHeight::NoExExs).1,
}
Expand Down
3 changes: 2 additions & 1 deletion crates/prune/types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ mod target;

use alloc::{collections::BTreeMap, vec::Vec};
use alloy_primitives::{Address, BlockNumber};
pub use checkpoint::PruneCheckpoint;
use core::ops::Deref;

pub use checkpoint::PruneCheckpoint;
pub use event::PrunerEvent;
pub use mode::PruneMode;
pub use pruner::{
Expand Down

0 comments on commit 3485ce4

Please sign in to comment.