refactor(primitive-traits): use alloy EPOCH_SLOTS constant (#12018)

This commit is contained in:
Thomas Coratger
2024-10-24 01:15:45 +02:00
committed by GitHub
parent 565e4b400d
commit 044e2d6aea
5 changed files with 6 additions and 7 deletions

1
Cargo.lock generated
View File

@ -6394,6 +6394,7 @@ dependencies = [
name = "reth-beacon-consensus"
version = "1.1.0"
dependencies = [
"alloy-eips",
"alloy-genesis",
"alloy-primitives",
"alloy-rpc-types-engine",

View File

@ -33,6 +33,7 @@ reth-chainspec = { workspace = true, optional = true }
# ethereum
alloy-primitives.workspace = true
alloy-rpc-types-engine.workspace = true
alloy-eips.workspace = true
# async
tokio = { workspace = true, features = ["sync"] }

View File

@ -1,3 +1,4 @@
use alloy_eips::merge::EPOCH_SLOTS;
use alloy_primitives::{BlockNumber, B256};
use alloy_rpc_types_engine::{
ExecutionPayload, ExecutionPayloadSidecar, ForkchoiceState, PayloadStatus, PayloadStatusEnum,
@ -19,9 +20,7 @@ use reth_node_types::NodeTypesWithEngine;
use reth_payload_builder::PayloadBuilderHandle;
use reth_payload_primitives::{PayloadAttributes, PayloadBuilder, PayloadBuilderAttributes};
use reth_payload_validator::ExecutionPayloadValidator;
use reth_primitives::{
constants::EPOCH_SLOTS, BlockNumHash, Head, Header, SealedBlock, SealedHeader,
};
use reth_primitives::{BlockNumHash, Head, Header, SealedBlock, SealedHeader};
use reth_provider::{
providers::ProviderNodeTypes, BlockIdReader, BlockReader, BlockSource, CanonChainTracker,
ChainSpecProvider, ProviderError, StageCheckpointReader,

View File

@ -9,9 +9,6 @@ pub use gas_units::{GIGAGAS, KILOGAS, MEGAGAS};
/// The client version: `reth/v{major}.{minor}.{patch}`
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 default block nonce in the beacon consensus
pub const BEACON_NONCE: u64 = 0u64;

View File

@ -2,6 +2,7 @@ use crate::{
providers::{state::macros::delegate_provider_impls, StaticFileProvider},
AccountReader, BlockHashReader, ProviderError, StateProvider, StateRootProvider,
};
use alloy_eips::merge::EPOCH_SLOTS;
use alloy_primitives::{
map::{HashMap, HashSet},
Address, BlockNumber, Bytes, StorageKey, StorageValue, B256,
@ -13,7 +14,7 @@ use reth_db_api::{
table::Table,
transaction::DbTx,
};
use reth_primitives::{constants::EPOCH_SLOTS, Account, Bytecode, StaticFileSegment};
use reth_primitives::{Account, Bytecode, StaticFileSegment};
use reth_storage_api::{StateProofProvider, StorageRootProvider};
use reth_storage_errors::provider::ProviderResult;
use reth_trie::{