primitives: rm more alloy_primitives reexports (#11255)

This commit is contained in:
Thomas Coratger
2024-09-29 18:48:54 +02:00
committed by GitHub
parent 55bf29e6d2
commit ea1d04aa75
70 changed files with 150 additions and 128 deletions

8
Cargo.lock generated
View File

@ -2635,6 +2635,7 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0"
name = "example-beacon-api-sidecar-fetcher" name = "example-beacon-api-sidecar-fetcher"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"alloy-primitives",
"alloy-rpc-types-beacon", "alloy-rpc-types-beacon",
"clap", "clap",
"eyre", "eyre",
@ -2665,6 +2666,7 @@ dependencies = [
name = "example-bsc-p2p" name = "example-bsc-p2p"
version = "0.0.0" version = "0.0.0"
dependencies = [ dependencies = [
"alloy-primitives",
"reth-chainspec", "reth-chainspec",
"reth-discv4", "reth-discv4",
"reth-network", "reth-network",
@ -2683,6 +2685,7 @@ name = "example-custom-dev-node"
version = "0.0.0" version = "0.0.0"
dependencies = [ dependencies = [
"alloy-genesis", "alloy-genesis",
"alloy-primitives",
"eyre", "eyre",
"futures-util", "futures-util",
"reth", "reth",
@ -2779,6 +2782,7 @@ dependencies = [
name = "example-custom-rlpx-subprotocol" name = "example-custom-rlpx-subprotocol"
version = "0.0.0" version = "0.0.0"
dependencies = [ dependencies = [
"alloy-primitives",
"eyre", "eyre",
"futures", "futures",
"rand 0.8.5", "rand 0.8.5",
@ -2874,6 +2878,7 @@ dependencies = [
name = "example-polygon-p2p" name = "example-polygon-p2p"
version = "0.0.0" version = "0.0.0"
dependencies = [ dependencies = [
"alloy-primitives",
"reth-chainspec", "reth-chainspec",
"reth-discv4", "reth-discv4",
"reth-network", "reth-network",
@ -6311,6 +6316,7 @@ version = "1.0.7"
dependencies = [ dependencies = [
"alloy-eips", "alloy-eips",
"alloy-json-rpc", "alloy-json-rpc",
"alloy-primitives",
"alloy-provider", "alloy-provider",
"alloy-pubsub", "alloy-pubsub",
"alloy-rpc-client", "alloy-rpc-client",
@ -6616,6 +6622,7 @@ version = "1.0.7"
dependencies = [ dependencies = [
"alloy-consensus", "alloy-consensus",
"alloy-eips", "alloy-eips",
"alloy-primitives",
"alloy-provider", "alloy-provider",
"alloy-rpc-types", "alloy-rpc-types",
"alloy-rpc-types-engine", "alloy-rpc-types-engine",
@ -6624,7 +6631,6 @@ dependencies = [
"futures", "futures",
"reqwest", "reqwest",
"reth-node-api", "reth-node-api",
"reth-node-core",
"reth-rpc-api", "reth-rpc-api",
"reth-rpc-builder", "reth-rpc-builder",
"reth-tracing", "reth-tracing",

View File

@ -36,6 +36,7 @@ alloy-pubsub.workspace = true
alloy-json-rpc.workspace = true alloy-json-rpc.workspace = true
alloy-rpc-client.workspace = true alloy-rpc-client.workspace = true
alloy-eips.workspace = true alloy-eips.workspace = true
alloy-primitives.workspace = true
# reqwest # reqwest
reqwest = { workspace = true, default-features = false, features = [ reqwest = { workspace = true, default-features = false, features = [

View File

@ -11,13 +11,14 @@ use crate::{
}, },
valid_payload::{call_forkchoice_updated, call_new_payload}, valid_payload::{call_forkchoice_updated, call_new_payload},
}; };
use alloy_primitives::B256;
use alloy_provider::Provider; use alloy_provider::Provider;
use alloy_rpc_types_engine::ForkchoiceState; use alloy_rpc_types_engine::ForkchoiceState;
use clap::Parser; use clap::Parser;
use csv::Writer; use csv::Writer;
use reth_cli_runner::CliContext; use reth_cli_runner::CliContext;
use reth_node_core::args::BenchmarkArgs; use reth_node_core::args::BenchmarkArgs;
use reth_primitives::{Block, B256}; use reth_primitives::Block;
use reth_rpc_types_compat::engine::payload::block_to_payload; use reth_rpc_types_compat::engine::payload::block_to_payload;
use std::time::Instant; use std::time::Instant;
use tracing::{debug, info}; use tracing::{debug, info};

View File

@ -10,12 +10,13 @@ use crate::{
}, },
valid_payload::call_new_payload, valid_payload::call_new_payload,
}; };
use alloy_primitives::B256;
use alloy_provider::Provider; use alloy_provider::Provider;
use clap::Parser; use clap::Parser;
use csv::Writer; use csv::Writer;
use reth_cli_runner::CliContext; use reth_cli_runner::CliContext;
use reth_node_core::args::BenchmarkArgs; use reth_node_core::args::BenchmarkArgs;
use reth_primitives::{Block, B256}; use reth_primitives::Block;
use reth_rpc_types_compat::engine::payload::block_to_payload; use reth_rpc_types_compat::engine::payload::block_to_payload;
use std::time::Instant; use std::time::Instant;
use tracing::{debug, info}; use tracing::{debug, info};

View File

@ -2,6 +2,7 @@
//! response. This is useful for benchmarking, as it allows us to wait for a payload to be valid //! response. This is useful for benchmarking, as it allows us to wait for a payload to be valid
//! before sending additional calls. //! before sending additional calls.
use alloy_primitives::B256;
use alloy_provider::{ext::EngineApi, Network}; use alloy_provider::{ext::EngineApi, Network};
use alloy_rpc_types_engine::{ use alloy_rpc_types_engine::{
ExecutionPayload, ExecutionPayloadInputV2, ExecutionPayloadV1, ExecutionPayloadV3, ExecutionPayload, ExecutionPayloadInputV2, ExecutionPayloadV1, ExecutionPayloadV3,
@ -9,7 +10,6 @@ use alloy_rpc_types_engine::{
}; };
use alloy_transport::{Transport, TransportResult}; use alloy_transport::{Transport, TransportResult};
use reth_node_api::EngineApiMessageVersion; use reth_node_api::EngineApiMessageVersion;
use reth_primitives::B256;
use tracing::error; use tracing::error;
/// An extension trait for providers that implement the engine API, to wait for a VALID response. /// An extension trait for providers that implement the engine API, to wait for a VALID response.

View File

@ -1,6 +1,6 @@
//! Command for debugging block building. //! Command for debugging block building.
use alloy_consensus::TxEip4844; use alloy_consensus::TxEip4844;
use alloy_primitives::Address; use alloy_primitives::{Address, B256, U256};
use alloy_rlp::Decodable; use alloy_rlp::Decodable;
use alloy_rpc_types::engine::{BlobsBundleV1, PayloadAttributes}; use alloy_rpc_types::engine::{BlobsBundleV1, PayloadAttributes};
use clap::Parser; use clap::Parser;
@ -27,7 +27,6 @@ use reth_payload_builder::database::CachedReads;
use reth_primitives::{ use reth_primitives::{
revm_primitives::KzgSettings, BlobTransaction, BlobTransactionSidecar, Bytes, revm_primitives::KzgSettings, BlobTransaction, BlobTransactionSidecar, Bytes,
PooledTransactionsElement, SealedBlock, SealedBlockWithSenders, Transaction, TransactionSigned, PooledTransactionsElement, SealedBlock, SealedBlockWithSenders, Transaction, TransactionSigned,
B256, U256,
}; };
use reth_provider::{ use reth_provider::{
providers::BlockchainProvider, BlockHashReader, BlockReader, BlockWriter, ChainSpecProvider, providers::BlockchainProvider, BlockHashReader, BlockReader, BlockWriter, ChainSpecProvider,

View File

@ -1,7 +1,7 @@
//! Command for debugging execution. //! Command for debugging execution.
use crate::{args::NetworkArgs, utils::get_single_header}; use crate::{args::NetworkArgs, utils::get_single_header};
use alloy_primitives::BlockNumber; use alloy_primitives::{BlockNumber, B256};
use clap::Parser; use clap::Parser;
use futures::{stream::select as stream_select, StreamExt}; use futures::{stream::select as stream_select, StreamExt};
use reth_beacon_consensus::EthBeaconConsensus; use reth_beacon_consensus::EthBeaconConsensus;
@ -23,7 +23,7 @@ use reth_network_api::NetworkInfo;
use reth_network_p2p::{headers::client::HeadersClient, BlockClient}; use reth_network_p2p::{headers::client::HeadersClient, BlockClient};
use reth_node_api::{NodeTypesWithDB, NodeTypesWithDBAdapter, NodeTypesWithEngine}; use reth_node_api::{NodeTypesWithDB, NodeTypesWithDBAdapter, NodeTypesWithEngine};
use reth_node_ethereum::EthExecutorProvider; use reth_node_ethereum::EthExecutorProvider;
use reth_primitives::{BlockHashOrNumber, B256}; use reth_primitives::BlockHashOrNumber;
use reth_provider::{ use reth_provider::{
BlockExecutionWriter, ChainSpecProvider, ProviderFactory, StageCheckpointReader, BlockExecutionWriter, ChainSpecProvider, ProviderFactory, StageCheckpointReader,
}; };

View File

@ -13,7 +13,6 @@ workspace = true
[dependencies] [dependencies]
# reth # reth
reth-node-api.workspace = true reth-node-api.workspace = true
reth-node-core.workspace = true
reth-rpc-api.workspace = true reth-rpc-api.workspace = true
reth-rpc-builder.workspace = true reth-rpc-builder.workspace = true
reth-tracing.workspace = true reth-tracing.workspace = true
@ -24,6 +23,7 @@ alloy-eips.workspace = true
alloy-provider = { workspace = true, features = ["ws"] } alloy-provider = { workspace = true, features = ["ws"] }
alloy-rpc-types.workspace = true alloy-rpc-types.workspace = true
alloy-rpc-types-engine.workspace = true alloy-rpc-types-engine.workspace = true
alloy-primitives.workspace = true
auto_impl.workspace = true auto_impl.workspace = true
futures.workspace = true futures.workspace = true

View File

@ -1,9 +1,9 @@
use alloy_consensus::TxEnvelope; use alloy_consensus::TxEnvelope;
use alloy_eips::eip2718::Encodable2718; use alloy_eips::eip2718::Encodable2718;
use alloy_primitives::B256;
use alloy_rpc_types::{Block, BlockTransactions}; use alloy_rpc_types::{Block, BlockTransactions};
use alloy_rpc_types_engine::{ExecutionPayloadV1, ExecutionPayloadV2, ExecutionPayloadV3}; use alloy_rpc_types_engine::{ExecutionPayloadV1, ExecutionPayloadV2, ExecutionPayloadV3};
use reth_node_api::EngineTypes; use reth_node_api::EngineTypes;
use reth_node_core::primitives::B256;
use reth_rpc_builder::auth::AuthServerHandle; use reth_rpc_builder::auth::AuthServerHandle;
use reth_tracing::tracing::warn; use reth_tracing::tracing::warn;
use ringbuffer::{AllocRingBuffer, RingBuffer}; use ringbuffer::{AllocRingBuffer, RingBuffer};

View File

@ -1,5 +1,5 @@
use alloy_eips::BlockNumHash; use alloy_eips::BlockNumHash;
use reth_primitives::B256; use alloy_primitives::B256;
use std::{collections::VecDeque, time::Instant}; use std::{collections::VecDeque, time::Instant};
use tokio::sync::oneshot; use tokio::sync::oneshot;
use tracing::{debug, trace}; use tracing::{debug, trace};

View File

@ -9,8 +9,8 @@ pub use storage::Storage;
use std::{path::Path, sync::Arc}; use std::{path::Path, sync::Arc};
use alloy_eips::BlockNumHash; use alloy_eips::BlockNumHash;
use alloy_primitives::B256;
use reth_exex_types::ExExNotification; use reth_exex_types::ExExNotification;
use reth_primitives::B256;
use reth_tracing::tracing::{debug, instrument}; use reth_tracing::tracing::{debug, instrument};
/// WAL is a write-ahead log (WAL) that stores the notifications sent to ExExes. /// WAL is a write-ahead log (WAL) that stores the notifications sent to ExExes.

View File

@ -213,9 +213,9 @@ pub struct ReceiptWithBlockNumber {
#[cfg(test)] #[cfg(test)]
mod test { mod test {
use alloy_primitives::{hex, Address, Bytes, Log, LogData, B256}; use alloy_primitives::{bytes::BytesMut, hex, Address, Bytes, Log, LogData, B256};
use alloy_rlp::{Decodable, RlpDecodable}; use alloy_rlp::{Decodable, RlpDecodable};
use reth_primitives::{Buf, BytesMut, Receipt, TxType}; use reth_primitives::{Buf, Receipt, TxType};
use reth_tracing::init_test_tracing; use reth_tracing::init_test_tracing;
use tokio_util::codec::Decoder; use tokio_util::codec::Decoder;

View File

@ -9,12 +9,12 @@ use std::{
pin::Pin, pin::Pin,
}; };
use alloy_primitives::bytes::BytesMut;
use futures::Stream; use futures::Stream;
use reth_eth_wire::{ use reth_eth_wire::{
capability::SharedCapabilities, multiplex::ProtocolConnection, protocol::Protocol, capability::SharedCapabilities, multiplex::ProtocolConnection, protocol::Protocol,
}; };
use reth_network_api::{Direction, PeerId}; use reth_network_api::{Direction, PeerId};
use reth_primitives::BytesMut;
/// A trait that allows to offer additional RLPx-based application-level protocols when establishing /// A trait that allows to offer additional RLPx-based application-level protocols when establishing
/// a peer-to-peer connection. /// a peer-to-peer connection.

View File

@ -7,6 +7,7 @@ use std::{
task::{ready, Context, Poll}, task::{ready, Context, Poll},
}; };
use alloy_primitives::bytes::BytesMut;
use futures::{Stream, StreamExt}; use futures::{Stream, StreamExt};
use reth_eth_wire::{ use reth_eth_wire::{
capability::SharedCapabilities, multiplex::ProtocolConnection, protocol::Protocol, capability::SharedCapabilities, multiplex::ProtocolConnection, protocol::Protocol,
@ -16,7 +17,6 @@ use reth_network::{
test_utils::Testnet, test_utils::Testnet,
}; };
use reth_network_api::{Direction, PeerId}; use reth_network_api::{Direction, PeerId};
use reth_primitives::BytesMut;
use reth_provider::test_utils::MockEthProvider; use reth_provider::test_utils::MockEthProvider;
use tokio::sync::{mpsc, oneshot}; use tokio::sync::{mpsc, oneshot};
use tokio_stream::wrappers::UnboundedReceiverStream; use tokio_stream::wrappers::UnboundedReceiverStream;
@ -26,8 +26,9 @@ use crate::multiplex::proto::{PingPongProtoMessage, PingPongProtoMessageKind};
/// A simple Rlpx subprotocol that sends pings and pongs /// A simple Rlpx subprotocol that sends pings and pongs
mod proto { mod proto {
use super::*; use super::*;
use alloy_primitives::bytes::BufMut;
use reth_eth_wire::Capability; use reth_eth_wire::Capability;
use reth_primitives::{Buf, BufMut}; use reth_primitives::Buf;
#[repr(u8)] #[repr(u8)]
#[derive(Clone, Copy, Debug, PartialEq, Eq)] #[derive(Clone, Copy, Debug, PartialEq, Eq)]

View File

@ -2,7 +2,7 @@
use std::sync::Arc; use std::sync::Arc;
use alloy_primitives::BlockNumber; use alloy_primitives::{BlockNumber, B256};
use reth_config::{config::StageConfig, PruneConfig}; use reth_config::{config::StageConfig, PruneConfig};
use reth_consensus::Consensus; use reth_consensus::Consensus;
use reth_downloaders::{ use reth_downloaders::{
@ -14,7 +14,6 @@ use reth_exex::ExExManagerHandle;
use reth_network_p2p::{ use reth_network_p2p::{
bodies::downloader::BodyDownloader, headers::downloader::HeaderDownloader, BlockClient, bodies::downloader::BodyDownloader, headers::downloader::HeaderDownloader, BlockClient,
}; };
use reth_node_core::primitives::B256;
use reth_provider::{providers::ProviderNodeTypes, ProviderFactory}; use reth_provider::{providers::ProviderNodeTypes, ProviderFactory};
use reth_stages::{prelude::DefaultStages, stages::ExecutionStage, Pipeline, StageSet}; use reth_stages::{prelude::DefaultStages, stages::ExecutionStage, Pipeline, StageSet};
use reth_static_file::StaticFileProducer; use reth_static_file::StaticFileProducer;

View File

@ -1,4 +1,4 @@
use crate::primitives::U256; use alloy_primitives::U256;
use clap::Args; use clap::Args;
use reth_rpc_eth_types::GasPriceOracleConfig; use reth_rpc_eth_types::GasPriceOracleConfig;
use reth_rpc_server_types::constants::gas_oracle::{ use reth_rpc_server_types::constants::gas_oracle::{

View File

@ -1,7 +1,7 @@
use alloy_primitives::{BlockNumber, B256}; use alloy_primitives::{BlockNumber, B256, U256};
use reth_optimism_primitives::bedrock::{BEDROCK_HEADER, BEDROCK_HEADER_HASH, BEDROCK_HEADER_TTD}; use reth_optimism_primitives::bedrock::{BEDROCK_HEADER, BEDROCK_HEADER_HASH, BEDROCK_HEADER_TTD};
use reth_primitives::{ use reth_primitives::{
BlockBody, Header, SealedBlock, SealedBlockWithSenders, SealedHeader, StaticFileSegment, U256, BlockBody, Header, SealedBlock, SealedBlockWithSenders, SealedHeader, StaticFileSegment,
}; };
use reth_provider::{ use reth_provider::{
providers::StaticFileProvider, BlockWriter, StageCheckpointWriter, StaticFileWriter, providers::StaticFileProvider, BlockWriter, StageCheckpointWriter, StaticFileWriter,

View File

@ -1,7 +1,7 @@
//! OP mainnet bedrock related data. //! OP mainnet bedrock related data.
use alloy_primitives::{b256, bloom, bytes, B256, B64, U256}; use alloy_primitives::{address, b256, bloom, bytes, B256, B64, U256};
use reth_primitives::{address, Header}; use reth_primitives::Header;
use reth_primitives_traits::constants::EMPTY_OMMER_ROOT_HASH; use reth_primitives_traits::constants::EMPTY_OMMER_ROOT_HASH;
/// Transaction 0x9ed8f713b2cc6439657db52dcd2fdb9cc944915428f3c6e2a7703e242b259cb9 in block 985, /// Transaction 0x9ed8f713b2cc6439657db52dcd2fdb9cc944915428f3c6e2a7703e242b259cb9 in block 985,

View File

@ -27,8 +27,9 @@
//! use std::future::Future; //! use std::future::Future;
//! use std::pin::Pin; //! use std::pin::Pin;
//! use std::task::{Context, Poll}; //! use std::task::{Context, Poll};
//! use alloy_primitives::U256;
//! use reth_payload_builder::{EthBuiltPayload, PayloadBuilderError, KeepPayloadJobAlive, EthPayloadBuilderAttributes, PayloadJob, PayloadJobGenerator}; //! use reth_payload_builder::{EthBuiltPayload, PayloadBuilderError, KeepPayloadJobAlive, EthPayloadBuilderAttributes, PayloadJob, PayloadJobGenerator};
//! use reth_primitives::{Block, Header, U256}; //! use reth_primitives::{Block, Header};
//! //!
//! /// The generator type that creates new jobs that builds empty blocks. //! /// The generator type that creates new jobs that builds empty blocks.
//! pub struct EmptyBlockPayloadJobGenerator; //! pub struct EmptyBlockPayloadJobGenerator;

View File

@ -1,12 +1,12 @@
use crate::{ use crate::{
Bytes, GotExpected, Header, SealedHeader, TransactionSigned, TransactionSignedEcRecovered, Bytes, GotExpected, Header, SealedHeader, TransactionSigned, TransactionSignedEcRecovered,
Withdrawals, B256, Withdrawals,
}; };
use alloc::vec::Vec; use alloc::vec::Vec;
pub use alloy_eips::eip1898::{ pub use alloy_eips::eip1898::{
BlockHashOrNumber, BlockId, BlockNumHash, BlockNumberOrTag, ForkBlock, RpcBlockHash, BlockHashOrNumber, BlockId, BlockNumHash, BlockNumberOrTag, ForkBlock, RpcBlockHash,
}; };
use alloy_primitives::{Address, Sealable}; use alloy_primitives::{Address, 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};
#[cfg(any(test, feature = "arbitrary"))] #[cfg(any(test, feature = "arbitrary"))]

View File

@ -69,11 +69,7 @@ pub use transaction::{
}; };
// Re-exports // Re-exports
pub use alloy_primitives::{ pub use alloy_primitives::{self, bloom, bytes, bytes::Buf, hex, Bytes, TxHash};
self, address, b256, bloom, bytes,
bytes::{Buf, BufMut, BytesMut},
hex, Bytes, TxHash, B256, U256, U64,
};
pub use reth_ethereum_forks::*; pub use reth_ethereum_forks::*;
pub use revm_primitives::{self, JumpTable}; pub use revm_primitives::{self, JumpTable};

View File

@ -2,11 +2,11 @@
use crate::{ use crate::{
constants::EMPTY_OMMER_ROOT_HASH, Header, Receipt, ReceiptWithBloom, ReceiptWithBloomRef, constants::EMPTY_OMMER_ROOT_HASH, Header, Receipt, ReceiptWithBloom, ReceiptWithBloomRef,
Request, TransactionSigned, Withdrawal, B256, Request, TransactionSigned, Withdrawal,
}; };
use alloc::vec::Vec; use alloc::vec::Vec;
use alloy_eips::eip7685::Encodable7685; use alloy_eips::eip7685::Encodable7685;
use alloy_primitives::keccak256; use alloy_primitives::{keccak256, B256};
use reth_trie_common::root::{ordered_trie_root, ordered_trie_root_with_encoder}; use reth_trie_common::root::{ordered_trie_root, ordered_trie_root_with_encoder};
/// Calculate a transaction root. /// Calculate a transaction root.
@ -65,9 +65,9 @@ pub fn calculate_ommers_root(ommers: &[Header]) -> B256 {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;
use crate::{constants::EMPTY_ROOT_HASH, Block, U256}; use crate::{constants::EMPTY_ROOT_HASH, Block};
use alloy_genesis::GenesisAccount; use alloy_genesis::GenesisAccount;
use alloy_primitives::{b256, hex_literal::hex, Address}; use alloy_primitives::{b256, hex_literal::hex, Address, U256};
use alloy_rlp::Decodable; use alloy_rlp::Decodable;
use reth_chainspec::{HOLESKY, MAINNET, SEPOLIA}; use reth_chainspec::{HOLESKY, MAINNET, SEPOLIA};
use reth_trie_common::root::{state_root_ref_unhashed, state_root_unhashed}; use reth_trie_common::root::{state_root_ref_unhashed, state_root_unhashed};

View File

@ -1,11 +1,11 @@
#[cfg(feature = "reth-codec")] #[cfg(feature = "reth-codec")]
use crate::compression::{RECEIPT_COMPRESSOR, RECEIPT_DECOMPRESSOR}; use crate::compression::{RECEIPT_COMPRESSOR, RECEIPT_DECOMPRESSOR};
use crate::{ use crate::{
logs_bloom, Bytes, TxType, B256, EIP1559_TX_TYPE_ID, EIP2930_TX_TYPE_ID, EIP4844_TX_TYPE_ID, logs_bloom, Bytes, TxType, EIP1559_TX_TYPE_ID, EIP2930_TX_TYPE_ID, EIP4844_TX_TYPE_ID,
EIP7702_TX_TYPE_ID, EIP7702_TX_TYPE_ID,
}; };
use alloc::{vec, vec::Vec}; use alloc::{vec, vec::Vec};
use alloy_primitives::{Bloom, Log}; use alloy_primitives::{Bloom, Log, B256};
use alloy_rlp::{length_of_length, Decodable, Encodable, RlpDecodable, RlpEncodable}; use alloy_rlp::{length_of_length, Decodable, Encodable, RlpDecodable, RlpEncodable};
use bytes::{Buf, BufMut}; use bytes::{Buf, BufMut};
use core::{cmp::Ordering, ops::Deref}; use core::{cmp::Ordering, ops::Deref};

View File

@ -2,9 +2,8 @@
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use crate::B256;
use alloy_eips::eip2930::{AccessList, AccessListItem}; use alloy_eips::eip2930::{AccessList, AccessListItem};
use alloy_primitives::Address; use alloy_primitives::{Address, B256};
use alloy_rlp::{RlpDecodable, RlpDecodableWrapper, RlpEncodable, RlpEncodableWrapper}; use alloy_rlp::{RlpDecodable, RlpDecodableWrapper, RlpEncodable, RlpEncodableWrapper};
use proptest::proptest; use proptest::proptest;
use proptest_arbitrary_interop::arb; use proptest_arbitrary_interop::arb;

View File

@ -1,5 +1,5 @@
use crate::{Transaction, TransactionSigned, U256}; use crate::{Transaction, TransactionSigned};
use alloy_primitives::{Address, TxKind}; use alloy_primitives::{Address, TxKind, U256};
use revm_primitives::{AuthorizationList, TxEnv}; use revm_primitives::{AuthorizationList, TxEnv};
/// Implements behaviour to fill a [`TxEnv`] from another transaction. /// Implements behaviour to fill a [`TxEnv`] from another transaction.

View File

@ -1,4 +1,5 @@
use crate::{GotExpectedBoxed, U256}; use crate::GotExpectedBoxed;
use alloy_primitives::U256;
/// Represents error variants that can happen when trying to validate a /// Represents error variants that can happen when trying to validate a
/// [Transaction](crate::Transaction) /// [Transaction](crate::Transaction)

View File

@ -1,4 +1,4 @@
use crate::B256; use alloy_primitives::B256;
/// Additional fields in the context of a block that contains this transaction. /// Additional fields in the context of a block that contains this transaction.
#[derive(Debug, Clone, Copy, Default, Eq, PartialEq)] #[derive(Debug, Clone, Copy, Default, Eq, PartialEq)]

View File

@ -1,8 +1,8 @@
//! Transaction types. //! Transaction types.
use crate::{BlockHashOrNumber, Bytes, TxHash, B256, U256}; use crate::{BlockHashOrNumber, Bytes, TxHash};
use alloy_eips::eip7702::SignedAuthorization; use alloy_eips::eip7702::SignedAuthorization;
use alloy_primitives::{keccak256, Address, TxKind}; use alloy_primitives::{keccak256, Address, TxKind, B256, U256};
use alloy_consensus::{SignableTransaction, TxEip1559, TxEip2930, TxEip4844, TxEip7702, TxLegacy}; use alloy_consensus::{SignableTransaction, TxEip1559, TxEip2930, TxEip4844, TxEip7702, TxLegacy};
use alloy_eips::eip2930::AccessList; use alloy_eips::eip2930::AccessList;
@ -1708,9 +1708,9 @@ mod tests {
hex, hex,
transaction::{signature::Signature, TxEip1559, TxKind, TxLegacy}, transaction::{signature::Signature, TxEip1559, TxKind, TxLegacy},
Bytes, Transaction, TransactionSigned, TransactionSignedEcRecovered, Bytes, Transaction, TransactionSigned, TransactionSignedEcRecovered,
TransactionSignedNoHash, B256, U256, TransactionSignedNoHash,
}; };
use alloy_primitives::{address, b256, bytes, Address, Parity}; use alloy_primitives::{address, b256, bytes, Address, Parity, B256, U256};
use alloy_rlp::{Decodable, Encodable, Error as RlpError}; use alloy_rlp::{Decodable, Encodable, Error as RlpError};
use reth_chainspec::MIN_TRANSACTION_GAS; use reth_chainspec::MIN_TRANSACTION_GAS;
use reth_codecs::Compact; use reth_codecs::Compact;

View File

@ -8,14 +8,14 @@ use super::{
}; };
use crate::{ use crate::{
BlobTransaction, BlobTransactionSidecar, Bytes, Signature, Transaction, TransactionSigned, BlobTransaction, BlobTransactionSidecar, Bytes, Signature, Transaction, TransactionSigned,
TransactionSignedEcRecovered, TxHash, B256, EIP4844_TX_TYPE_ID, TransactionSignedEcRecovered, TxHash, EIP4844_TX_TYPE_ID,
}; };
use alloc::vec::Vec; use alloc::vec::Vec;
use alloy_consensus::{ use alloy_consensus::{
transaction::{TxEip1559, TxEip2930, TxEip4844, TxLegacy}, transaction::{TxEip1559, TxEip2930, TxEip4844, TxLegacy},
SignableTransaction, TxEip4844WithSidecar, SignableTransaction, TxEip4844WithSidecar,
}; };
use alloy_primitives::Address; use alloy_primitives::{Address, B256};
use alloy_rlp::{Decodable, Encodable, Error as RlpError, Header, EMPTY_LIST_CODE}; use alloy_rlp::{Decodable, Encodable, Error as RlpError, Header, EMPTY_LIST_CODE};
use bytes::Buf; use bytes::Buf;
use derive_more::{AsRef, Deref}; use derive_more::{AsRef, Deref};

View File

@ -1,5 +1,5 @@
use crate::{transaction::util::secp256k1, B256, U256}; use crate::transaction::util::secp256k1;
use alloy_primitives::{Address, Parity}; use alloy_primitives::{Address, Parity, B256, U256};
use alloy_rlp::{Decodable, Error as RlpError}; use alloy_rlp::{Decodable, Error as RlpError};
pub use alloy_primitives::Signature; pub use alloy_primitives::Signature;
@ -119,9 +119,9 @@ mod tests {
transaction::signature::{ transaction::signature::{
legacy_parity, recover_signer, recover_signer_unchecked, SECP256K1N_HALF, legacy_parity, recover_signer, recover_signer_unchecked, SECP256K1N_HALF,
}, },
Signature, B256, U256, Signature,
}; };
use alloy_primitives::{Address, Parity}; use alloy_primitives::{Address, Parity, B256, U256};
use std::str::FromStr; use std::str::FromStr;
#[test] #[test]

View File

@ -2,9 +2,9 @@
//! `TransactionSignedEcRecovered` //! `TransactionSignedEcRecovered`
use crate::{ use crate::{
Transaction, TransactionSigned, TransactionSignedEcRecovered, TransactionSignedNoHash, B256, Transaction, TransactionSigned, TransactionSignedEcRecovered, TransactionSignedNoHash,
}; };
use alloy_primitives::Address; use alloy_primitives::{Address, B256};
use core::ops::Deref; use core::ops::Deref;
/// Represents various different transaction formats used in reth. /// Represents various different transaction formats used in reth.

View File

@ -1,7 +1,7 @@
use crate::primitives::alloy_primitives::{BlockNumber, StorageKey, StorageValue}; use crate::primitives::alloy_primitives::{BlockNumber, StorageKey, StorageValue};
use alloy_primitives::Address; use alloy_primitives::{Address, B256, U256};
use core::ops::{Deref, DerefMut}; use core::ops::{Deref, DerefMut};
use reth_primitives::{Account, B256, U256}; use reth_primitives::Account;
use reth_storage_errors::provider::{ProviderError, ProviderResult}; use reth_storage_errors::provider::{ProviderError, ProviderResult};
use revm::{ use revm::{
db::DatabaseRef, db::DatabaseRef,

View File

@ -1,7 +1,7 @@
use alloy_primitives::{map::HashMap, Address}; use alloy_primitives::{map::HashMap, Address, U256};
use reth_chainspec::EthereumHardforks; use reth_chainspec::EthereumHardforks;
use reth_consensus_common::calc; use reth_consensus_common::calc;
use reth_primitives::{Block, Withdrawal, Withdrawals, U256}; use reth_primitives::{Block, Withdrawal, Withdrawals};
/// Collect all balance changes at the end of the block. /// Collect all balance changes at the end of the block.
/// ///

View File

@ -2,9 +2,9 @@ use alloc::vec::Vec;
use alloy_primitives::{ use alloy_primitives::{
keccak256, keccak256,
map::{HashMap, HashSet}, map::{HashMap, HashSet},
Address, BlockNumber, StorageKey, Address, BlockNumber, StorageKey, B256, U256,
}; };
use reth_primitives::{Account, Bytecode, Bytes, B256, U256}; use reth_primitives::{Account, Bytecode, Bytes};
use reth_storage_api::{ use reth_storage_api::{
AccountReader, BlockHashReader, StateProofProvider, StateProvider, StateRootProvider, AccountReader, BlockHashReader, StateProofProvider, StateProvider, StateRootProvider,
StorageRootProvider, StorageRootProvider,

View File

@ -1,5 +1,5 @@
#![allow(unreachable_pub)] #![allow(unreachable_pub)]
use alloy_primitives::Address; use alloy_primitives::{Address, B256, U256};
use itertools::concat; use itertools::concat;
use reth_chainspec::ChainSpec; use reth_chainspec::ChainSpec;
use reth_db::{tables, test_utils::TempDatabase, Database, DatabaseEnv}; use reth_db::{tables, test_utils::TempDatabase, Database, DatabaseEnv};
@ -7,7 +7,7 @@ use reth_db_api::{
cursor::DbCursorRO, cursor::DbCursorRO,
transaction::{DbTx, DbTxMut}, transaction::{DbTx, DbTxMut},
}; };
use reth_primitives::{alloy_primitives::Sealable, Account, SealedBlock, SealedHeader, B256, U256}; use reth_primitives::{alloy_primitives::Sealable, Account, SealedBlock, SealedHeader};
use reth_provider::{DatabaseProvider, DatabaseProviderFactory, TrieWriter}; use reth_provider::{DatabaseProvider, DatabaseProviderFactory, TrieWriter};
use reth_stages::{ use reth_stages::{
stages::{AccountHashingStage, StorageHashingStage}, stages::{AccountHashingStage, StorageHashingStage},

View File

@ -17,7 +17,7 @@
//! # use reth_downloaders::headers::reverse_headers::ReverseHeadersDownloaderBuilder; //! # use reth_downloaders::headers::reverse_headers::ReverseHeadersDownloaderBuilder;
//! # use reth_network_p2p::test_utils::{TestBodiesClient, TestHeadersClient}; //! # use reth_network_p2p::test_utils::{TestBodiesClient, TestHeadersClient};
//! # use reth_evm_ethereum::execute::EthExecutorProvider; //! # use reth_evm_ethereum::execute::EthExecutorProvider;
//! # use reth_primitives::B256; //! # use alloy_primitives::B256;
//! # use reth_chainspec::MAINNET; //! # use reth_chainspec::MAINNET;
//! # use reth_prune_types::PruneModes; //! # use reth_prune_types::PruneModes;
//! # use reth_network_peers::PeerId; //! # use reth_network_peers::PeerId;

View File

@ -41,11 +41,11 @@ use crate::{
}, },
StageSet, StageSetBuilder, StageSet, StageSetBuilder,
}; };
use alloy_primitives::B256;
use reth_config::config::StageConfig; use reth_config::config::StageConfig;
use reth_consensus::Consensus; use reth_consensus::Consensus;
use reth_evm::execute::BlockExecutorProvider; use reth_evm::execute::BlockExecutorProvider;
use reth_network_p2p::{bodies::downloader::BodyDownloader, headers::downloader::HeaderDownloader}; use reth_network_p2p::{bodies::downloader::BodyDownloader, headers::downloader::HeaderDownloader};
use reth_primitives::B256;
use reth_provider::HeaderSyncGapProvider; use reth_provider::HeaderSyncGapProvider;
use reth_prune_types::PruneModes; use reth_prune_types::PruneModes;
use reth_stages_api::Stage; use reth_stages_api::Stage;

View File

@ -622,7 +622,7 @@ mod tests {
UnwindStageTestRunner, UnwindStageTestRunner,
}, },
}; };
use alloy_primitives::{BlockHash, BlockNumber, TxNumber}; use alloy_primitives::{BlockHash, BlockNumber, TxNumber, B256};
use futures_util::Stream; use futures_util::Stream;
use reth_db::{static_file::HeaderMask, tables}; use reth_db::{static_file::HeaderMask, tables};
use reth_db_api::{ use reth_db_api::{
@ -637,9 +637,7 @@ mod tests {
}, },
error::DownloadResult, error::DownloadResult,
}; };
use reth_primitives::{ use reth_primitives::{BlockBody, Header, SealedBlock, SealedHeader, StaticFileSegment};
BlockBody, Header, SealedBlock, SealedHeader, StaticFileSegment, B256,
};
use reth_provider::{ use reth_provider::{
providers::StaticFileWriter, test_utils::MockNodeTypesWithDB, HeaderProvider, providers::StaticFileWriter, test_utils::MockNodeTypesWithDB, HeaderProvider,
ProviderFactory, StaticFileProviderFactory, TransactionsProvider, ProviderFactory, StaticFileProviderFactory, TransactionsProvider,

View File

@ -658,14 +658,14 @@ where
mod tests { mod tests {
use super::*; use super::*;
use crate::test_utils::TestStageDB; use crate::test_utils::TestStageDB;
use alloy_primitives::{hex_literal::hex, keccak256, Address}; use alloy_primitives::{address, hex_literal::hex, keccak256, Address, B256, U256};
use alloy_rlp::Decodable; use alloy_rlp::Decodable;
use assert_matches::assert_matches; use assert_matches::assert_matches;
use reth_chainspec::ChainSpecBuilder; use reth_chainspec::ChainSpecBuilder;
use reth_db_api::{models::AccountBeforeTx, transaction::DbTxMut}; use reth_db_api::{models::AccountBeforeTx, transaction::DbTxMut};
use reth_evm_ethereum::execute::EthExecutorProvider; use reth_evm_ethereum::execute::EthExecutorProvider;
use reth_execution_errors::BlockValidationError; use reth_execution_errors::BlockValidationError;
use reth_primitives::{address, Account, Bytecode, SealedBlock, StorageEntry, B256, U256}; use reth_primitives::{Account, Bytecode, SealedBlock, StorageEntry};
use reth_provider::{ use reth_provider::{
test_utils::create_test_provider_factory, AccountReader, DatabaseProviderFactory, test_utils::create_test_provider_factory, AccountReader, DatabaseProviderFactory,
ReceiptProvider, StaticFileProviderFactory, ReceiptProvider, StaticFileProviderFactory,

View File

@ -1,4 +1,4 @@
use alloy_primitives::keccak256; use alloy_primitives::{keccak256, B256};
use itertools::Itertools; use itertools::Itertools;
use reth_config::config::{EtlConfig, HashingConfig}; use reth_config::config::{EtlConfig, HashingConfig};
use reth_db::{tables, RawKey, RawTable, RawValue}; use reth_db::{tables, RawKey, RawTable, RawValue};
@ -7,7 +7,7 @@ use reth_db_api::{
transaction::{DbTx, DbTxMut}, transaction::{DbTx, DbTxMut},
}; };
use reth_etl::Collector; use reth_etl::Collector;
use reth_primitives::{Account, B256}; use reth_primitives::Account;
use reth_provider::{AccountExtReader, DBProvider, HashingWriter, StatsReader}; use reth_provider::{AccountExtReader, DBProvider, HashingWriter, StatsReader};
use reth_stages_api::{ use reth_stages_api::{
AccountHashingCheckpoint, EntitiesCheckpoint, ExecInput, ExecOutput, Stage, StageCheckpoint, AccountHashingCheckpoint, EntitiesCheckpoint, ExecInput, ExecOutput, Stage, StageCheckpoint,
@ -65,8 +65,8 @@ impl AccountHashingStage {
provider: &reth_provider::DatabaseProvider<Tx, Spec>, provider: &reth_provider::DatabaseProvider<Tx, Spec>,
opts: SeedOpts, opts: SeedOpts,
) -> Result<Vec<(alloy_primitives::Address, reth_primitives::Account)>, StageError> { ) -> Result<Vec<(alloy_primitives::Address, reth_primitives::Account)>, StageError> {
use alloy_primitives::U256;
use reth_db_api::models::AccountBeforeTx; use reth_db_api::models::AccountBeforeTx;
use reth_primitives::U256;
use reth_provider::{StaticFileProviderFactory, StaticFileWriter}; use reth_provider::{StaticFileProviderFactory, StaticFileWriter};
use reth_testing_utils::{ use reth_testing_utils::{
generators, generators,
@ -298,8 +298,9 @@ mod tests {
stage_test_suite_ext, ExecuteStageTestRunner, StageTestRunner, TestRunnerError, stage_test_suite_ext, ExecuteStageTestRunner, StageTestRunner, TestRunnerError,
UnwindStageTestRunner, UnwindStageTestRunner,
}; };
use alloy_primitives::U256;
use assert_matches::assert_matches; use assert_matches::assert_matches;
use reth_primitives::{Account, U256}; use reth_primitives::Account;
use reth_provider::providers::StaticFileWriter; use reth_provider::providers::StaticFileWriter;
use reth_stages_api::StageUnitCheckpoint; use reth_stages_api::StageUnitCheckpoint;
use test_utils::*; use test_utils::*;

View File

@ -1,4 +1,4 @@
use alloy_primitives::keccak256; use alloy_primitives::{bytes::BufMut, keccak256, B256};
use itertools::Itertools; use itertools::Itertools;
use reth_config::config::{EtlConfig, HashingConfig}; use reth_config::config::{EtlConfig, HashingConfig};
use reth_db::tables; use reth_db::tables;
@ -9,7 +9,7 @@ use reth_db_api::{
transaction::{DbTx, DbTxMut}, transaction::{DbTx, DbTxMut},
}; };
use reth_etl::Collector; use reth_etl::Collector;
use reth_primitives::{BufMut, StorageEntry, B256}; use reth_primitives::StorageEntry;
use reth_provider::{DBProvider, HashingWriter, StatsReader, StorageReader}; use reth_provider::{DBProvider, HashingWriter, StatsReader, StorageReader};
use reth_stages_api::{ use reth_stages_api::{
EntitiesCheckpoint, ExecInput, ExecOutput, Stage, StageCheckpoint, StageError, StageId, EntitiesCheckpoint, ExecInput, ExecOutput, Stage, StageCheckpoint, StageError, StageId,
@ -212,14 +212,14 @@ mod tests {
stage_test_suite_ext, ExecuteStageTestRunner, StageTestRunner, TestRunnerError, stage_test_suite_ext, ExecuteStageTestRunner, StageTestRunner, TestRunnerError,
TestStageDB, UnwindStageTestRunner, TestStageDB, UnwindStageTestRunner,
}; };
use alloy_primitives::Address; use alloy_primitives::{Address, U256};
use assert_matches::assert_matches; use assert_matches::assert_matches;
use rand::Rng; use rand::Rng;
use reth_db_api::{ use reth_db_api::{
cursor::{DbCursorRW, DbDupCursorRO}, cursor::{DbCursorRW, DbDupCursorRO},
models::StoredBlockBodyIndices, models::StoredBlockBodyIndices,
}; };
use reth_primitives::{SealedBlock, U256}; use reth_primitives::SealedBlock;
use reth_provider::providers::StaticFileWriter; use reth_provider::providers::StaticFileWriter;
use reth_testing_utils::generators::{ use reth_testing_utils::generators::{
self, random_block_range, random_contract_account_range, BlockRangeParams, self, random_block_range, random_contract_account_range, BlockRangeParams,

View File

@ -1,4 +1,4 @@
use alloy_primitives::{BlockHash, BlockNumber}; use alloy_primitives::{BlockHash, BlockNumber, B256};
use futures_util::StreamExt; use futures_util::StreamExt;
use reth_codecs::Compact; use reth_codecs::Compact;
use reth_config::config::EtlConfig; use reth_config::config::EtlConfig;
@ -11,7 +11,7 @@ use reth_db_api::{
}; };
use reth_etl::Collector; use reth_etl::Collector;
use reth_network_p2p::headers::{downloader::HeaderDownloader, error::HeadersDownloaderError}; use reth_network_p2p::headers::{downloader::HeaderDownloader, error::HeadersDownloaderError};
use reth_primitives::{SealedHeader, StaticFileSegment, B256}; use reth_primitives::{SealedHeader, StaticFileSegment};
use reth_provider::{ use reth_provider::{
providers::{StaticFileProvider, StaticFileWriter}, providers::{StaticFileProvider, StaticFileWriter},
BlockHashReader, DBProvider, HeaderProvider, HeaderSyncGap, HeaderSyncGapProvider, BlockHashReader, DBProvider, HeaderProvider, HeaderSyncGap, HeaderSyncGapProvider,
@ -378,10 +378,11 @@ mod tests {
use crate::test_utils::{ use crate::test_utils::{
stage_test_suite, ExecuteStageTestRunner, StageTestRunner, UnwindStageTestRunner, stage_test_suite, ExecuteStageTestRunner, StageTestRunner, UnwindStageTestRunner,
}; };
use alloy_primitives::B256;
use assert_matches::assert_matches; use assert_matches::assert_matches;
use reth_execution_types::ExecutionOutcome; use reth_execution_types::ExecutionOutcome;
use reth_primitives::{ use reth_primitives::{
alloy_primitives::Sealable, BlockBody, SealedBlock, SealedBlockWithSenders, B256, alloy_primitives::Sealable, BlockBody, SealedBlock, SealedBlockWithSenders,
}; };
use reth_provider::{BlockWriter, ProviderFactory, StaticFileProviderFactory}; use reth_provider::{BlockWriter, ProviderFactory, StaticFileProviderFactory};
use reth_stages_api::StageUnitCheckpoint; use reth_stages_api::StageUnitCheckpoint;

View File

@ -148,7 +148,7 @@ mod tests {
stage_test_suite_ext, ExecuteStageTestRunner, StageTestRunner, TestRunnerError, stage_test_suite_ext, ExecuteStageTestRunner, StageTestRunner, TestRunnerError,
TestStageDB, UnwindStageTestRunner, TestStageDB, UnwindStageTestRunner,
}; };
use alloy_primitives::BlockNumber; use alloy_primitives::{address, BlockNumber, B256};
use itertools::Itertools; use itertools::Itertools;
use reth_db::BlockNumberList; use reth_db::BlockNumberList;
use reth_db_api::{ use reth_db_api::{
@ -159,7 +159,6 @@ mod tests {
}, },
transaction::DbTx, transaction::DbTx,
}; };
use reth_primitives::{address, B256};
use reth_provider::{providers::StaticFileWriter, DatabaseProviderFactory}; use reth_provider::{providers::StaticFileWriter, DatabaseProviderFactory};
use reth_testing_utils::generators::{ use reth_testing_utils::generators::{
self, random_block_range, random_changeset_range, random_contract_account_range, self, random_block_range, random_changeset_range, random_contract_account_range,

View File

@ -153,7 +153,7 @@ mod tests {
stage_test_suite_ext, ExecuteStageTestRunner, StageTestRunner, TestRunnerError, stage_test_suite_ext, ExecuteStageTestRunner, StageTestRunner, TestRunnerError,
TestStageDB, UnwindStageTestRunner, TestStageDB, UnwindStageTestRunner,
}; };
use alloy_primitives::{Address, BlockNumber}; use alloy_primitives::{address, b256, Address, BlockNumber, B256, U256};
use itertools::Itertools; use itertools::Itertools;
use reth_db::BlockNumberList; use reth_db::BlockNumberList;
use reth_db_api::{ use reth_db_api::{
@ -164,7 +164,7 @@ mod tests {
}, },
transaction::DbTx, transaction::DbTx,
}; };
use reth_primitives::{address, b256, StorageEntry, B256, U256}; use reth_primitives::StorageEntry;
use reth_provider::{providers::StaticFileWriter, DatabaseProviderFactory}; use reth_provider::{providers::StaticFileWriter, DatabaseProviderFactory};
use reth_testing_utils::generators::{ use reth_testing_utils::generators::{
self, random_block_range, random_changeset_range, random_contract_account_range, self, random_block_range, random_changeset_range, random_contract_account_range,

View File

@ -1,9 +1,9 @@
use alloy_primitives::BlockNumber; use alloy_primitives::{BlockNumber, B256};
use reth_codecs::Compact; use reth_codecs::Compact;
use reth_consensus::ConsensusError; use reth_consensus::ConsensusError;
use reth_db::tables; use reth_db::tables;
use reth_db_api::transaction::{DbTx, DbTxMut}; use reth_db_api::transaction::{DbTx, DbTxMut};
use reth_primitives::{alloy_primitives::Sealable, GotExpected, SealedHeader, B256}; use reth_primitives::{alloy_primitives::Sealable, GotExpected, SealedHeader};
use reth_provider::{ use reth_provider::{
DBProvider, HeaderProvider, ProviderError, StageCheckpointReader, StageCheckpointWriter, DBProvider, HeaderProvider, ProviderError, StageCheckpointReader, StageCheckpointWriter,
StatsReader, TrieWriter, StatsReader, TrieWriter,
@ -374,10 +374,10 @@ mod tests {
stage_test_suite_ext, ExecuteStageTestRunner, StageTestRunner, StorageKind, stage_test_suite_ext, ExecuteStageTestRunner, StageTestRunner, StorageKind,
TestRunnerError, TestStageDB, UnwindStageTestRunner, TestRunnerError, TestStageDB, UnwindStageTestRunner,
}; };
use alloy_primitives::keccak256; use alloy_primitives::{keccak256, U256};
use assert_matches::assert_matches; use assert_matches::assert_matches;
use reth_db_api::cursor::{DbCursorRO, DbCursorRW, DbDupCursorRO}; use reth_db_api::cursor::{DbCursorRO, DbCursorRW, DbDupCursorRO};
use reth_primitives::{SealedBlock, StaticFileSegment, StorageEntry, U256}; use reth_primitives::{SealedBlock, StaticFileSegment, StorageEntry};
use reth_provider::{providers::StaticFileWriter, StaticFileProviderFactory}; use reth_provider::{providers::StaticFileWriter, StaticFileProviderFactory};
use reth_stages_api::StageUnitCheckpoint; use reth_stages_api::StageUnitCheckpoint;
use reth_testing_utils::generators::{ use reth_testing_utils::generators::{

View File

@ -42,7 +42,7 @@ use utils::*;
mod tests { mod tests {
use super::*; use super::*;
use crate::test_utils::{StorageKind, TestStageDB}; use crate::test_utils::{StorageKind, TestStageDB};
use alloy_primitives::{hex_literal::hex, keccak256, BlockNumber}; use alloy_primitives::{address, hex_literal::hex, keccak256, BlockNumber, B256, U256};
use alloy_rlp::Decodable; use alloy_rlp::Decodable;
use reth_chainspec::ChainSpecBuilder; use reth_chainspec::ChainSpecBuilder;
use reth_db::{ use reth_db::{
@ -56,7 +56,7 @@ mod tests {
}; };
use reth_evm_ethereum::execute::EthExecutorProvider; use reth_evm_ethereum::execute::EthExecutorProvider;
use reth_exex::ExExManagerHandle; use reth_exex::ExExManagerHandle;
use reth_primitives::{address, Account, Bytecode, SealedBlock, StaticFileSegment, B256, U256}; use reth_primitives::{Account, Bytecode, SealedBlock, StaticFileSegment};
use reth_provider::{ use reth_provider::{
providers::{StaticFileProvider, StaticFileWriter}, providers::{StaticFileProvider, StaticFileWriter},
test_utils::MockNodeTypesWithDB, test_utils::MockNodeTypesWithDB,

View File

@ -169,7 +169,8 @@ mod tests {
stage_test_suite_ext, ExecuteStageTestRunner, StageTestRunner, StorageKind, stage_test_suite_ext, ExecuteStageTestRunner, StageTestRunner, StorageKind,
TestRunnerError, TestStageDB, UnwindStageTestRunner, TestRunnerError, TestStageDB, UnwindStageTestRunner,
}; };
use reth_primitives::{SealedBlock, B256}; use alloy_primitives::B256;
use reth_primitives::SealedBlock;
use reth_provider::{ use reth_provider::{
providers::StaticFileWriter, TransactionsProvider, TransactionsProviderExt, providers::StaticFileWriter, TransactionsProvider, TransactionsProviderExt,
}; };

View File

@ -334,10 +334,10 @@ struct FailedSenderRecoveryError {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use alloy_primitives::BlockNumber; use alloy_primitives::{BlockNumber, B256};
use assert_matches::assert_matches; use assert_matches::assert_matches;
use reth_db_api::cursor::DbCursorRO; use reth_db_api::cursor::DbCursorRO;
use reth_primitives::{SealedBlock, TransactionSigned, B256}; use reth_primitives::{SealedBlock, TransactionSigned};
use reth_provider::{ use reth_provider::{
providers::StaticFileWriter, DatabaseProviderFactory, PruneCheckpointWriter, providers::StaticFileWriter, DatabaseProviderFactory, PruneCheckpointWriter,
StaticFileProviderFactory, TransactionsProvider, StaticFileProviderFactory, TransactionsProvider,

View File

@ -250,9 +250,9 @@ mod tests {
stage_test_suite_ext, ExecuteStageTestRunner, StageTestRunner, StorageKind, stage_test_suite_ext, ExecuteStageTestRunner, StageTestRunner, StorageKind,
TestRunnerError, TestStageDB, UnwindStageTestRunner, TestRunnerError, TestStageDB, UnwindStageTestRunner,
}; };
use alloy_primitives::BlockNumber; use alloy_primitives::{BlockNumber, B256};
use assert_matches::assert_matches; use assert_matches::assert_matches;
use reth_primitives::{SealedBlock, B256}; use reth_primitives::SealedBlock;
use reth_provider::{ use reth_provider::{
providers::StaticFileWriter, DatabaseProviderFactory, StaticFileProviderFactory, providers::StaticFileWriter, DatabaseProviderFactory, StaticFileProviderFactory,
}; };

View File

@ -1,4 +1,4 @@
use alloy_primitives::{keccak256, Address, BlockNumber, TxNumber}; use alloy_primitives::{keccak256, Address, BlockNumber, TxNumber, B256, U256};
use reth_chainspec::MAINNET; use reth_chainspec::MAINNET;
use reth_db::{ use reth_db::{
tables, tables,
@ -15,8 +15,7 @@ use reth_db_api::{
DatabaseError as DbError, DatabaseError as DbError,
}; };
use reth_primitives::{ use reth_primitives::{
Account, Receipt, SealedBlock, SealedHeader, StaticFileSegment, StorageEntry, TxHash, B256, Account, Receipt, SealedBlock, SealedHeader, StaticFileSegment, StorageEntry, TxHash,
U256,
}; };
use reth_provider::{ use reth_provider::{
providers::{StaticFileProvider, StaticFileProviderRWRefMut, StaticFileWriter}, providers::{StaticFileProvider, StaticFileProviderRWRefMut, StaticFileWriter},

View File

@ -52,7 +52,7 @@ macro_rules! delegate_provider_impls {
} }
StateProofProvider $(where [$($generics)*])? { StateProofProvider $(where [$($generics)*])? {
fn proof(&self, input: reth_trie::TrieInput, address: alloy_primitives::Address, slots: &[alloy_primitives::B256]) -> reth_storage_errors::provider::ProviderResult<reth_trie::AccountProof>; fn proof(&self, input: reth_trie::TrieInput, address: alloy_primitives::Address, slots: &[alloy_primitives::B256]) -> reth_storage_errors::provider::ProviderResult<reth_trie::AccountProof>;
fn multiproof(&self, input: reth_trie::TrieInput, targets: alloy_primitives::map::HashMap<reth_primitives::B256, alloy_primitives::map::HashSet<alloy_primitives::B256>>) -> reth_storage_errors::provider::ProviderResult<reth_trie::MultiProof>; fn multiproof(&self, input: reth_trie::TrieInput, targets: alloy_primitives::map::HashMap<alloy_primitives::B256, alloy_primitives::map::HashSet<alloy_primitives::B256>>) -> reth_storage_errors::provider::ProviderResult<reth_trie::MultiProof>;
fn witness(&self, input: reth_trie::TrieInput, target: reth_trie::HashedPostState) -> reth_storage_errors::provider::ProviderResult<alloy_primitives::map::HashMap<alloy_primitives::B256, alloy_primitives::Bytes>>; fn witness(&self, input: reth_trie::TrieInput, target: reth_trie::HashedPostState) -> reth_storage_errors::provider::ProviderResult<alloy_primitives::map::HashMap<alloy_primitives::B256, alloy_primitives::Bytes>>;
} }
); );

View File

@ -2,15 +2,16 @@
use crate::{DatabaseProviderRW, ExecutionOutcome}; use crate::{DatabaseProviderRW, ExecutionOutcome};
use alloy_consensus::TxLegacy; use alloy_consensus::TxLegacy;
use alloy_primitives::{ use alloy_primitives::{
hex_literal::hex, map::HashMap, Address, BlockNumber, Log, Parity, Sealable, TxKind, b256, hex_literal::hex, map::HashMap, Address, BlockNumber, Log, Parity, Sealable, TxKind,
B256, U256,
}; };
use once_cell::sync::Lazy; use once_cell::sync::Lazy;
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_primitives::{ use reth_primitives::{
alloy_primitives, b256, Account, BlockBody, Bytes, Header, Receipt, SealedBlock, alloy_primitives, Account, BlockBody, Bytes, Header, Receipt, SealedBlock,
SealedBlockWithSenders, SealedHeader, Signature, Transaction, TransactionSigned, TxType, SealedBlockWithSenders, SealedHeader, Signature, Transaction, TransactionSigned, TxType,
Withdrawal, Withdrawals, B256, U256, Withdrawal, Withdrawals,
}; };
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

@ -77,9 +77,10 @@ pub trait DatabaseStateRoot<'a, TX>: Sized {
/// # Example /// # Example
/// ///
/// ``` /// ```
/// use alloy_primitives::U256;
/// use reth_db::test_utils::create_test_rw_db; /// use reth_db::test_utils::create_test_rw_db;
/// use reth_db_api::database::Database; /// use reth_db_api::database::Database;
/// use reth_primitives::{Account, U256}; /// use reth_primitives::Account;
/// use reth_trie::{updates::TrieUpdates, HashedPostState, StateRoot}; /// use reth_trie::{updates::TrieUpdates, HashedPostState, StateRoot};
/// use reth_trie_db::DatabaseStateRoot; /// use reth_trie_db::DatabaseStateRoot;
/// ///
@ -267,10 +268,10 @@ impl<TX: DbTx> DatabaseHashedPostState<TX> for HashedPostState {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;
use alloy_primitives::{map::HashMap, Address}; use alloy_primitives::{map::HashMap, Address, U256};
use reth_db::test_utils::create_test_rw_db; use reth_db::test_utils::create_test_rw_db;
use reth_db_api::database::Database; use reth_db_api::database::Database;
use reth_primitives::{hex, revm_primitives::AccountInfo, U256}; use reth_primitives::{hex, revm_primitives::AccountInfo};
use revm::db::BundleState; use revm::db::BundleState;
#[test] #[test]

View File

@ -10,6 +10,7 @@ reth.workspace = true
reth-node-ethereum.workspace = true reth-node-ethereum.workspace = true
alloy-rpc-types-beacon.workspace = true alloy-rpc-types-beacon.workspace = true
alloy-primitives.workspace = true
clap.workspace = true clap.workspace = true
eyre.workspace = true eyre.workspace = true

View File

@ -18,11 +18,12 @@ use std::{
net::{IpAddr, Ipv4Addr}, net::{IpAddr, Ipv4Addr},
}; };
use alloy_primitives::B256;
use clap::Parser; use clap::Parser;
use futures_util::{stream::FuturesUnordered, StreamExt}; use futures_util::{stream::FuturesUnordered, StreamExt};
use mined_sidecar::MinedSidecarStream; use mined_sidecar::MinedSidecarStream;
use reth::{ use reth::{
args::utils::DefaultChainSpecParser, builder::NodeHandle, cli::Cli, primitives::B256, args::utils::DefaultChainSpecParser, builder::NodeHandle, cli::Cli,
providers::CanonStateSubscriptions, providers::CanonStateSubscriptions,
}; };
use reth_node_ethereum::EthereumNode; use reth_node_ethereum::EthereumNode;

View File

@ -1,10 +1,11 @@
use crate::BeaconSidecarConfig; use crate::BeaconSidecarConfig;
use alloy_primitives::B256;
use alloy_rpc_types_beacon::sidecar::{BeaconBlobBundle, SidecarIterator}; use alloy_rpc_types_beacon::sidecar::{BeaconBlobBundle, SidecarIterator};
use eyre::Result; use eyre::Result;
use futures_util::{stream::FuturesUnordered, Future, Stream, StreamExt}; use futures_util::{stream::FuturesUnordered, Future, Stream, StreamExt};
use reqwest::{Error, StatusCode}; use reqwest::{Error, StatusCode};
use reth::{ use reth::{
primitives::{BlobTransaction, SealedBlockWithSenders, B256}, primitives::{BlobTransaction, SealedBlockWithSenders},
providers::CanonStateNotification, providers::CanonStateNotification,
transaction_pool::{BlobStoreError, TransactionPoolExt}, transaction_pool::{BlobStoreError, TransactionPoolExt},
}; };

View File

@ -16,9 +16,15 @@ reth-network-peers.workspace = true
reth-primitives.workspace = true reth-primitives.workspace = true
reth-tracing.workspace = true reth-tracing.workspace = true
secp256k1 = { workspace = true, features = ["global-context", "rand-std", "recovery"] } secp256k1 = { workspace = true, features = [
"global-context",
"rand-std",
"recovery",
] }
tokio.workspace = true tokio.workspace = true
tokio-stream.workspace = true tokio-stream.workspace = true
serde_json.workspace = true serde_json.workspace = true
alloy-primitives.workspace = true

View File

@ -1,8 +1,8 @@
use alloy_primitives::{b256, B256};
use reth_chainspec::{ use reth_chainspec::{
once_cell_set, BaseFeeParams, Chain, ChainHardforks, ChainSpec, EthereumHardfork, ForkCondition, once_cell_set, BaseFeeParams, Chain, ChainHardforks, ChainSpec, EthereumHardfork, ForkCondition,
}; };
use reth_network_peers::NodeRecord; use reth_network_peers::NodeRecord;
use reth_primitives::{b256, B256};
use std::sync::Arc; use std::sync::Arc;

View File

@ -19,3 +19,4 @@ tokio.workspace = true
serde_json.workspace = true serde_json.workspace = true
alloy-genesis.workspace = true alloy-genesis.workspace = true
alloy-primitives.workspace = true

View File

@ -6,6 +6,7 @@
use std::sync::Arc; use std::sync::Arc;
use alloy_genesis::Genesis; use alloy_genesis::Genesis;
use alloy_primitives::{b256, hex};
use futures_util::StreamExt; use futures_util::StreamExt;
use reth::{ use reth::{
builder::{NodeBuilder, NodeHandle}, builder::{NodeBuilder, NodeHandle},
@ -16,7 +17,6 @@ use reth::{
use reth_chainspec::ChainSpec; use reth_chainspec::ChainSpec;
use reth_node_core::{args::RpcServerArgs, node_config::NodeConfig}; use reth_node_core::{args::RpcServerArgs, node_config::NodeConfig};
use reth_node_ethereum::EthereumNode; use reth_node_ethereum::EthereumNode;
use reth_primitives::{b256, hex};
#[tokio::main] #[tokio::main]
async fn main() -> eyre::Result<()> { async fn main() -> eyre::Result<()> {

View File

@ -23,7 +23,7 @@ use serde::{Deserialize, Serialize};
use thiserror::Error; use thiserror::Error;
use alloy_genesis::Genesis; use alloy_genesis::Genesis;
use alloy_primitives::Address; use alloy_primitives::{Address, B256};
use alloy_rpc_types::{ use alloy_rpc_types::{
engine::{ engine::{
ExecutionPayloadEnvelopeV2, ExecutionPayloadEnvelopeV3, ExecutionPayloadEnvelopeV4, ExecutionPayloadEnvelopeV2, ExecutionPayloadEnvelopeV3, ExecutionPayloadEnvelopeV4,
@ -64,7 +64,7 @@ use reth_payload_builder::{
EthBuiltPayload, EthPayloadBuilderAttributes, PayloadBuilderError, PayloadBuilderHandle, EthBuiltPayload, EthPayloadBuilderAttributes, PayloadBuilderError, PayloadBuilderHandle,
PayloadBuilderService, PayloadBuilderService,
}; };
use reth_primitives::{Withdrawals, B256}; use reth_primitives::Withdrawals;
use reth_tracing::{RethTracer, Tracer}; use reth_tracing::{RethTracer, Tracer};
/// A custom payload attributes type. /// A custom payload attributes type.

View File

@ -3,7 +3,7 @@
#![cfg_attr(not(test), warn(unused_crate_dependencies))] #![cfg_attr(not(test), warn(unused_crate_dependencies))]
use alloy_genesis::Genesis; use alloy_genesis::Genesis;
use alloy_primitives::Address; use alloy_primitives::{address, Address, U256};
use reth::{ use reth::{
builder::{ builder::{
components::{ExecutorBuilder, PayloadServiceBuilder}, components::{ExecutorBuilder, PayloadServiceBuilder},
@ -11,7 +11,6 @@ use reth::{
}, },
payload::{EthBuiltPayload, EthPayloadBuilderAttributes}, payload::{EthBuiltPayload, EthPayloadBuilderAttributes},
primitives::{ primitives::{
address,
revm_primitives::{Env, PrecompileResult}, revm_primitives::{Env, PrecompileResult},
Bytes, Bytes,
}, },
@ -39,7 +38,7 @@ use reth_node_ethereum::{
}; };
use reth_primitives::{ use reth_primitives::{
revm_primitives::{CfgEnvWithHandlerCfg, TxEnv}, revm_primitives::{CfgEnvWithHandlerCfg, TxEnv},
Header, TransactionSigned, U256, Header, TransactionSigned,
}; };
use reth_tracing::{RethTracer, Tracer}; use reth_tracing::{RethTracer, Tracer};
use std::sync::Arc; use std::sync::Arc;

View File

@ -21,3 +21,4 @@ tokio-stream.workspace = true
eyre.workspace = true eyre.workspace = true
rand.workspace = true rand.workspace = true
tracing.workspace = true tracing.workspace = true
alloy-primitives.workspace = true

View File

@ -1,7 +1,7 @@
use super::protocol::proto::{CustomRlpxProtoMessage, CustomRlpxProtoMessageKind}; use super::protocol::proto::{CustomRlpxProtoMessage, CustomRlpxProtoMessageKind};
use alloy_primitives::bytes::BytesMut;
use futures::{Stream, StreamExt}; use futures::{Stream, StreamExt};
use reth_eth_wire::multiplex::ProtocolConnection; use reth_eth_wire::multiplex::ProtocolConnection;
use reth_primitives::BytesMut;
use std::{ use std::{
pin::Pin, pin::Pin,
task::{ready, Context, Poll}, task::{ready, Context, Poll},

View File

@ -1,8 +1,8 @@
//! Simple RLPx Ping Pong protocol that also support sending messages, //! Simple RLPx Ping Pong protocol that also support sending messages,
//! following [RLPx specs](https://github.com/ethereum/devp2p/blob/master/rlpx.md) //! following [RLPx specs](https://github.com/ethereum/devp2p/blob/master/rlpx.md)
use alloy_primitives::bytes::{Buf, BufMut, BytesMut};
use reth_eth_wire::{protocol::Protocol, Capability}; use reth_eth_wire::{protocol::Protocol, Capability};
use reth_primitives::{Buf, BufMut, BytesMut};
#[repr(u8)] #[repr(u8)]
#[derive(Clone, Copy, Debug, PartialEq, Eq)] #[derive(Clone, Copy, Debug, PartialEq, Eq)]

View File

@ -1,9 +1,9 @@
use alloy_primitives::Address; use alloy_primitives::{Address, B256};
use alloy_rpc_types::{Filter, FilteredParams}; use alloy_rpc_types::{Filter, FilteredParams};
use reth_chainspec::ChainSpecBuilder; use reth_chainspec::ChainSpecBuilder;
use reth_node_ethereum::EthereumNode; use reth_node_ethereum::EthereumNode;
use reth_node_types::NodeTypesWithDBAdapter; use reth_node_types::NodeTypesWithDBAdapter;
use reth_primitives::{alloy_primitives::Sealable, SealedHeader, B256}; use reth_primitives::{alloy_primitives::Sealable, SealedHeader};
use reth_provider::{ use reth_provider::{
providers::StaticFileProvider, AccountReader, BlockReader, BlockSource, HeaderProvider, providers::StaticFileProvider, AccountReader, BlockReader, BlockSource, HeaderProvider,
ProviderFactory, ReceiptProvider, StateProvider, TransactionsProvider, ProviderFactory, ReceiptProvider, StateProvider, TransactionsProvider,

View File

@ -8,7 +8,11 @@ license.workspace = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
secp256k1 = { workspace = true, features = ["global-context", "rand-std", "recovery"] } secp256k1 = { workspace = true, features = [
"global-context",
"rand-std",
"recovery",
] }
tokio.workspace = true tokio.workspace = true
reth-network.workspace = true reth-network.workspace = true
reth-chainspec.workspace = true reth-chainspec.workspace = true
@ -18,3 +22,4 @@ reth-tracing.workspace = true
tokio-stream.workspace = true tokio-stream.workspace = true
reth-provider = { workspace = true, features = ["test-utils"] } reth-provider = { workspace = true, features = ["test-utils"] }
reth-discv4 = { workspace = true, features = ["test-utils"] } reth-discv4 = { workspace = true, features = ["test-utils"] }
alloy-primitives.workspace = true

View File

@ -1,8 +1,9 @@
use alloy_primitives::{b256, B256};
use reth_chainspec::{ use reth_chainspec::{
once_cell_set, BaseFeeParams, Chain, ChainHardforks, ChainSpec, EthereumHardfork, ForkCondition, once_cell_set, BaseFeeParams, Chain, ChainHardforks, ChainSpec, EthereumHardfork, ForkCondition,
}; };
use reth_discv4::NodeRecord; use reth_discv4::NodeRecord;
use reth_primitives::{b256, Head, B256}; use reth_primitives::Head;
use std::sync::Arc; use std::sync::Arc;

View File

@ -3,14 +3,14 @@
#![cfg_attr(not(test), warn(unused_crate_dependencies))] #![cfg_attr(not(test), warn(unused_crate_dependencies))]
use alloy_genesis::Genesis; use alloy_genesis::Genesis;
use alloy_primitives::Address; use alloy_primitives::{Address, U256};
use parking_lot::RwLock; use parking_lot::RwLock;
use reth::{ use reth::{
api::NextBlockEnvAttributes, api::NextBlockEnvAttributes,
builder::{components::ExecutorBuilder, BuilderContext, NodeBuilder}, builder::{components::ExecutorBuilder, BuilderContext, NodeBuilder},
primitives::{ primitives::{
revm_primitives::{BlockEnv, CfgEnvWithHandlerCfg, Env, PrecompileResult, TxEnv}, revm_primitives::{BlockEnv, CfgEnvWithHandlerCfg, Env, PrecompileResult, TxEnv},
Bytes, U256, Bytes,
}, },
revm::{ revm::{
handler::register::EvmHandler, handler::register::EvmHandler,

View File

@ -18,8 +18,8 @@ use std::{
/// ///
/// # Example /// # Example
/// ``` /// ```
/// # use alloy_primitives::Address; /// # use alloy_primitives::{Address, U256};
/// # use reth_primitives::{U256, hex, Bytes}; /// # use reth_primitives::{hex, Bytes};
/// # use reth_testing_utils::GenesisAllocator; /// # use reth_testing_utils::GenesisAllocator;
/// # use std::str::FromStr; /// # use std::str::FromStr;
/// let mut allocator = GenesisAllocator::default(); /// let mut allocator = GenesisAllocator::default();