diff --git a/Cargo.lock b/Cargo.lock index f2d134cb85f7..92a9d6887d61 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6370,6 +6370,7 @@ name = "reth-basic-payload-builder" version = "1.1.0" dependencies = [ "alloy-consensus", + "alloy-eips", "alloy-primitives", "alloy-rlp", "futures-core", @@ -7911,6 +7912,7 @@ name = "reth-node-core" version = "1.1.0" dependencies = [ "alloy-consensus", + "alloy-eips", "alloy-primitives", "alloy-rpc-types-engine", "clap", diff --git a/crates/node/core/Cargo.toml b/crates/node/core/Cargo.toml index 73c552f4d7a8..0c9672d17779 100644 --- a/crates/node/core/Cargo.toml +++ b/crates/node/core/Cargo.toml @@ -40,6 +40,7 @@ reth-stages-types.workspace = true alloy-primitives.workspace = true alloy-rpc-types-engine = { workspace = true, features = ["jwt"] } alloy-consensus.workspace = true +alloy-eips.workspace = true # misc eyre.workspace = true @@ -76,18 +77,10 @@ proptest.workspace = true tokio.workspace = true [features] -optimism = [ - "reth-primitives/optimism", - "reth-db/optimism" -] +optimism = ["reth-primitives/optimism", "reth-db/optimism"] # Features for vergen to generate correct env vars -jemalloc = [ - "reth-cli-util/jemalloc" -] -asm-keccak = [ - "reth-primitives/asm-keccak", - "alloy-primitives/asm-keccak" -] +jemalloc = ["reth-cli-util/jemalloc"] +asm-keccak = ["reth-primitives/asm-keccak", "alloy-primitives/asm-keccak"] [build-dependencies] vergen = { version = "8.0.0", features = ["build", "cargo", "git", "gitcl"] } diff --git a/crates/node/core/src/args/payload_builder.rs b/crates/node/core/src/args/payload_builder.rs index 4a18fd5b0b7d..dceb10726ff2 100644 --- a/crates/node/core/src/args/payload_builder.rs +++ b/crates/node/core/src/args/payload_builder.rs @@ -1,11 +1,12 @@ use crate::{cli::config::PayloadBuilderConfig, version::default_extradata}; use alloy_consensus::constants::MAXIMUM_EXTRA_DATA_SIZE; +use alloy_eips::merge::SLOT_DURATION; use clap::{ builder::{RangedU64ValueParser, TypedValueParser}, Arg, Args, Command, }; use reth_cli_util::{parse_duration_from_secs, parse_duration_from_secs_or_ms}; -use reth_primitives::constants::{ETHEREUM_BLOCK_GAS_LIMIT, SLOT_DURATION}; +use reth_primitives::constants::ETHEREUM_BLOCK_GAS_LIMIT; use std::{borrow::Cow, ffi::OsStr, time::Duration}; /// Parameters for configuring the Payload Builder diff --git a/crates/payload/basic/Cargo.toml b/crates/payload/basic/Cargo.toml index 9047768892a9..88ab99272dbd 100644 --- a/crates/payload/basic/Cargo.toml +++ b/crates/payload/basic/Cargo.toml @@ -27,6 +27,7 @@ alloy-rlp.workspace = true alloy-primitives.workspace = true revm.workspace = true alloy-consensus.workspace = true +alloy-eips.workspace = true # async tokio = { workspace = true, features = ["sync", "time"] } diff --git a/crates/payload/basic/src/lib.rs b/crates/payload/basic/src/lib.rs index fcc8be9a88ed..4274d451e43f 100644 --- a/crates/payload/basic/src/lib.rs +++ b/crates/payload/basic/src/lib.rs @@ -10,6 +10,7 @@ use crate::metrics::PayloadBuilderMetrics; use alloy_consensus::constants::EMPTY_WITHDRAWALS; +use alloy_eips::merge::SLOT_DURATION; use alloy_primitives::{Bytes, B256, U256}; use futures_core::ready; use futures_util::FutureExt; @@ -22,8 +23,7 @@ use reth_payload_primitives::{ BuiltPayload, PayloadBuilderAttributes, PayloadBuilderError, PayloadKind, }; use reth_primitives::{ - constants::{RETH_CLIENT_VERSION, SLOT_DURATION}, - proofs, BlockNumberOrTag, SealedBlock, Withdrawals, + constants::RETH_CLIENT_VERSION, proofs, BlockNumberOrTag, SealedBlock, Withdrawals, }; use reth_provider::{ BlockReaderIdExt, BlockSource, CanonStateNotification, ProviderError, StateProviderFactory, diff --git a/crates/primitives-traits/src/constants/mod.rs b/crates/primitives-traits/src/constants/mod.rs index 2874c596a8a4..a4091a4a9d9c 100644 --- a/crates/primitives-traits/src/constants/mod.rs +++ b/crates/primitives-traits/src/constants/mod.rs @@ -1,7 +1,6 @@ //! Ethereum protocol-related constants use alloy_primitives::{address, b256, Address, B256, U256}; -use core::time::Duration; /// Gas units, for example [`GIGAGAS`]. pub mod gas_units; @@ -13,15 +12,6 @@ pub const RETH_CLIENT_VERSION: &str = concat!("reth/v", env!("CARGO_PKG_VERSION" /// An EPOCH is a series of 32 slots. pub const EPOCH_SLOTS: u64 = 32; -/// The duration of a slot in seconds. -/// -/// This is the time period of 12 seconds in which a randomly chosen validator has time to propose a -/// block. -pub const SLOT_DURATION: Duration = Duration::from_secs(12); - -/// An EPOCH is a series of 32 slots (~6.4min). -pub const EPOCH_DURATION: Duration = Duration::from_secs(12 * EPOCH_SLOTS); - /// The default block nonce in the beacon consensus pub const BEACON_NONCE: u64 = 0u64;