primitives: rm alloy Withdrawals reexport (#12421)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
Thomas Coratger
2024-11-09 14:09:46 +01:00
committed by GitHub
parent ae257f5685
commit 59ebebaa63
32 changed files with 104 additions and 71 deletions

3
Cargo.lock generated
View File

@ -2611,6 +2611,7 @@ dependencies = [
name = "ef-tests" name = "ef-tests"
version = "1.1.1" version = "1.1.1"
dependencies = [ dependencies = [
"alloy-eips",
"alloy-primitives", "alloy-primitives",
"alloy-rlp", "alloy-rlp",
"rayon", "rayon",
@ -2852,6 +2853,7 @@ dependencies = [
name = "example-custom-engine-types" name = "example-custom-engine-types"
version = "0.0.0" version = "0.0.0"
dependencies = [ dependencies = [
"alloy-eips",
"alloy-genesis", "alloy-genesis",
"alloy-primitives", "alloy-primitives",
"alloy-rpc-types", "alloy-rpc-types",
@ -6915,6 +6917,7 @@ dependencies = [
name = "reth-db-models" name = "reth-db-models"
version = "1.1.1" version = "1.1.1"
dependencies = [ dependencies = [
"alloy-eips",
"alloy-primitives", "alloy-primitives",
"arbitrary", "arbitrary",
"bytes", "bytes",

View File

@ -1375,7 +1375,7 @@ where
mod tests { mod tests {
use super::*; use super::*;
use alloy_consensus::{TxEip1559, EMPTY_ROOT_HASH}; use alloy_consensus::{TxEip1559, EMPTY_ROOT_HASH};
use alloy_eips::eip1559::INITIAL_BASE_FEE; use alloy_eips::{eip1559::INITIAL_BASE_FEE, eip4895::Withdrawals};
use alloy_genesis::{Genesis, GenesisAccount}; use alloy_genesis::{Genesis, GenesisAccount};
use alloy_primitives::{keccak256, Address, PrimitiveSignature as Signature, Sealable, B256}; use alloy_primitives::{keccak256, Address, PrimitiveSignature as Signature, Sealable, B256};
use assert_matches::assert_matches; use assert_matches::assert_matches;
@ -1390,7 +1390,6 @@ mod tests {
proofs::{calculate_receipt_root, calculate_transaction_root}, proofs::{calculate_receipt_root, calculate_transaction_root},
revm_primitives::AccountInfo, revm_primitives::AccountInfo,
Account, BlockBody, Header, Transaction, TransactionSigned, TransactionSignedEcRecovered, Account, BlockBody, Header, Transaction, TransactionSigned, TransactionSignedEcRecovered,
Withdrawals,
}; };
use reth_provider::{ use reth_provider::{
test_utils::{ test_utils::{

View File

@ -275,7 +275,10 @@ pub fn validate_against_parent_4844(
mod tests { mod tests {
use super::*; use super::*;
use alloy_consensus::{TxEip4844, EMPTY_OMMER_ROOT_HASH, EMPTY_ROOT_HASH}; use alloy_consensus::{TxEip4844, EMPTY_OMMER_ROOT_HASH, EMPTY_ROOT_HASH};
use alloy_eips::{eip4895::Withdrawal, BlockHashOrNumber}; use alloy_eips::{
eip4895::{Withdrawal, Withdrawals},
BlockHashOrNumber,
};
use alloy_primitives::{ use alloy_primitives::{
hex_literal::hex, Address, BlockHash, BlockNumber, Bytes, PrimitiveSignature as Signature, hex_literal::hex, Address, BlockHash, BlockNumber, Bytes, PrimitiveSignature as Signature,
Sealable, U256, Sealable, U256,
@ -283,9 +286,7 @@ mod tests {
use mockall::mock; use mockall::mock;
use rand::Rng; use rand::Rng;
use reth_chainspec::ChainSpecBuilder; use reth_chainspec::ChainSpecBuilder;
use reth_primitives::{ use reth_primitives::{proofs, Account, BlockBody, Transaction, TransactionSigned};
proofs, Account, BlockBody, Transaction, TransactionSigned, Withdrawals,
};
use reth_storage_api::{ use reth_storage_api::{
errors::provider::ProviderResult, AccountReader, HeaderProvider, WithdrawalsProvider, errors::provider::ProviderResult, AccountReader, HeaderProvider, WithdrawalsProvider,
}; };

View File

@ -1,6 +1,6 @@
//! Contains types required for building a payload. //! Contains types required for building a payload.
use alloy_eips::{eip4844::BlobTransactionSidecar, eip7685::Requests}; use alloy_eips::{eip4844::BlobTransactionSidecar, eip4895::Withdrawals, eip7685::Requests};
use alloy_primitives::{Address, B256, U256}; use alloy_primitives::{Address, B256, U256};
use alloy_rlp::Encodable; use alloy_rlp::Encodable;
use alloy_rpc_types_engine::{ use alloy_rpc_types_engine::{
@ -9,7 +9,7 @@ use alloy_rpc_types_engine::{
}; };
use reth_chain_state::ExecutedBlock; use reth_chain_state::ExecutedBlock;
use reth_payload_primitives::{BuiltPayload, PayloadBuilderAttributes}; use reth_payload_primitives::{BuiltPayload, PayloadBuilderAttributes};
use reth_primitives::{SealedBlock, Withdrawals}; use reth_primitives::SealedBlock;
use reth_rpc_types_compat::engine::payload::{ use reth_rpc_types_compat::engine::payload::{
block_to_payload_v1, block_to_payload_v3, convert_block_to_payload_field_v2, block_to_payload_v1, block_to_payload_v3, convert_block_to_payload_field_v2,
}; };

View File

@ -2,7 +2,7 @@
use alloy_eips::{ use alloy_eips::{
eip1559::BaseFeeParams, eip2718::Decodable2718, eip4844::BlobTransactionSidecar, eip1559::BaseFeeParams, eip2718::Decodable2718, eip4844::BlobTransactionSidecar,
eip7685::Requests, eip4895::Withdrawals, eip7685::Requests,
}; };
use alloy_primitives::{keccak256, Address, Bytes, B256, B64, U256}; use alloy_primitives::{keccak256, Address, Bytes, B256, B64, U256};
use alloy_rlp::Encodable; use alloy_rlp::Encodable;
@ -16,7 +16,7 @@ use reth_chainspec::EthereumHardforks;
use reth_optimism_chainspec::OpChainSpec; use reth_optimism_chainspec::OpChainSpec;
use reth_payload_builder::EthPayloadBuilderAttributes; use reth_payload_builder::EthPayloadBuilderAttributes;
use reth_payload_primitives::{BuiltPayload, PayloadBuilderAttributes}; use reth_payload_primitives::{BuiltPayload, PayloadBuilderAttributes};
use reth_primitives::{transaction::WithEncoded, SealedBlock, TransactionSigned, Withdrawals}; use reth_primitives::{transaction::WithEncoded, SealedBlock, TransactionSigned};
use reth_rpc_types_compat::engine::payload::{ use reth_rpc_types_compat::engine::payload::{
block_to_payload_v1, block_to_payload_v3, convert_block_to_payload_field_v2, block_to_payload_v1, block_to_payload_v3, convert_block_to_payload_field_v2,
}; };

View File

@ -10,7 +10,7 @@
use crate::metrics::PayloadBuilderMetrics; use crate::metrics::PayloadBuilderMetrics;
use alloy_consensus::constants::EMPTY_WITHDRAWALS; use alloy_consensus::constants::EMPTY_WITHDRAWALS;
use alloy_eips::merge::SLOT_DURATION; use alloy_eips::{eip4895::Withdrawals, merge::SLOT_DURATION};
use alloy_primitives::{Bytes, B256, U256}; use alloy_primitives::{Bytes, B256, U256};
use futures_core::ready; use futures_core::ready;
use futures_util::FutureExt; use futures_util::FutureExt;
@ -20,7 +20,7 @@ use reth_payload_builder::{KeepPayloadJobAlive, PayloadId, PayloadJob, PayloadJo
use reth_payload_primitives::{ use reth_payload_primitives::{
BuiltPayload, PayloadBuilderAttributes, PayloadBuilderError, PayloadKind, BuiltPayload, PayloadBuilderAttributes, PayloadBuilderError, PayloadKind,
}; };
use reth_primitives::{constants::RETH_CLIENT_VERSION, proofs, SealedHeader, Withdrawals}; use reth_primitives::{constants::RETH_CLIENT_VERSION, proofs, SealedHeader};
use reth_provider::{BlockReaderIdExt, CanonStateNotification, StateProviderFactory}; use reth_provider::{BlockReaderIdExt, CanonStateNotification, StateProviderFactory};
use reth_revm::cached::CachedReads; use reth_revm::cached::CachedReads;
use reth_tasks::TaskSpawner; use reth_tasks::TaskSpawner;

View File

@ -3,10 +3,11 @@ use crate::{
PayloadConfig, PayloadConfig,
}; };
use alloy_eips::eip4895::Withdrawals;
use alloy_primitives::{Address, B256, U256}; use alloy_primitives::{Address, B256, U256};
use reth_payload_builder::PayloadId; use reth_payload_builder::PayloadId;
use reth_payload_primitives::BuiltPayload; use reth_payload_primitives::BuiltPayload;
use reth_primitives::{SealedBlock, Withdrawals}; use reth_primitives::SealedBlock;
use alloy_eips::eip7685::Requests; use alloy_eips::eip7685::Requests;
use std::{error::Error, fmt}; use std::{error::Error, fmt};

View File

@ -1,9 +1,12 @@
use crate::{PayloadBuilderError, PayloadEvents, PayloadKind, PayloadTypes}; use crate::{PayloadBuilderError, PayloadEvents, PayloadKind, PayloadTypes};
use alloy_eips::{eip4895::Withdrawal, eip7685::Requests}; use alloy_eips::{
eip4895::{Withdrawal, Withdrawals},
eip7685::Requests,
};
use alloy_primitives::{Address, B256, U256}; use alloy_primitives::{Address, B256, U256};
use alloy_rpc_types_engine::{PayloadAttributes as EthPayloadAttributes, PayloadId}; use alloy_rpc_types_engine::{PayloadAttributes as EthPayloadAttributes, PayloadId};
use reth_chain_state::ExecutedBlock; use reth_chain_state::ExecutedBlock;
use reth_primitives::{SealedBlock, Withdrawals}; use reth_primitives::SealedBlock;
use tokio::sync::oneshot; use tokio::sync::oneshot;
/// A type that can request, subscribe to and resolve payloads. /// A type that can request, subscribe to and resolve payloads.

View File

@ -37,7 +37,7 @@ pub mod block;
pub use block::{body::BlockBody, Block, FullBlock}; pub use block::{body::BlockBody, Block, FullBlock};
mod withdrawal; mod withdrawal;
pub use withdrawal::{Withdrawal, Withdrawals}; pub use withdrawal::Withdrawal;
mod error; mod error;
pub use error::{GotExpected, GotExpectedBoxed}; pub use error::{GotExpected, GotExpectedBoxed};

View File

@ -4,9 +4,6 @@
#[doc(inline)] #[doc(inline)]
pub use alloy_eips::eip4895::Withdrawal; pub use alloy_eips::eip4895::Withdrawal;
/// Represents a collection of Withdrawals.
pub type Withdrawals = alloy_eips::eip4895::Withdrawals;
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;

View File

@ -1,8 +1,6 @@
use crate::{ use crate::{GotExpected, Header, SealedHeader, TransactionSigned, TransactionSignedEcRecovered};
GotExpected, Header, SealedHeader, TransactionSigned, TransactionSignedEcRecovered, Withdrawals,
};
use alloc::vec::Vec; use alloc::vec::Vec;
use alloy_eips::eip2718::Encodable2718; use alloy_eips::{eip2718::Encodable2718, eip4895::Withdrawals};
use alloy_primitives::{Address, Bytes, Sealable, B256}; use alloy_primitives::{Address, Bytes, Sealable, B256};
use alloy_rlp::{Decodable, Encodable, RlpDecodable, RlpEncodable}; use alloy_rlp::{Decodable, Encodable, RlpDecodable, RlpEncodable};
use derive_more::{Deref, DerefMut}; use derive_more::{Deref, DerefMut};
@ -655,8 +653,9 @@ impl<'a> arbitrary::Arbitrary<'a> for BlockBody {
pub(super) mod serde_bincode_compat { pub(super) mod serde_bincode_compat {
use alloc::{borrow::Cow, vec::Vec}; use alloc::{borrow::Cow, vec::Vec};
use alloy_consensus::serde_bincode_compat::Header; use alloy_consensus::serde_bincode_compat::Header;
use alloy_eips::eip4895::Withdrawals;
use alloy_primitives::Address; use alloy_primitives::Address;
use reth_primitives_traits::{serde_bincode_compat::SealedHeader, Withdrawals}; use reth_primitives_traits::serde_bincode_compat::SealedHeader;
use serde::{Deserialize, Deserializer, Serialize, Serializer}; use serde::{Deserialize, Deserializer, Serialize, Serializer};
use serde_with::{DeserializeAs, SerializeAs}; use serde_with::{DeserializeAs, SerializeAs};

View File

@ -42,7 +42,7 @@ pub use receipt::{
}; };
pub use reth_primitives_traits::{ pub use reth_primitives_traits::{
logs_bloom, Account, Bytecode, GotExpected, GotExpectedBoxed, Header, HeaderError, Log, logs_bloom, Account, Bytecode, GotExpected, GotExpectedBoxed, Header, HeaderError, Log,
LogData, SealedHeader, StorageEntry, Withdrawals, LogData, SealedHeader, StorageEntry,
}; };
pub use static_file::StaticFileSegment; pub use static_file::StaticFileSegment;

View File

@ -1,5 +1,6 @@
//! Some payload tests //! Some payload tests
use alloy_eips::eip4895::Withdrawals;
use alloy_primitives::{Bytes, Sealable, U256}; use alloy_primitives::{Bytes, Sealable, U256};
use alloy_rlp::{Decodable, Error as RlpError}; use alloy_rlp::{Decodable, Error as RlpError};
use alloy_rpc_types_engine::{ use alloy_rpc_types_engine::{
@ -7,7 +8,7 @@ use alloy_rpc_types_engine::{
PayloadError, PayloadError,
}; };
use assert_matches::assert_matches; use assert_matches::assert_matches;
use reth_primitives::{proofs, Block, SealedBlock, SealedHeader, TransactionSigned, Withdrawals}; use reth_primitives::{proofs, Block, SealedBlock, SealedHeader, TransactionSigned};
use reth_rpc_types_compat::engine::payload::{ use reth_rpc_types_compat::engine::payload::{
block_to_payload, block_to_payload_v1, convert_to_payload_body_v1, try_into_sealed_block, block_to_payload, block_to_payload_v1, convert_to_payload_body_v1, try_into_sealed_block,
try_payload_v1_to_block, try_payload_v1_to_block,

View File

@ -1,14 +1,14 @@
//! Compatibility functions for rpc `Block` type. //! Compatibility functions for rpc `Block` type.
use crate::{transaction::from_recovered_with_block_context, TransactionCompat};
use alloy_consensus::Sealed; use alloy_consensus::Sealed;
use alloy_eips::eip4895::Withdrawals;
use alloy_primitives::{B256, U256}; use alloy_primitives::{B256, U256};
use alloy_rlp::Encodable; use alloy_rlp::Encodable;
use alloy_rpc_types_eth::{ use alloy_rpc_types_eth::{
Block, BlockError, BlockTransactions, BlockTransactionsKind, Header, TransactionInfo, Block, BlockError, BlockTransactions, BlockTransactionsKind, Header, TransactionInfo,
}; };
use reth_primitives::{Block as PrimitiveBlock, BlockWithSenders, Withdrawals}; use reth_primitives::{Block as PrimitiveBlock, BlockWithSenders};
use crate::{transaction::from_recovered_with_block_context, TransactionCompat};
/// Converts the given primitive block into a [`Block`] response with the given /// Converts the given primitive block into a [`Block`] response with the given
/// [`BlockTransactionsKind`] /// [`BlockTransactionsKind`]

View File

@ -4,6 +4,7 @@
use alloy_consensus::{constants::MAXIMUM_EXTRA_DATA_SIZE, EMPTY_OMMER_ROOT_HASH}; use alloy_consensus::{constants::MAXIMUM_EXTRA_DATA_SIZE, EMPTY_OMMER_ROOT_HASH};
use alloy_eips::{ use alloy_eips::{
eip2718::{Decodable2718, Encodable2718}, eip2718::{Decodable2718, Encodable2718},
eip4895::Withdrawals,
eip7685::Requests, eip7685::Requests,
}; };
use alloy_primitives::{B256, U256}; use alloy_primitives::{B256, U256};
@ -14,7 +15,7 @@ use alloy_rpc_types_engine::{
}; };
use reth_primitives::{ use reth_primitives::{
proofs::{self}, proofs::{self},
Block, BlockBody, Header, SealedBlock, TransactionSigned, Withdrawals, Block, BlockBody, Header, SealedBlock, TransactionSigned,
}; };
/// Converts [`ExecutionPayloadV1`] to [`Block`] /// Converts [`ExecutionPayloadV1`] to [`Block`]

View File

@ -18,6 +18,7 @@ reth-primitives-traits.workspace = true
# ethereum # ethereum
alloy-primitives.workspace = true alloy-primitives.workspace = true
alloy-eips.workspace = true
# codecs # codecs
modular-bitfield.workspace = true modular-bitfield.workspace = true
@ -42,14 +43,15 @@ test-fuzz.workspace = true
[features] [features]
test-utils = [ test-utils = [
"reth-primitives-traits/test-utils", "reth-primitives-traits/test-utils",
"arbitrary", "arbitrary",
"reth-codecs/test-utils" "reth-codecs/test-utils",
] ]
arbitrary = [ arbitrary = [
"reth-primitives-traits/arbitrary", "reth-primitives-traits/arbitrary",
"dep:arbitrary", "dep:arbitrary",
"dep:proptest", "dep:proptest",
"alloy-primitives/arbitrary", "alloy-primitives/arbitrary",
"reth-codecs/arbitrary" "alloy-eips/arbitrary",
"reth-codecs/arbitrary",
] ]

View File

@ -1,8 +1,8 @@
use std::ops::Range; use std::ops::Range;
use alloy_eips::eip4895::Withdrawals;
use alloy_primitives::TxNumber; use alloy_primitives::TxNumber;
use reth_codecs::{add_arbitrary_tests, Compact}; use reth_codecs::{add_arbitrary_tests, Compact};
use reth_primitives_traits::Withdrawals;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
/// Total number of transactions. /// Total number of transactions.

View File

@ -9,7 +9,10 @@ use crate::{
StageCheckpointReader, StateProviderBox, StateProviderFactory, StateReader, StageCheckpointReader, StateProviderBox, StateProviderFactory, StateReader,
StaticFileProviderFactory, TransactionVariant, TransactionsProvider, WithdrawalsProvider, StaticFileProviderFactory, TransactionVariant, TransactionsProvider, WithdrawalsProvider,
}; };
use alloy_eips::{eip4895::Withdrawal, BlockHashOrNumber, BlockId, BlockNumHash, BlockNumberOrTag}; use alloy_eips::{
eip4895::{Withdrawal, Withdrawals},
BlockHashOrNumber, BlockId, BlockNumHash, BlockNumberOrTag,
};
use alloy_primitives::{Address, BlockHash, BlockNumber, Sealable, TxHash, TxNumber, B256, U256}; use alloy_primitives::{Address, BlockHash, BlockNumber, Sealable, TxHash, TxNumber, B256, U256};
use alloy_rpc_types_engine::ForkchoiceState; use alloy_rpc_types_engine::ForkchoiceState;
use reth_chain_state::{ use reth_chain_state::{
@ -25,7 +28,6 @@ use reth_node_types::NodeTypesWithDB;
use reth_primitives::{ use reth_primitives::{
Account, Block, BlockWithSenders, Header, Receipt, SealedBlock, SealedBlockWithSenders, Account, Block, BlockWithSenders, Header, Receipt, SealedBlock, SealedBlockWithSenders,
SealedHeader, StorageEntry, TransactionMeta, TransactionSigned, TransactionSignedNoHash, SealedHeader, StorageEntry, TransactionMeta, TransactionSigned, TransactionSignedNoHash,
Withdrawals,
}; };
use reth_prune_types::{PruneCheckpoint, PruneSegment}; use reth_prune_types::{PruneCheckpoint, PruneSegment};
use reth_stages_types::{StageCheckpoint, StageId}; use reth_stages_types::{StageCheckpoint, StageId};
@ -768,7 +770,7 @@ mod tests {
BlockWriter, CanonChainTracker, ProviderFactory, StaticFileProviderFactory, BlockWriter, CanonChainTracker, ProviderFactory, StaticFileProviderFactory,
StaticFileWriter, StaticFileWriter,
}; };
use alloy_eips::{BlockHashOrNumber, BlockNumHash, BlockNumberOrTag}; use alloy_eips::{eip4895::Withdrawals, BlockHashOrNumber, BlockNumHash, BlockNumberOrTag};
use alloy_primitives::{BlockNumber, TxNumber, B256}; use alloy_primitives::{BlockNumber, TxNumber, B256};
use itertools::Itertools; use itertools::Itertools;
use rand::Rng; use rand::Rng;
@ -786,9 +788,7 @@ mod tests {
use reth_db_api::{cursor::DbCursorRO, transaction::DbTx}; use reth_db_api::{cursor::DbCursorRO, transaction::DbTx};
use reth_errors::ProviderError; use reth_errors::ProviderError;
use reth_execution_types::{Chain, ExecutionOutcome}; use reth_execution_types::{Chain, ExecutionOutcome};
use reth_primitives::{ use reth_primitives::{Receipt, SealedBlock, StaticFileSegment, TransactionSignedNoHash};
Receipt, SealedBlock, StaticFileSegment, TransactionSignedNoHash, Withdrawals,
};
use reth_storage_api::{ use reth_storage_api::{
BlockHashReader, BlockIdReader, BlockNumReader, BlockReader, BlockReaderIdExt, BlockSource, BlockHashReader, BlockIdReader, BlockNumReader, BlockReader, BlockReaderIdExt, BlockSource,
ChangeSetReader, DatabaseProviderFactory, HeaderProvider, ReceiptProvider, ChangeSetReader, DatabaseProviderFactory, HeaderProvider, ReceiptProvider,

View File

@ -7,7 +7,8 @@ use crate::{
TransactionsProvider, WithdrawalsProvider, TransactionsProvider, WithdrawalsProvider,
}; };
use alloy_eips::{ use alloy_eips::{
eip4895::Withdrawal, BlockHashOrNumber, BlockId, BlockNumHash, BlockNumberOrTag, HashOrNumber, eip4895::{Withdrawal, Withdrawals},
BlockHashOrNumber, BlockId, BlockNumHash, BlockNumberOrTag, HashOrNumber,
}; };
use alloy_primitives::{Address, BlockHash, BlockNumber, Sealable, TxHash, TxNumber, B256, U256}; use alloy_primitives::{Address, BlockHash, BlockNumber, Sealable, TxHash, TxNumber, B256, U256};
use reth_chain_state::{BlockState, CanonicalInMemoryState, MemoryOverlayStateProviderRef}; use reth_chain_state::{BlockState, CanonicalInMemoryState, MemoryOverlayStateProviderRef};
@ -19,7 +20,6 @@ use reth_execution_types::{BundleStateInit, ExecutionOutcome, RevertsInit};
use reth_primitives::{ use reth_primitives::{
Account, Block, BlockWithSenders, Header, Receipt, SealedBlock, SealedBlockWithSenders, Account, Block, BlockWithSenders, Header, Receipt, SealedBlock, SealedBlockWithSenders,
SealedHeader, StorageEntry, TransactionMeta, TransactionSigned, TransactionSignedNoHash, SealedHeader, StorageEntry, TransactionMeta, TransactionSigned, TransactionSignedNoHash,
Withdrawals,
}; };
use reth_prune_types::{PruneCheckpoint, PruneSegment}; use reth_prune_types::{PruneCheckpoint, PruneSegment};
use reth_stages_types::{StageCheckpoint, StageId}; use reth_stages_types::{StageCheckpoint, StageId};

View File

@ -7,7 +7,10 @@ use crate::{
PruneCheckpointReader, StageCheckpointReader, StateProviderBox, StaticFileProviderFactory, PruneCheckpointReader, StageCheckpointReader, StateProviderBox, StaticFileProviderFactory,
TransactionVariant, TransactionsProvider, WithdrawalsProvider, TransactionVariant, TransactionsProvider, WithdrawalsProvider,
}; };
use alloy_eips::{eip4895::Withdrawal, BlockHashOrNumber}; use alloy_eips::{
eip4895::{Withdrawal, Withdrawals},
BlockHashOrNumber,
};
use alloy_primitives::{Address, BlockHash, BlockNumber, TxHash, TxNumber, B256, U256}; use alloy_primitives::{Address, BlockHash, BlockNumber, TxHash, TxNumber, B256, U256};
use core::fmt; use core::fmt;
use reth_chainspec::{ChainInfo, EthereumHardforks}; use reth_chainspec::{ChainInfo, EthereumHardforks};
@ -18,7 +21,7 @@ use reth_evm::ConfigureEvmEnv;
use reth_node_types::NodeTypesWithDB; use reth_node_types::NodeTypesWithDB;
use reth_primitives::{ use reth_primitives::{
Block, BlockWithSenders, Header, Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader, Block, BlockWithSenders, Header, Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader,
StaticFileSegment, TransactionMeta, TransactionSigned, TransactionSignedNoHash, Withdrawals, StaticFileSegment, TransactionMeta, TransactionSigned, TransactionSignedNoHash,
}; };
use reth_prune_types::{PruneCheckpoint, PruneModes, PruneSegment}; use reth_prune_types::{PruneCheckpoint, PruneModes, PruneSegment};
use reth_stages_types::{StageCheckpoint, StageId}; use reth_stages_types::{StageCheckpoint, StageId};

View File

@ -15,7 +15,10 @@ use crate::{
StaticFileProviderFactory, StatsReader, StorageReader, StorageTrieWriter, TransactionVariant, StaticFileProviderFactory, StatsReader, StorageReader, StorageTrieWriter, TransactionVariant,
TransactionsProvider, TransactionsProviderExt, TrieWriter, WithdrawalsProvider, TransactionsProvider, TransactionsProviderExt, TrieWriter, WithdrawalsProvider,
}; };
use alloy_eips::{eip4895::Withdrawal, BlockHashOrNumber}; use alloy_eips::{
eip4895::{Withdrawal, Withdrawals},
BlockHashOrNumber,
};
use alloy_primitives::{keccak256, Address, BlockHash, BlockNumber, TxHash, TxNumber, B256, U256}; use alloy_primitives::{keccak256, Address, BlockHash, BlockNumber, TxHash, TxNumber, B256, U256};
use itertools::{izip, Itertools}; use itertools::{izip, Itertools};
use rayon::slice::ParallelSliceMut; use rayon::slice::ParallelSliceMut;
@ -42,7 +45,6 @@ use reth_primitives::{
Account, Block, BlockBody, BlockWithSenders, Bytecode, GotExpected, Header, Receipt, Account, Block, BlockBody, BlockWithSenders, Bytecode, GotExpected, Header, Receipt,
SealedBlock, SealedBlockWithSenders, SealedHeader, StaticFileSegment, StorageEntry, SealedBlock, SealedBlockWithSenders, SealedHeader, StaticFileSegment, StorageEntry,
TransactionMeta, TransactionSigned, TransactionSignedEcRecovered, TransactionSignedNoHash, TransactionMeta, TransactionSigned, TransactionSignedEcRecovered, TransactionSignedNoHash,
Withdrawals,
}; };
use reth_prune_types::{PruneCheckpoint, PruneModes, PruneSegment}; use reth_prune_types::{PruneCheckpoint, PruneModes, PruneSegment};
use reth_stages_types::{StageCheckpoint, StageId}; use reth_stages_types::{StageCheckpoint, StageId};

View File

@ -7,7 +7,10 @@ use crate::{
StageCheckpointReader, StateProviderBox, StateProviderFactory, StaticFileProviderFactory, StageCheckpointReader, StateProviderBox, StateProviderFactory, StaticFileProviderFactory,
TransactionVariant, TransactionsProvider, TreeViewer, WithdrawalsProvider, TransactionVariant, TransactionsProvider, TreeViewer, WithdrawalsProvider,
}; };
use alloy_eips::{eip4895::Withdrawal, BlockHashOrNumber, BlockId, BlockNumHash, BlockNumberOrTag}; use alloy_eips::{
eip4895::{Withdrawal, Withdrawals},
BlockHashOrNumber, BlockId, BlockNumHash, BlockNumberOrTag,
};
use alloy_primitives::{Address, BlockHash, BlockNumber, Sealable, TxHash, TxNumber, B256, U256}; use alloy_primitives::{Address, BlockHash, BlockNumber, Sealable, TxHash, TxNumber, B256, U256};
use reth_blockchain_tree_api::{ use reth_blockchain_tree_api::{
error::{CanonicalError, InsertBlockError}, error::{CanonicalError, InsertBlockError},
@ -21,7 +24,7 @@ use reth_evm::ConfigureEvmEnv;
use reth_node_types::NodeTypesWithDB; use reth_node_types::NodeTypesWithDB;
use reth_primitives::{ use reth_primitives::{
Account, Block, BlockWithSenders, Header, Receipt, SealedBlock, SealedBlockWithSenders, Account, Block, BlockWithSenders, Header, Receipt, SealedBlock, SealedBlockWithSenders,
SealedHeader, TransactionMeta, TransactionSigned, TransactionSignedNoHash, Withdrawals, SealedHeader, TransactionMeta, TransactionSigned, TransactionSignedNoHash,
}; };
use reth_prune_types::{PruneCheckpoint, PruneSegment}; use reth_prune_types::{PruneCheckpoint, PruneSegment};
use reth_stages_types::{StageCheckpoint, StageId}; use reth_stages_types::{StageCheckpoint, StageId};

View File

@ -7,7 +7,10 @@ use crate::{
ReceiptProvider, StageCheckpointReader, StatsReader, TransactionVariant, TransactionsProvider, ReceiptProvider, StageCheckpointReader, StatsReader, TransactionVariant, TransactionsProvider,
TransactionsProviderExt, WithdrawalsProvider, TransactionsProviderExt, WithdrawalsProvider,
}; };
use alloy_eips::{eip4895::Withdrawal, BlockHashOrNumber}; use alloy_eips::{
eip4895::{Withdrawal, Withdrawals},
BlockHashOrNumber,
};
use alloy_primitives::{keccak256, Address, BlockHash, BlockNumber, TxHash, TxNumber, B256, U256}; use alloy_primitives::{keccak256, Address, BlockHash, BlockNumber, TxHash, TxNumber, B256, U256};
use dashmap::DashMap; use dashmap::DashMap;
use notify::{RecommendedWatcher, RecursiveMode, Watcher}; use notify::{RecommendedWatcher, RecursiveMode, Watcher};
@ -31,7 +34,7 @@ use reth_primitives::{
DEFAULT_BLOCKS_PER_STATIC_FILE, DEFAULT_BLOCKS_PER_STATIC_FILE,
}, },
Block, BlockWithSenders, Header, Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader, Block, BlockWithSenders, Header, Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader,
StaticFileSegment, TransactionMeta, TransactionSigned, TransactionSignedNoHash, Withdrawals, StaticFileSegment, TransactionMeta, TransactionSigned, TransactionSignedNoHash,
}; };
use reth_stages_types::{PipelineTarget, StageId}; use reth_stages_types::{PipelineTarget, StageId};
use reth_storage_api::DBProvider; use reth_storage_api::DBProvider;

View File

@ -6,14 +6,14 @@ use alloy_primitives::{
U256, U256,
}; };
use alloy_eips::eip4895::Withdrawal; use alloy_eips::eip4895::{Withdrawal, Withdrawals};
use alloy_primitives::PrimitiveSignature as Signature; use alloy_primitives::PrimitiveSignature as Signature;
use reth_db::tables; use reth_db::tables;
use reth_db_api::{database::Database, models::StoredBlockBodyIndices}; use reth_db_api::{database::Database, models::StoredBlockBodyIndices};
use reth_node_types::NodeTypes; use reth_node_types::NodeTypes;
use reth_primitives::{ use reth_primitives::{
Account, BlockBody, Header, Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader, Account, BlockBody, Header, Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader,
Transaction, TransactionSigned, TxType, Withdrawals, Transaction, TransactionSigned, TxType,
}; };
use reth_trie::root::{state_root_unhashed, storage_root_unhashed}; use reth_trie::root::{state_root_unhashed, storage_root_unhashed};
use revm::{db::BundleState, primitives::AccountInfo}; use revm::{db::BundleState, primitives::AccountInfo};

View File

@ -6,7 +6,10 @@ use crate::{
StateRootProvider, TransactionVariant, TransactionsProvider, WithdrawalsProvider, StateRootProvider, TransactionVariant, TransactionsProvider, WithdrawalsProvider,
}; };
use alloy_consensus::constants::EMPTY_ROOT_HASH; use alloy_consensus::constants::EMPTY_ROOT_HASH;
use alloy_eips::{eip4895::Withdrawal, BlockHashOrNumber, BlockId, BlockNumberOrTag}; use alloy_eips::{
eip4895::{Withdrawal, Withdrawals},
BlockHashOrNumber, BlockId, BlockNumberOrTag,
};
use alloy_primitives::{ use alloy_primitives::{
keccak256, keccak256,
map::{HashMap, HashSet}, map::{HashMap, HashSet},
@ -23,7 +26,7 @@ use reth_node_types::NodeTypes;
use reth_primitives::{ use reth_primitives::{
Account, Block, BlockWithSenders, Bytecode, GotExpected, Header, Receipt, SealedBlock, Account, Block, BlockWithSenders, Bytecode, GotExpected, Header, Receipt, SealedBlock,
SealedBlockWithSenders, SealedHeader, TransactionMeta, TransactionSigned, SealedBlockWithSenders, SealedHeader, TransactionMeta, TransactionSigned,
TransactionSignedNoHash, Withdrawals, TransactionSignedNoHash,
}; };
use reth_stages_types::{StageCheckpoint, StageId}; use reth_stages_types::{StageCheckpoint, StageId};
use reth_storage_api::{ use reth_storage_api::{

View File

@ -4,7 +4,10 @@ use std::{
sync::Arc, sync::Arc,
}; };
use alloy_eips::{eip4895::Withdrawal, BlockHashOrNumber, BlockId, BlockNumberOrTag}; use alloy_eips::{
eip4895::{Withdrawal, Withdrawals},
BlockHashOrNumber, BlockId, BlockNumberOrTag,
};
use alloy_primitives::{ use alloy_primitives::{
map::{HashMap, HashSet}, map::{HashMap, HashSet},
Address, BlockHash, BlockNumber, Bytes, StorageKey, StorageValue, TxHash, TxNumber, B256, U256, Address, BlockHash, BlockNumber, Bytes, StorageKey, StorageValue, TxHash, TxNumber, B256, U256,
@ -20,7 +23,7 @@ use reth_evm::ConfigureEvmEnv;
use reth_primitives::{ use reth_primitives::{
Account, Block, BlockWithSenders, Bytecode, Header, Receipt, SealedBlock, Account, Block, BlockWithSenders, Bytecode, Header, Receipt, SealedBlock,
SealedBlockWithSenders, SealedHeader, TransactionMeta, TransactionSigned, SealedBlockWithSenders, SealedHeader, TransactionMeta, TransactionSigned,
TransactionSignedNoHash, Withdrawals, TransactionSignedNoHash,
}; };
use reth_prune_types::{PruneCheckpoint, PruneSegment}; use reth_prune_types::{PruneCheckpoint, PruneSegment};
use reth_stages_types::{StageCheckpoint, StageId}; use reth_stages_types::{StageCheckpoint, StageId};

View File

@ -1,5 +1,7 @@
use alloy_eips::{eip4895::Withdrawal, BlockHashOrNumber}; use alloy_eips::{
use reth_primitives::Withdrawals; eip4895::{Withdrawal, Withdrawals},
BlockHashOrNumber,
};
use reth_storage_errors::provider::ProviderResult; use reth_storage_errors::provider::ProviderResult;
/// Client trait for fetching [Withdrawal] related data. /// Client trait for fetching [Withdrawal] related data.

View File

@ -20,6 +20,7 @@ reth-trie-db.workspace = true
alloy-genesis.workspace = true alloy-genesis.workspace = true
alloy-rpc-types = { workspace = true, features = ["engine"] } alloy-rpc-types = { workspace = true, features = ["engine"] }
alloy-primitives.workspace = true alloy-primitives.workspace = true
alloy-eips.workspace = true
eyre.workspace = true eyre.workspace = true
tokio.workspace = true tokio.workspace = true

View File

@ -22,6 +22,7 @@ use std::{convert::Infallible, sync::Arc};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use thiserror::Error; use thiserror::Error;
use alloy_eips::eip4895::Withdrawals;
use alloy_genesis::Genesis; use alloy_genesis::Genesis;
use alloy_primitives::{Address, B256}; use alloy_primitives::{Address, B256};
use alloy_rpc_types::{ use alloy_rpc_types::{
@ -68,7 +69,6 @@ use reth_payload_builder::{
EthBuiltPayload, EthPayloadBuilderAttributes, PayloadBuilderError, PayloadBuilderHandle, EthBuiltPayload, EthPayloadBuilderAttributes, PayloadBuilderError, PayloadBuilderHandle,
PayloadBuilderService, PayloadBuilderService,
}; };
use reth_primitives::Withdrawals;
use reth_tracing::{RethTracer, Tracer}; use reth_tracing::{RethTracer, Tracer};
use reth_trie_db::MerklePatriciaTrie; use reth_trie_db::MerklePatriciaTrie;

View File

@ -14,15 +14,19 @@ workspace = true
[features] [features]
ef-tests = [] ef-tests = []
asm-keccak = [ asm-keccak = [
"reth-primitives/asm-keccak", "reth-primitives/asm-keccak",
"alloy-primitives/asm-keccak", "alloy-primitives/asm-keccak",
"revm/asm-keccak" "revm/asm-keccak",
] ]
[dependencies] [dependencies]
reth-chainspec.workspace = true reth-chainspec.workspace = true
reth-primitives.workspace = true reth-primitives.workspace = true
reth-db = { workspace = true, features = ["mdbx", "test-utils", "disable-lock"] } reth-db = { workspace = true, features = [
"mdbx",
"test-utils",
"disable-lock",
] }
reth-db-api.workspace = true reth-db-api.workspace = true
reth-provider = { workspace = true, features = ["test-utils"] } reth-provider = { workspace = true, features = ["test-utils"] }
reth-stages.workspace = true reth-stages.workspace = true
@ -33,6 +37,7 @@ revm = { workspace = true, features = ["secp256k1", "blst", "c-kzg"] }
alloy-rlp.workspace = true alloy-rlp.workspace = true
alloy-primitives.workspace = true alloy-primitives.workspace = true
alloy-eips.workspace = true
walkdir = "2.3.3" walkdir = "2.3.3"
serde.workspace = true serde.workspace = true

View File

@ -1,6 +1,7 @@
//! Shared models for <https://github.com/ethereum/tests> //! Shared models for <https://github.com/ethereum/tests>
use crate::{assert::assert_equal, Error}; use crate::{assert::assert_equal, Error};
use alloy_eips::eip4895::Withdrawals;
use alloy_primitives::{keccak256, Address, Bloom, Bytes, B256, B64, U256}; use alloy_primitives::{keccak256, Address, Bloom, Bytes, B256, B64, U256};
use reth_chainspec::{ChainSpec, ChainSpecBuilder}; use reth_chainspec::{ChainSpec, ChainSpecBuilder};
use reth_db::tables; use reth_db::tables;
@ -9,7 +10,7 @@ use reth_db_api::{
transaction::{DbTx, DbTxMut}, transaction::{DbTx, DbTxMut},
}; };
use reth_primitives::{ use reth_primitives::{
Account as RethAccount, Bytecode, Header as RethHeader, SealedHeader, StorageEntry, Withdrawals, Account as RethAccount, Bytecode, Header as RethHeader, SealedHeader, StorageEntry,
}; };
use serde::Deserialize; use serde::Deserialize;
use std::{collections::BTreeMap, ops::Deref}; use std::{collections::BTreeMap, ops::Deref};

View File

@ -1,7 +1,7 @@
//! Generators for different data structures like block headers, block bodies and ranges of those. //! Generators for different data structures like block headers, block bodies and ranges of those.
use alloy_consensus::{Transaction as _, TxLegacy}; use alloy_consensus::{Transaction as _, TxLegacy};
use alloy_eips::eip4895::Withdrawal; use alloy_eips::eip4895::{Withdrawal, Withdrawals};
use alloy_primitives::{Address, BlockNumber, Bytes, Sealable, TxKind, B256, U256}; use alloy_primitives::{Address, BlockNumber, Bytes, Sealable, TxKind, B256, U256};
pub use rand::Rng; pub use rand::Rng;
use rand::{ use rand::{
@ -9,7 +9,7 @@ use rand::{
}; };
use reth_primitives::{ use reth_primitives::{
proofs, sign_message, Account, BlockBody, Header, Log, Receipt, SealedBlock, SealedHeader, proofs, sign_message, Account, BlockBody, Header, Log, Receipt, SealedBlock, SealedHeader,
StorageEntry, Transaction, TransactionSigned, Withdrawals, StorageEntry, Transaction, TransactionSigned,
}; };
use secp256k1::{Keypair, Secp256k1}; use secp256k1::{Keypair, Secp256k1};
use std::{ use std::{