Skip to content

Commit

Permalink
primitives: use alloy MAXIMUM_EXTRA_DATA_SIZE constant (#11881)
Browse files Browse the repository at this point in the history
  • Loading branch information
tcoratger authored Oct 19, 2024
1 parent a6daafc commit 2f559c6
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 15 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/consensus/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ reth-consensus.workspace = true
# ethereum
alloy-primitives.workspace = true
revm-primitives.workspace = true
alloy-consensus.workspace = true

[dev-dependencies]
reth-storage-api.workspace = true
Expand Down
6 changes: 2 additions & 4 deletions crates/consensus/common/src/validation.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
//! Collection of methods for block validation.

use alloy_consensus::constants::MAXIMUM_EXTRA_DATA_SIZE;
use reth_chainspec::{EthChainSpec, EthereumHardforks};
use reth_consensus::ConsensusError;
use reth_primitives::{
constants::{
eip4844::{DATA_GAS_PER_BLOB, MAX_DATA_GAS_PER_BLOCK},
MAXIMUM_EXTRA_DATA_SIZE,
},
constants::eip4844::{DATA_GAS_PER_BLOB, MAX_DATA_GAS_PER_BLOCK},
EthereumHardfork, GotExpected, Header, SealedBlock, SealedHeader,
};
use revm_primitives::calc_excess_blob_gas;
Expand Down
5 changes: 2 additions & 3 deletions crates/node/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ reth-stages-types.workspace = true
# ethereum
alloy-primitives.workspace = true
alloy-rpc-types-engine = { workspace = true, features = ["jwt"] }
alloy-consensus.workspace = true

# misc
eyre.workspace = true
Expand Down Expand Up @@ -76,9 +77,7 @@ tokio.workspace = true
tempfile.workspace = true

[features]
optimism = [
"reth-primitives/optimism"
]
optimism = ["reth-primitives/optimism"]
# Features for vergen to generate correct env vars
jemalloc = []
asm-keccak = []
Expand Down
5 changes: 2 additions & 3 deletions crates/node/core/src/args/payload_builder.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
use crate::{cli::config::PayloadBuilderConfig, version::default_extradata};
use alloy_consensus::constants::MAXIMUM_EXTRA_DATA_SIZE;
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, MAXIMUM_EXTRA_DATA_SIZE, SLOT_DURATION,
};
use reth_primitives::constants::{ETHEREUM_BLOCK_GAS_LIMIT, SLOT_DURATION};
use std::{borrow::Cow, ffi::OsStr, time::Duration};

/// Parameters for configuring the Payload Builder
Expand Down
3 changes: 0 additions & 3 deletions crates/primitives-traits/src/constants/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ pub const RETH_CLIENT_VERSION: &str = concat!("reth/v", env!("CARGO_PKG_VERSION"
/// The first four bytes of the call data for a function call specifies the function to be called.
pub const SELECTOR_LEN: usize = 4;

/// Maximum extra data size in a block after genesis
pub const MAXIMUM_EXTRA_DATA_SIZE: usize = 32;

/// An EPOCH is a series of 32 slots.
pub const EPOCH_SLOTS: u64 = 32;

Expand Down
3 changes: 1 addition & 2 deletions crates/rpc/rpc-types-compat/src/engine/payload.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Standalone Conversion Functions for Handling Different Versions of Execution Payloads in
//! Ethereum's Engine

use alloy_consensus::EMPTY_OMMER_ROOT_HASH;
use alloy_consensus::{constants::MAXIMUM_EXTRA_DATA_SIZE, EMPTY_OMMER_ROOT_HASH};
use alloy_eips::eip2718::{Decodable2718, Encodable2718};
use alloy_primitives::{B256, U256};
use alloy_rpc_types_engine::{
Expand All @@ -10,7 +10,6 @@ use alloy_rpc_types_engine::{
ExecutionPayloadV4, PayloadError,
};
use reth_primitives::{
constants::MAXIMUM_EXTRA_DATA_SIZE,
proofs::{self},
Block, BlockBody, Header, Request, SealedBlock, TransactionSigned, Withdrawals,
};
Expand Down

0 comments on commit 2f559c6

Please sign in to comment.