From 2932ab3e43d75bd9f4402b1bf947274400613a9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20Anda=20Estensen?= Date: Tue, 10 Sep 2024 12:52:15 +0200 Subject: [PATCH] rpc: replace reth-primitive imports --- Cargo.lock | 7 +++++++ crates/rpc/rpc-api/Cargo.toml | 1 + crates/rpc/rpc-api/src/anvil.rs | 2 +- crates/rpc/rpc-api/src/debug.rs | 3 ++- crates/rpc/rpc-api/src/engine.rs | 3 ++- crates/rpc/rpc-api/src/ganache.rs | 2 +- crates/rpc/rpc-api/src/hardhat.rs | 2 +- crates/rpc/rpc-api/src/net.rs | 2 +- crates/rpc/rpc-api/src/otterscan.rs | 3 ++- crates/rpc/rpc-api/src/reth.rs | 3 ++- crates/rpc/rpc-api/src/trace.rs | 3 ++- crates/rpc/rpc-api/src/txpool.rs | 2 +- crates/rpc/rpc-api/src/web3.rs | 2 +- crates/rpc/rpc-builder/Cargo.toml | 2 ++ crates/rpc/rpc-builder/tests/it/auth.rs | 3 ++- crates/rpc/rpc-builder/tests/it/http.rs | 6 ++---- crates/rpc/rpc-builder/tests/it/serde.rs | 2 +- crates/rpc/rpc-engine-api/Cargo.toml | 3 +++ crates/rpc/rpc-engine-api/src/engine_api.rs | 7 +++---- crates/rpc/rpc-engine-api/src/error.rs | 2 +- crates/rpc/rpc-engine-api/tests/it/payload.rs | 3 ++- crates/rpc/rpc-eth-api/Cargo.toml | 5 +++-- crates/rpc/rpc-eth-api/src/bundle.rs | 2 +- crates/rpc/rpc-eth-api/src/core.rs | 5 ++--- crates/rpc/rpc-eth-api/src/helpers/call.rs | 3 ++- crates/rpc/rpc-eth-api/src/helpers/fee.rs | 2 +- .../rpc/rpc-eth-api/src/helpers/pending_block.rs | 6 +++--- crates/rpc/rpc-eth-api/src/helpers/signer.rs | 3 ++- crates/rpc/rpc-eth-api/src/helpers/spec.rs | 2 +- crates/rpc/rpc-eth-api/src/helpers/state.rs | 3 ++- crates/rpc/rpc-eth-api/src/helpers/trace.rs | 2 +- crates/rpc/rpc-eth-api/src/helpers/transaction.rs | 4 ++-- crates/rpc/rpc-eth-types/Cargo.toml | 1 + crates/rpc/rpc-eth-types/src/cache/db.rs | 14 +++++++------- crates/rpc/rpc-eth-types/src/cache/mod.rs | 3 ++- crates/rpc/rpc-eth-types/src/error.rs | 3 ++- crates/rpc/rpc-eth-types/src/fee_history.rs | 3 ++- crates/rpc/rpc-eth-types/src/gas_oracle.rs | 3 ++- crates/rpc/rpc-eth-types/src/id_provider.rs | 2 +- crates/rpc/rpc-eth-types/src/logs_utils.rs | 5 +++-- crates/rpc/rpc-eth-types/src/pending_block.rs | 5 ++--- crates/rpc/rpc-eth-types/src/receipt.rs | 3 ++- crates/rpc/rpc-eth-types/src/revm_utils.rs | 2 +- crates/rpc/rpc-eth-types/src/transaction.rs | 3 ++- crates/rpc/rpc-eth-types/src/utils.rs | 3 ++- crates/rpc/rpc-server-types/Cargo.toml | 1 - crates/rpc/rpc-server-types/src/result.rs | 2 +- crates/rpc/rpc-testing-util/Cargo.toml | 3 +++ crates/rpc/rpc-testing-util/src/debug.rs | 3 ++- crates/rpc/rpc-testing-util/src/trace.rs | 3 ++- crates/rpc/rpc-types-compat/Cargo.toml | 4 ++++ crates/rpc/rpc-types-compat/src/block.rs | 3 ++- crates/rpc/rpc-types-compat/src/engine/payload.rs | 5 +++-- crates/rpc/rpc-types-compat/src/transaction/mod.rs | 3 ++- .../rpc-types-compat/src/transaction/signature.rs | 3 ++- crates/rpc/rpc/Cargo.toml | 2 +- crates/rpc/rpc/src/debug.rs | 5 ++--- crates/rpc/rpc/src/engine.rs | 3 ++- crates/rpc/rpc/src/eth/bundle.rs | 4 ++-- crates/rpc/rpc/src/eth/core.rs | 6 ++++-- crates/rpc/rpc/src/eth/filter.rs | 3 ++- crates/rpc/rpc/src/eth/helpers/signer.rs | 7 +++---- crates/rpc/rpc/src/eth/helpers/spec.rs | 2 +- crates/rpc/rpc/src/eth/helpers/state.rs | 5 ++--- crates/rpc/rpc/src/eth/helpers/transaction.rs | 3 ++- crates/rpc/rpc/src/eth/pubsub.rs | 3 ++- crates/rpc/rpc/src/net.rs | 2 +- crates/rpc/rpc/src/otterscan.rs | 4 ++-- crates/rpc/rpc/src/reth.rs | 3 ++- crates/rpc/rpc/src/trace.rs | 3 ++- crates/rpc/rpc/src/txpool.rs | 3 ++- crates/rpc/rpc/src/web3.rs | 2 +- 72 files changed, 143 insertions(+), 97 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0c9a5a8545f0..ec597e4f025d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8290,6 +8290,7 @@ name = "reth-rpc-api" version = "1.0.6" dependencies = [ "alloy-json-rpc", + "alloy-primitives", "jsonrpsee", "reth-engine-primitives", "reth-network-peers", @@ -8303,6 +8304,7 @@ dependencies = [ name = "reth-rpc-api-testing-util" version = "1.0.6" dependencies = [ + "alloy-primitives", "futures", "jsonrpsee", "jsonrpsee-http-client", @@ -8320,6 +8322,7 @@ name = "reth-rpc-builder" version = "1.0.6" dependencies = [ "alloy-network", + "alloy-primitives", "clap", "http", "jsonrpsee", @@ -8366,6 +8369,7 @@ dependencies = [ name = "reth-rpc-engine-api" version = "1.0.6" dependencies = [ + "alloy-primitives", "alloy-rlp", "assert_matches", "async-trait", @@ -8403,6 +8407,7 @@ dependencies = [ "alloy-dyn-abi", "alloy-json-rpc", "alloy-network", + "alloy-primitives", "async-trait", "auto_impl", "dyn-clone", @@ -8436,6 +8441,7 @@ dependencies = [ name = "reth-rpc-eth-types" version = "1.0.6" dependencies = [ + "alloy-primitives", "alloy-sol-types", "derive_more", "futures", @@ -8528,6 +8534,7 @@ dependencies = [ name = "reth-rpc-types-compat" version = "1.0.6" dependencies = [ + "alloy-primitives", "alloy-rlp", "alloy-rpc-types", "reth-primitives", diff --git a/crates/rpc/rpc-api/Cargo.toml b/crates/rpc/rpc-api/Cargo.toml index 3bfb2e9a7662..399dfe9cc33b 100644 --- a/crates/rpc/rpc-api/Cargo.toml +++ b/crates/rpc/rpc-api/Cargo.toml @@ -21,6 +21,7 @@ reth-network-peers.workspace = true # ethereum alloy-json-rpc.workspace = true +alloy-primitives.workspace = true # misc jsonrpsee = { workspace = true, features = ["server", "macros"] } diff --git a/crates/rpc/rpc-api/src/anvil.rs b/crates/rpc/rpc-api/src/anvil.rs index 56416d094136..e916fa8c232c 100644 --- a/crates/rpc/rpc-api/src/anvil.rs +++ b/crates/rpc/rpc-api/src/anvil.rs @@ -1,6 +1,6 @@ use jsonrpsee::{core::RpcResult, proc_macros::rpc}; -use reth_primitives::{Address, Bytes, B256, U256}; +use alloy_primitives::{Address, Bytes, B256, U256}; use reth_rpc_types::{ anvil::{Forking, Metadata, MineOptions, NodeInfo}, Block, diff --git a/crates/rpc/rpc-api/src/debug.rs b/crates/rpc/rpc-api/src/debug.rs index 705ccc6ed1a5..0876b464cf74 100644 --- a/crates/rpc/rpc-api/src/debug.rs +++ b/crates/rpc/rpc-api/src/debug.rs @@ -1,5 +1,6 @@ +use alloy_primitives::{Address, Bytes, B256}; use jsonrpsee::{core::RpcResult, proc_macros::rpc}; -use reth_primitives::{Address, BlockId, BlockNumberOrTag, Bytes, B256}; +use reth_primitives::{BlockId, BlockNumberOrTag}; use reth_rpc_types::{ debug::ExecutionWitness, trace::geth::{ diff --git a/crates/rpc/rpc-api/src/engine.rs b/crates/rpc/rpc-api/src/engine.rs index c0e72bf1ab17..09993dd2f60d 100644 --- a/crates/rpc/rpc-api/src/engine.rs +++ b/crates/rpc/rpc-api/src/engine.rs @@ -4,9 +4,10 @@ //! the consensus client. use alloy_json_rpc::RpcObject; +use alloy_primitives::{Address, BlockHash, Bytes, B256, U256, U64}; use jsonrpsee::{core::RpcResult, proc_macros::rpc}; use reth_engine_primitives::EngineTypes; -use reth_primitives::{Address, BlockHash, BlockId, BlockNumberOrTag, Bytes, B256, U256, U64}; +use reth_primitives::{BlockId, BlockNumberOrTag}; use reth_rpc_types::{ engine::{ ClientVersionV1, ExecutionPayloadBodiesV1, ExecutionPayloadBodiesV2, diff --git a/crates/rpc/rpc-api/src/ganache.rs b/crates/rpc/rpc-api/src/ganache.rs index 338c914980eb..99a50c0fae42 100644 --- a/crates/rpc/rpc-api/src/ganache.rs +++ b/crates/rpc/rpc-api/src/ganache.rs @@ -1,5 +1,5 @@ +use alloy_primitives::U256; use jsonrpsee::{core::RpcResult, proc_macros::rpc}; -use reth_primitives::U256; use reth_rpc_types::anvil::MineOptions; /// Ganache rpc interface. diff --git a/crates/rpc/rpc-api/src/hardhat.rs b/crates/rpc/rpc-api/src/hardhat.rs index 1620bdb59671..c34991fd3a4f 100644 --- a/crates/rpc/rpc-api/src/hardhat.rs +++ b/crates/rpc/rpc-api/src/hardhat.rs @@ -1,5 +1,5 @@ +use alloy_primitives::{Address, Bytes, B256, U256}; use jsonrpsee::{core::RpcResult, proc_macros::rpc}; -use reth_primitives::{Address, Bytes, B256, U256}; use reth_rpc_types::anvil::{Forking, Metadata}; /// Hardhat rpc interface. diff --git a/crates/rpc/rpc-api/src/net.rs b/crates/rpc/rpc-api/src/net.rs index 98aa65bd0924..5535f123c18c 100644 --- a/crates/rpc/rpc-api/src/net.rs +++ b/crates/rpc/rpc-api/src/net.rs @@ -1,5 +1,5 @@ +use alloy_primitives::U64; use jsonrpsee::{core::RpcResult, proc_macros::rpc}; -use reth_primitives::U64; /// Net rpc interface. #[cfg_attr(not(feature = "client"), rpc(server, namespace = "net"))] diff --git a/crates/rpc/rpc-api/src/otterscan.rs b/crates/rpc/rpc-api/src/otterscan.rs index 1da4def25227..c025087ff53e 100644 --- a/crates/rpc/rpc-api/src/otterscan.rs +++ b/crates/rpc/rpc-api/src/otterscan.rs @@ -1,5 +1,6 @@ +use alloy_primitives::{Address, Bytes, TxHash, B256}; use jsonrpsee::{core::RpcResult, proc_macros::rpc}; -use reth_primitives::{Address, BlockId, Bytes, TxHash, B256}; +use reth_primitives::BlockId; use reth_rpc_types::{ trace::otterscan::{ BlockDetails, ContractCreator, InternalOperation, OtsBlockTransactions, TraceEntry, diff --git a/crates/rpc/rpc-api/src/reth.rs b/crates/rpc/rpc-api/src/reth.rs index 1e9c4314ab14..98c31b78f9a4 100644 --- a/crates/rpc/rpc-api/src/reth.rs +++ b/crates/rpc/rpc-api/src/reth.rs @@ -1,5 +1,6 @@ +use alloy_primitives::{Address, U256}; use jsonrpsee::{core::RpcResult, proc_macros::rpc}; -use reth_primitives::{Address, BlockId, U256}; +use reth_primitives::BlockId; use std::collections::HashMap; /// Reth API namespace for reth-specific methods diff --git a/crates/rpc/rpc-api/src/trace.rs b/crates/rpc/rpc-api/src/trace.rs index aa2a5693a865..13518c73d10b 100644 --- a/crates/rpc/rpc-api/src/trace.rs +++ b/crates/rpc/rpc-api/src/trace.rs @@ -1,5 +1,6 @@ +use alloy_primitives::{Bytes, B256}; use jsonrpsee::{core::RpcResult, proc_macros::rpc}; -use reth_primitives::{BlockId, Bytes, B256}; +use reth_primitives::BlockId; use reth_rpc_types::{ state::StateOverride, trace::{ diff --git a/crates/rpc/rpc-api/src/txpool.rs b/crates/rpc/rpc-api/src/txpool.rs index 844bcceaab5d..34591aa6d4d5 100644 --- a/crates/rpc/rpc-api/src/txpool.rs +++ b/crates/rpc/rpc-api/src/txpool.rs @@ -1,5 +1,5 @@ +use alloy_primitives::Address; use jsonrpsee::{core::RpcResult, proc_macros::rpc}; -use reth_primitives::Address; use reth_rpc_types::{ txpool::{TxpoolContent, TxpoolContentFrom, TxpoolInspect, TxpoolStatus}, Transaction, WithOtherFields, diff --git a/crates/rpc/rpc-api/src/web3.rs b/crates/rpc/rpc-api/src/web3.rs index cf3887cbc825..c4017e03f2df 100644 --- a/crates/rpc/rpc-api/src/web3.rs +++ b/crates/rpc/rpc-api/src/web3.rs @@ -1,5 +1,5 @@ +use alloy_primitives::{Bytes, B256}; use jsonrpsee::{core::RpcResult, proc_macros::rpc}; -use reth_primitives::{Bytes, B256}; /// Web3 rpc interface. #[cfg_attr(not(feature = "client"), rpc(server, namespace = "web3"))] diff --git a/crates/rpc/rpc-builder/Cargo.toml b/crates/rpc/rpc-builder/Cargo.toml index 6e0d5a48fa45..98d36ffa1600 100644 --- a/crates/rpc/rpc-builder/Cargo.toml +++ b/crates/rpc/rpc-builder/Cargo.toml @@ -68,6 +68,8 @@ reth-transaction-pool = { workspace = true, features = ["test-utils"] } reth-tokio-util.workspace = true reth-node-api.workspace = true +alloy-primitives.workspace = true + tokio = { workspace = true, features = ["rt", "rt-multi-thread"] } serde_json.workspace = true clap = { workspace = true, features = ["derive"] } diff --git a/crates/rpc/rpc-builder/tests/it/auth.rs b/crates/rpc/rpc-builder/tests/it/auth.rs index 631ea813578d..79a42d121c0b 100644 --- a/crates/rpc/rpc-builder/tests/it/auth.rs +++ b/crates/rpc/rpc-builder/tests/it/auth.rs @@ -1,9 +1,10 @@ //! Auth server tests use crate::utils::launch_auth; +use alloy_primitives::U64; use jsonrpsee::core::client::{ClientT, SubscriptionClientT}; use reth_ethereum_engine_primitives::EthEngineTypes; -use reth_primitives::{Block, U64}; +use reth_primitives::Block; use reth_rpc_api::clients::EngineApiClient; use reth_rpc_layer::JwtSecret; use reth_rpc_types::engine::{ForkchoiceState, PayloadId, TransitionConfiguration}; diff --git a/crates/rpc/rpc-builder/tests/it/http.rs b/crates/rpc/rpc-builder/tests/it/http.rs index c6a4975a04aa..500631427cb2 100644 --- a/crates/rpc/rpc-builder/tests/it/http.rs +++ b/crates/rpc/rpc-builder/tests/it/http.rs @@ -2,6 +2,7 @@ //! Standalone http tests use crate::utils::{launch_http, launch_http_ws, launch_ws}; +use alloy_primitives::{hex_literal::hex, Address, Bytes, TxHash, B256, B64, U256, U64}; use jsonrpsee::{ core::{ client::{ClientT, SubscriptionClientT}, @@ -12,10 +13,7 @@ use jsonrpsee::{ types::error::ErrorCode, }; use reth_network_peers::NodeRecord; -use reth_primitives::{ - hex_literal::hex, Address, BlockId, BlockNumberOrTag, Bytes, Receipt, TxHash, B256, B64, U256, - U64, -}; +use reth_primitives::{BlockId, BlockNumberOrTag, Receipt}; use reth_rpc_api::{ clients::{AdminApiClient, EthApiClient}, DebugApiClient, EthFilterApiClient, NetApiClient, OtterscanClient, TraceApiClient, diff --git a/crates/rpc/rpc-builder/tests/it/serde.rs b/crates/rpc/rpc-builder/tests/it/serde.rs index 5df41b2d19b7..e8d60f4c3bdb 100644 --- a/crates/rpc/rpc-builder/tests/it/serde.rs +++ b/crates/rpc/rpc-builder/tests/it/serde.rs @@ -1,11 +1,11 @@ //! various serde test use crate::utils::launch_http; +use alloy_primitives::U256; use jsonrpsee::{ core::{client::ClientT, traits::ToRpcParams}, types::Request, }; -use reth_primitives::U256; use reth_rpc_server_types::RethRpcModule; use serde_json::value::RawValue; diff --git a/crates/rpc/rpc-engine-api/Cargo.toml b/crates/rpc/rpc-engine-api/Cargo.toml index 8415c594b724..228e0a1fc6cb 100644 --- a/crates/rpc/rpc-engine-api/Cargo.toml +++ b/crates/rpc/rpc-engine-api/Cargo.toml @@ -27,6 +27,9 @@ reth-engine-primitives.workspace = true reth-evm.workspace = true reth-transaction-pool.workspace = true +# ethereum +alloy-primitives.workspace = true + # async tokio = { workspace = true, features = ["sync"] } diff --git a/crates/rpc/rpc-engine-api/src/engine_api.rs b/crates/rpc/rpc-engine-api/src/engine_api.rs index 6571ffd8bc7d..b2f95fea5f74 100644 --- a/crates/rpc/rpc-engine-api/src/engine_api.rs +++ b/crates/rpc/rpc-engine-api/src/engine_api.rs @@ -1,6 +1,7 @@ use crate::{ capabilities::EngineCapabilities, metrics::EngineApiMetrics, EngineApiError, EngineApiResult, }; +use alloy_primitives::{BlockHash, BlockNumber, B256, U64}; use async_trait::async_trait; use jsonrpsee_core::RpcResult; use reth_beacon_consensus::BeaconConsensusEngineHandle; @@ -12,9 +13,7 @@ use reth_payload_primitives::{ validate_payload_timestamp, EngineApiMessageVersion, PayloadAttributes, PayloadBuilderAttributes, PayloadOrAttributes, }; -use reth_primitives::{ - Block, BlockHash, BlockHashOrNumber, BlockNumber, EthereumHardfork, B256, U64, -}; +use reth_primitives::{Block, BlockHashOrNumber, EthereumHardfork}; use reth_rpc_api::EngineApiServer; use reth_rpc_types::{ engine::{ @@ -1147,7 +1146,7 @@ mod tests { // https://github.com/ethereum/execution-apis/blob/main/src/engine/paris.md#specification-3 mod exchange_transition_configuration { use super::*; - use reth_primitives::U256; + use alloy_primitives::U256; use reth_testing_utils::generators::{self, BlockParams}; #[tokio::test] diff --git a/crates/rpc/rpc-engine-api/src/error.rs b/crates/rpc/rpc-engine-api/src/error.rs index 17c527956ac0..7fd5a112a1c6 100644 --- a/crates/rpc/rpc-engine-api/src/error.rs +++ b/crates/rpc/rpc-engine-api/src/error.rs @@ -1,10 +1,10 @@ +use alloy_primitives::{B256, U256}; use jsonrpsee_types::error::{ INTERNAL_ERROR_CODE, INVALID_PARAMS_CODE, INVALID_PARAMS_MSG, SERVER_ERROR_MSG, }; use reth_beacon_consensus::{BeaconForkChoiceUpdateError, BeaconOnNewPayloadError}; use reth_payload_builder::error::PayloadBuilderError; use reth_payload_primitives::EngineObjectValidationError; -use reth_primitives::{B256, U256}; use reth_rpc_types::ToRpcError; use thiserror::Error; diff --git a/crates/rpc/rpc-engine-api/tests/it/payload.rs b/crates/rpc/rpc-engine-api/tests/it/payload.rs index c57beb21001c..0587de68498a 100644 --- a/crates/rpc/rpc-engine-api/tests/it/payload.rs +++ b/crates/rpc/rpc-engine-api/tests/it/payload.rs @@ -1,8 +1,9 @@ //! Some payload tests +use alloy_primitives::{Bytes, U256}; use alloy_rlp::{Decodable, Error as RlpError}; use assert_matches::assert_matches; -use reth_primitives::{proofs, Block, Bytes, SealedBlock, TransactionSigned, Withdrawals, U256}; +use reth_primitives::{proofs, Block, SealedBlock, TransactionSigned, Withdrawals}; use reth_rpc_types::engine::{ ExecutionPayload, ExecutionPayloadBodyV1, ExecutionPayloadV1, PayloadError, }; diff --git a/crates/rpc/rpc-eth-api/Cargo.toml b/crates/rpc/rpc-eth-api/Cargo.toml index 5c18bfef46ce..60762ba865bf 100644 --- a/crates/rpc/rpc-eth-api/Cargo.toml +++ b/crates/rpc/rpc-eth-api/Cargo.toml @@ -34,8 +34,9 @@ reth-trie.workspace = true # ethereum alloy-dyn-abi = { workspace = true, features = ["eip712"] } -alloy-network.workspace = true alloy-json-rpc.workspace = true +alloy-network.workspace = true +alloy-primitives.workspace = true # rpc jsonrpsee = { workspace = true, features = ["server", "macros"] } @@ -59,4 +60,4 @@ optimism = [ "reth-primitives/optimism", "revm/optimism", "reth-provider/optimism", -] \ No newline at end of file +] diff --git a/crates/rpc/rpc-eth-api/src/bundle.rs b/crates/rpc/rpc-eth-api/src/bundle.rs index bf3a623df2f1..563e6ff75459 100644 --- a/crates/rpc/rpc-eth-api/src/bundle.rs +++ b/crates/rpc/rpc-eth-api/src/bundle.rs @@ -2,8 +2,8 @@ //! //! See also +use alloy_primitives::{Bytes, B256}; use jsonrpsee::proc_macros::rpc; -use reth_primitives::{Bytes, B256}; use reth_rpc_types::mev::{ CancelBundleRequest, CancelPrivateTransactionRequest, EthBundleHash, EthCallBundle, EthCallBundleResponse, EthSendBundle, PrivateTransactionRequest, diff --git a/crates/rpc/rpc-eth-api/src/core.rs b/crates/rpc/rpc-eth-api/src/core.rs index b745b0516bae..c2103857aa1e 100644 --- a/crates/rpc/rpc-eth-api/src/core.rs +++ b/crates/rpc/rpc-eth-api/src/core.rs @@ -3,10 +3,9 @@ use alloy_dyn_abi::TypedData; use alloy_json_rpc::RpcObject; use alloy_network::Network; +use alloy_primitives::{Address, Bytes, B256, B64, U256, U64}; use jsonrpsee::{core::RpcResult, proc_macros::rpc}; -use reth_primitives::{ - transaction::AccessListResult, Address, BlockId, BlockNumberOrTag, Bytes, B256, B64, U256, U64, -}; +use reth_primitives::{transaction::AccessListResult, BlockId, BlockNumberOrTag}; use reth_rpc_server_types::{result::internal_rpc_err, ToRpcResult}; use reth_rpc_types::{ serde_helpers::JsonStorageKey, diff --git a/crates/rpc/rpc-eth-api/src/helpers/call.rs b/crates/rpc/rpc-eth-api/src/helpers/call.rs index 9d6b1f384b34..d32f0104b33f 100644 --- a/crates/rpc/rpc-eth-api/src/helpers/call.rs +++ b/crates/rpc/rpc-eth-api/src/helpers/call.rs @@ -2,6 +2,7 @@ //! methods. use crate::{AsEthApiError, FromEthApiError, FromEvmError, IntoEthApiError}; +use alloy_primitives::{Bytes, TxKind, B256, U256}; use futures::Future; use reth_evm::{ConfigureEvm, ConfigureEvmEnv}; use reth_primitives::{ @@ -10,7 +11,7 @@ use reth_primitives::{ ResultAndState, TransactTo, TxEnv, }, transaction::AccessListResult, - Bytes, TransactionSignedEcRecovered, TxKind, B256, U256, + TransactionSignedEcRecovered, }; use reth_provider::{ChainSpecProvider, StateProvider}; use reth_revm::{database::StateProviderDatabase, db::CacheDB, DatabaseRef}; diff --git a/crates/rpc/rpc-eth-api/src/helpers/fee.rs b/crates/rpc/rpc-eth-api/src/helpers/fee.rs index 1672ef00de14..c05b9881f971 100644 --- a/crates/rpc/rpc-eth-api/src/helpers/fee.rs +++ b/crates/rpc/rpc-eth-api/src/helpers/fee.rs @@ -1,8 +1,8 @@ //! Loads fee history from database. Helper trait for `eth_` fee and transaction RPC methods. +use alloy_primitives::U256; use futures::Future; use reth_chainspec::ChainSpec; -use reth_primitives::U256; use reth_provider::{BlockIdReader, BlockReaderIdExt, ChainSpecProvider, HeaderProvider}; use reth_rpc_eth_types::{ fee_history::calculate_reward_percentiles_for_block, EthApiError, EthStateCache, diff --git a/crates/rpc/rpc-eth-api/src/helpers/pending_block.rs b/crates/rpc/rpc-eth-api/src/helpers/pending_block.rs index a4ff3adb542e..3c811acebae3 100644 --- a/crates/rpc/rpc-eth-api/src/helpers/pending_block.rs +++ b/crates/rpc/rpc-eth-api/src/helpers/pending_block.rs @@ -4,6 +4,7 @@ use std::time::{Duration, Instant}; use crate::{EthApiTypes, FromEthApiError, FromEvmError}; +use alloy_primitives::{BlockNumber, B256, U256}; use futures::Future; use reth_chainspec::{ChainSpec, EthereumHardforks}; use reth_evm::{ @@ -18,9 +19,8 @@ use reth_primitives::{ BlockEnv, CfgEnv, CfgEnvWithHandlerCfg, EVMError, Env, ExecutionResult, InvalidTransaction, ResultAndState, SpecId, }, - Block, BlockNumber, Header, IntoRecoveredTransaction, Receipt, Requests, - SealedBlockWithSenders, SealedHeader, TransactionSignedEcRecovered, B256, - EMPTY_OMMER_ROOT_HASH, U256, + Block, Header, IntoRecoveredTransaction, Receipt, Requests, SealedBlockWithSenders, + SealedHeader, TransactionSignedEcRecovered, EMPTY_OMMER_ROOT_HASH, }; use reth_provider::{ BlockReader, BlockReaderIdExt, ChainSpecProvider, EvmEnvProvider, ProviderError, diff --git a/crates/rpc/rpc-eth-api/src/helpers/signer.rs b/crates/rpc/rpc-eth-api/src/helpers/signer.rs index 5b71761431eb..3580410b6d29 100644 --- a/crates/rpc/rpc-eth-api/src/helpers/signer.rs +++ b/crates/rpc/rpc-eth-api/src/helpers/signer.rs @@ -3,8 +3,9 @@ use std::result; use alloy_dyn_abi::TypedData; +use alloy_primitives::Address; use dyn_clone::DynClone; -use reth_primitives::{Address, Signature, TransactionSigned}; +use reth_primitives::{Signature, TransactionSigned}; use reth_rpc_eth_types::SignError; use reth_rpc_types::TypedTransactionRequest; diff --git a/crates/rpc/rpc-eth-api/src/helpers/spec.rs b/crates/rpc/rpc-eth-api/src/helpers/spec.rs index f8f257fdbba3..f404ec7db147 100644 --- a/crates/rpc/rpc-eth-api/src/helpers/spec.rs +++ b/crates/rpc/rpc-eth-api/src/helpers/spec.rs @@ -2,11 +2,11 @@ use std::sync::Arc; +use alloy_primitives::{Address, U256, U64}; use futures::Future; use reth_chainspec::{ChainInfo, ChainSpec}; use reth_errors::{RethError, RethResult}; use reth_network_api::NetworkInfo; -use reth_primitives::{Address, U256, U64}; use reth_provider::{BlockNumReader, ChainSpecProvider, StageCheckpointReader}; use reth_rpc_types::{Stage, SyncInfo, SyncStatus}; diff --git a/crates/rpc/rpc-eth-api/src/helpers/state.rs b/crates/rpc/rpc-eth-api/src/helpers/state.rs index 7dc60883001d..7ecd9e979762 100644 --- a/crates/rpc/rpc-eth-api/src/helpers/state.rs +++ b/crates/rpc/rpc-eth-api/src/helpers/state.rs @@ -1,11 +1,12 @@ //! Loads a pending block from database. Helper trait for `eth_` block, transaction, call and trace //! RPC methods. +use alloy_primitives::{Address, Bytes, B256, U256}; use futures::Future; use reth_chainspec::ChainSpec; use reth_errors::RethError; use reth_evm::ConfigureEvmEnv; -use reth_primitives::{Address, BlockId, Bytes, Header, B256, KECCAK_EMPTY, U256}; +use reth_primitives::{BlockId, Header, KECCAK_EMPTY}; use reth_provider::{ BlockIdReader, ChainSpecProvider, StateProvider, StateProviderBox, StateProviderFactory, }; diff --git a/crates/rpc/rpc-eth-api/src/helpers/trace.rs b/crates/rpc/rpc-eth-api/src/helpers/trace.rs index 09ad7f22fa21..896d28bab2a0 100644 --- a/crates/rpc/rpc-eth-api/src/helpers/trace.rs +++ b/crates/rpc/rpc-eth-api/src/helpers/trace.rs @@ -1,8 +1,8 @@ //! Loads a pending block from database. Helper trait for `eth_` call and trace RPC methods. +use alloy_primitives::B256; use futures::Future; use reth_evm::{ConfigureEvm, ConfigureEvmEnv}; -use reth_primitives::B256; use reth_revm::database::StateProviderDatabase; use reth_rpc_eth_types::{ cache::db::{StateCacheDb, StateCacheDbRefMutWrapper, StateProviderTraitObjWrapper}, diff --git a/crates/rpc/rpc-eth-api/src/helpers/transaction.rs b/crates/rpc/rpc-eth-api/src/helpers/transaction.rs index ef7fc5ef12fc..37856f3e13f0 100644 --- a/crates/rpc/rpc-eth-api/src/helpers/transaction.rs +++ b/crates/rpc/rpc-eth-api/src/helpers/transaction.rs @@ -2,10 +2,10 @@ //! network. use alloy_dyn_abi::TypedData; +use alloy_primitives::{Address, Bytes, TxHash, TxKind, B256, U256}; use futures::Future; use reth_primitives::{ - Address, BlockId, Bytes, Receipt, SealedBlockWithSenders, TransactionMeta, TransactionSigned, - TxHash, TxKind, B256, U256, + BlockId, Receipt, SealedBlockWithSenders, TransactionMeta, TransactionSigned, }; use reth_provider::{BlockNumReader, BlockReaderIdExt, ReceiptProvider, TransactionsProvider}; use reth_rpc_eth_types::{ diff --git a/crates/rpc/rpc-eth-types/Cargo.toml b/crates/rpc/rpc-eth-types/Cargo.toml index b07c98b3bca3..839eb219e639 100644 --- a/crates/rpc/rpc-eth-types/Cargo.toml +++ b/crates/rpc/rpc-eth-types/Cargo.toml @@ -29,6 +29,7 @@ reth-transaction-pool.workspace = true reth-trie.workspace = true # ethereum +alloy-primitives.workspace = true alloy-sol-types.workspace = true revm.workspace = true revm-inspectors.workspace = true diff --git a/crates/rpc/rpc-eth-types/src/cache/db.rs b/crates/rpc/rpc-eth-types/src/cache/db.rs index 2437f99864a6..60b895c47bae 100644 --- a/crates/rpc/rpc-eth-types/src/cache/db.rs +++ b/crates/rpc/rpc-eth-types/src/cache/db.rs @@ -2,8 +2,8 @@ //! in default implementation of //! `reth_rpc_eth_api::helpers::Call`. +use alloy_primitives::{Address, B256, U256}; use reth_errors::ProviderResult; -use reth_primitives::{Address, B256, U256}; use reth_revm::{database::StateProviderDatabase, db::CacheDB, DatabaseRef}; use reth_storage_api::StateProvider; use reth_trie::HashedStorage; @@ -75,7 +75,7 @@ impl<'a> reth_storage_api::StateProofProvider for StateProviderTraitObjWrapper<' &self, overlay: reth_trie::HashedPostState, target: reth_trie::HashedPostState, - ) -> reth_errors::ProviderResult> { + ) -> reth_errors::ProviderResult> { self.0.witness(overlay, target) } } @@ -92,15 +92,15 @@ impl<'a> reth_storage_api::AccountReader for StateProviderTraitObjWrapper<'a> { impl<'a> reth_storage_api::BlockHashReader for StateProviderTraitObjWrapper<'a> { fn block_hash( &self, - block_number: reth_primitives::BlockNumber, + block_number: alloy_primitives::BlockNumber, ) -> reth_errors::ProviderResult> { self.0.block_hash(block_number) } fn canonical_hashes_range( &self, - start: reth_primitives::BlockNumber, - end: reth_primitives::BlockNumber, + start: alloy_primitives::BlockNumber, + end: alloy_primitives::BlockNumber, ) -> reth_errors::ProviderResult> { self.0.canonical_hashes_range(start, end) } @@ -145,8 +145,8 @@ impl<'a> StateProvider for StateProviderTraitObjWrapper<'a> { fn storage( &self, account: revm_primitives::Address, - storage_key: reth_primitives::StorageKey, - ) -> reth_errors::ProviderResult> { + storage_key: alloy_primitives::StorageKey, + ) -> reth_errors::ProviderResult> { self.0.storage(account, storage_key) } } diff --git a/crates/rpc/rpc-eth-types/src/cache/mod.rs b/crates/rpc/rpc-eth-types/src/cache/mod.rs index 63daa641b474..b224d36c2399 100644 --- a/crates/rpc/rpc-eth-types/src/cache/mod.rs +++ b/crates/rpc/rpc-eth-types/src/cache/mod.rs @@ -1,5 +1,6 @@ //! Async caching support for eth RPC +use alloy_primitives::B256; use futures::{future::Either, Stream, StreamExt}; use reth_chain_state::CanonStateNotification; use reth_errors::{ProviderError, ProviderResult}; @@ -7,7 +8,7 @@ use reth_evm::{provider::EvmEnvProvider, ConfigureEvm}; use reth_execution_types::Chain; use reth_primitives::{ Block, BlockHashOrNumber, BlockWithSenders, Receipt, SealedBlock, SealedBlockWithSenders, - TransactionSigned, TransactionSignedEcRecovered, B256, + TransactionSigned, TransactionSignedEcRecovered, }; use reth_storage_api::{BlockReader, StateProviderFactory, TransactionVariant}; use reth_tasks::{TaskSpawner, TokioTaskExecutor}; diff --git a/crates/rpc/rpc-eth-types/src/error.rs b/crates/rpc/rpc-eth-types/src/error.rs index fc0dd3362948..1630da0a0676 100644 --- a/crates/rpc/rpc-eth-types/src/error.rs +++ b/crates/rpc/rpc-eth-types/src/error.rs @@ -2,9 +2,10 @@ use std::time::Duration; +use alloy_primitives::{Address, Bytes}; use alloy_sol_types::decode_revert_reason; use reth_errors::RethError; -use reth_primitives::{revm_primitives::InvalidHeader, Address, BlockId, Bytes}; +use reth_primitives::{revm_primitives::InvalidHeader, BlockId}; use reth_rpc_server_types::result::{ block_id_to_str, internal_rpc_err, invalid_params_rpc_err, rpc_err, rpc_error_with_code, }; diff --git a/crates/rpc/rpc-eth-types/src/fee_history.rs b/crates/rpc/rpc-eth-types/src/fee_history.rs index 94e52eb959db..17e1fea8aa97 100644 --- a/crates/rpc/rpc-eth-types/src/fee_history.rs +++ b/crates/rpc/rpc-eth-types/src/fee_history.rs @@ -6,6 +6,7 @@ use std::{ sync::{atomic::Ordering::SeqCst, Arc}, }; +use alloy_primitives::B256; use futures::{ future::{Fuse, FusedFuture}, FutureExt, Stream, StreamExt, @@ -16,7 +17,7 @@ use reth_chainspec::{ChainSpec, ChainSpecProvider}; use reth_primitives::{ basefee::calc_next_block_base_fee, eip4844::{calc_blob_gasprice, calculate_excess_blob_gas}, - Receipt, SealedBlock, TransactionSigned, B256, + Receipt, SealedBlock, TransactionSigned, }; use reth_rpc_types::TxGasAndReward; use reth_storage_api::BlockReaderIdExt; diff --git a/crates/rpc/rpc-eth-types/src/gas_oracle.rs b/crates/rpc/rpc-eth-types/src/gas_oracle.rs index c672c43375db..b5f9ca58d091 100644 --- a/crates/rpc/rpc-eth-types/src/gas_oracle.rs +++ b/crates/rpc/rpc-eth-types/src/gas_oracle.rs @@ -3,8 +3,9 @@ use std::fmt::{self, Debug, Formatter}; +use alloy_primitives::{B256, U256}; use derive_more::{Deref, DerefMut, From, Into}; -use reth_primitives::{constants::GWEI_TO_WEI, BlockNumberOrTag, B256, U256}; +use reth_primitives::{constants::GWEI_TO_WEI, BlockNumberOrTag}; use reth_rpc_server_types::constants; use reth_rpc_types::BlockId; use reth_storage_api::BlockReaderIdExt; diff --git a/crates/rpc/rpc-eth-types/src/id_provider.rs b/crates/rpc/rpc-eth-types/src/id_provider.rs index 642d87578f81..a2020d0b2199 100644 --- a/crates/rpc/rpc-eth-types/src/id_provider.rs +++ b/crates/rpc/rpc-eth-types/src/id_provider.rs @@ -46,7 +46,7 @@ fn to_quantity(val: u128) -> SubscriptionId<'static> { #[cfg(test)] mod tests { use super::*; - use reth_primitives::U128; + use alloy_primitives::U128; #[test] fn test_id_provider_quantity() { diff --git a/crates/rpc/rpc-eth-types/src/logs_utils.rs b/crates/rpc/rpc-eth-types/src/logs_utils.rs index a08db4ce483f..d332a044592e 100644 --- a/crates/rpc/rpc-eth-types/src/logs_utils.rs +++ b/crates/rpc/rpc-eth-types/src/logs_utils.rs @@ -2,9 +2,10 @@ //! //! Log parsing for building filter. +use alloy_primitives::TxHash; use reth_chainspec::ChainInfo; use reth_errors::ProviderError; -use reth_primitives::{BlockNumHash, Receipt, TxHash}; +use reth_primitives::{BlockNumHash, Receipt}; use reth_rpc_server_types::result::rpc_error_with_code; use reth_rpc_types::{FilterId, FilteredParams, Log}; use reth_storage_api::BlockReader; @@ -167,7 +168,7 @@ pub fn append_matching_block_logs( /// Returns true if the log matches the filter and should be included pub fn log_matches_filter( block: BlockNumHash, - log: &reth_primitives::Log, + log: &alloy_primitives::Log, params: &FilteredParams, ) -> bool { if params.filter.is_some() && diff --git a/crates/rpc/rpc-eth-types/src/pending_block.rs b/crates/rpc/rpc-eth-types/src/pending_block.rs index 8a9503d81e81..949e205dcf88 100644 --- a/crates/rpc/rpc-eth-types/src/pending_block.rs +++ b/crates/rpc/rpc-eth-types/src/pending_block.rs @@ -4,10 +4,9 @@ use std::time::Instant; +use alloy_primitives::B256; use derive_more::Constructor; -use reth_primitives::{ - BlockId, BlockNumberOrTag, Receipt, SealedBlockWithSenders, SealedHeader, B256, -}; +use reth_primitives::{BlockId, BlockNumberOrTag, Receipt, SealedBlockWithSenders, SealedHeader}; use revm_primitives::{BlockEnv, CfgEnvWithHandlerCfg}; /// Configured [`BlockEnv`] and [`CfgEnvWithHandlerCfg`] for a pending block. diff --git a/crates/rpc/rpc-eth-types/src/receipt.rs b/crates/rpc/rpc-eth-types/src/receipt.rs index 34b10fd1c23c..2d9121e25a5e 100644 --- a/crates/rpc/rpc-eth-types/src/receipt.rs +++ b/crates/rpc/rpc-eth-types/src/receipt.rs @@ -1,6 +1,7 @@ //! RPC receipt response builder, extends a layer one receipt with layer two data. -use reth_primitives::{Address, Receipt, TransactionMeta, TransactionSigned, TxKind}; +use alloy_primitives::{Address, TxKind}; +use reth_primitives::{Receipt, TransactionMeta, TransactionSigned}; use reth_rpc_types::{ AnyReceiptEnvelope, AnyTransactionReceipt, Log, OtherFields, ReceiptWithBloom, TransactionReceipt, WithOtherFields, diff --git a/crates/rpc/rpc-eth-types/src/revm_utils.rs b/crates/rpc/rpc-eth-types/src/revm_utils.rs index 5e0747c0e38e..bfcc2bf42062 100644 --- a/crates/rpc/rpc-eth-types/src/revm_utils.rs +++ b/crates/rpc/rpc-eth-types/src/revm_utils.rs @@ -1,6 +1,6 @@ //! utilities for working with revm -use reth_primitives::{Address, B256, U256}; +use alloy_primitives::{Address, B256, U256}; use reth_rpc_types::{ state::{AccountOverride, StateOverride}, BlockOverrides, diff --git a/crates/rpc/rpc-eth-types/src/transaction.rs b/crates/rpc/rpc-eth-types/src/transaction.rs index 39d10f08e9f2..0ea37108282c 100644 --- a/crates/rpc/rpc-eth-types/src/transaction.rs +++ b/crates/rpc/rpc-eth-types/src/transaction.rs @@ -1,7 +1,8 @@ //! Helper types for `reth_rpc_eth_api::EthApiServer` implementation. //! //! Transaction wrapper that labels transaction with its origin. -use reth_primitives::{TransactionSignedEcRecovered, B256}; +use alloy_primitives::B256; +use reth_primitives::TransactionSignedEcRecovered; use reth_rpc_types::{Transaction, TransactionInfo, WithOtherFields}; use reth_rpc_types_compat::transaction::from_recovered_with_block_context; diff --git a/crates/rpc/rpc-eth-types/src/utils.rs b/crates/rpc/rpc-eth-types/src/utils.rs index ca2901ba8679..bb7c3d64846e 100644 --- a/crates/rpc/rpc-eth-types/src/utils.rs +++ b/crates/rpc/rpc-eth-types/src/utils.rs @@ -1,6 +1,7 @@ //! Commonly used code snippets -use reth_primitives::{Bytes, PooledTransactionsElement, PooledTransactionsElementEcRecovered}; +use alloy_primitives::Bytes; +use reth_primitives::{PooledTransactionsElement, PooledTransactionsElementEcRecovered}; use std::future::Future; use super::{EthApiError, EthResult}; diff --git a/crates/rpc/rpc-server-types/Cargo.toml b/crates/rpc/rpc-server-types/Cargo.toml index 628654ebaf98..e908af0af75a 100644 --- a/crates/rpc/rpc-server-types/Cargo.toml +++ b/crates/rpc/rpc-server-types/Cargo.toml @@ -17,7 +17,6 @@ reth-network-api.workspace = true reth-primitives.workspace = true reth-rpc-types.workspace = true - # ethereum alloy-primitives.workspace = true diff --git a/crates/rpc/rpc-server-types/src/result.rs b/crates/rpc/rpc-server-types/src/result.rs index e0397d485ef7..3dc76f0d8f4b 100644 --- a/crates/rpc/rpc-server-types/src/result.rs +++ b/crates/rpc/rpc-server-types/src/result.rs @@ -144,7 +144,7 @@ pub fn rpc_err( code, msg.into(), data.map(|data| { - jsonrpsee_core::to_json_raw_value(&reth_primitives::hex::encode_prefixed(data)) + jsonrpsee_core::to_json_raw_value(&alloy_primitives::hex::encode_prefixed(data)) .expect("serializing String can't fail") }), ) diff --git a/crates/rpc/rpc-testing-util/Cargo.toml b/crates/rpc/rpc-testing-util/Cargo.toml index 19cef0b02de8..59672595d50a 100644 --- a/crates/rpc/rpc-testing-util/Cargo.toml +++ b/crates/rpc/rpc-testing-util/Cargo.toml @@ -17,6 +17,9 @@ reth-primitives.workspace = true reth-rpc-types.workspace = true reth-rpc-api = { workspace = true, features = ["client"] } +# ethereum +alloy-primitives.workspace = true + # async futures.workspace = true diff --git a/crates/rpc/rpc-testing-util/src/debug.rs b/crates/rpc/rpc-testing-util/src/debug.rs index 9bbccaa2a43d..0ec5311fe9f2 100644 --- a/crates/rpc/rpc-testing-util/src/debug.rs +++ b/crates/rpc/rpc-testing-util/src/debug.rs @@ -6,9 +6,10 @@ use std::{ task::{Context, Poll}, }; +use alloy_primitives::{TxHash, B256}; use futures::{Stream, StreamExt}; use jsonrpsee::core::client::Error as RpcError; -use reth_primitives::{BlockId, Receipt, TxHash, B256}; +use reth_primitives::{BlockId, Receipt}; use reth_rpc_api::{clients::DebugApiClient, EthApiClient}; use reth_rpc_types::{ trace::{ diff --git a/crates/rpc/rpc-testing-util/src/trace.rs b/crates/rpc/rpc-testing-util/src/trace.rs index 862ecb432392..5a1843935e44 100644 --- a/crates/rpc/rpc-testing-util/src/trace.rs +++ b/crates/rpc/rpc-testing-util/src/trace.rs @@ -1,8 +1,9 @@ //! Helpers for testing trace calls. +use alloy_primitives::{Bytes, TxHash, B256}; use futures::{Stream, StreamExt}; use jsonrpsee::core::client::Error as RpcError; -use reth_primitives::{BlockId, Bytes, TxHash, B256}; +use reth_primitives::BlockId; use reth_rpc_api::clients::TraceApiClient; use reth_rpc_types::{ trace::{ diff --git a/crates/rpc/rpc-types-compat/Cargo.toml b/crates/rpc/rpc-types-compat/Cargo.toml index a589ef418c64..23304c51bdba 100644 --- a/crates/rpc/rpc-types-compat/Cargo.toml +++ b/crates/rpc/rpc-types-compat/Cargo.toml @@ -12,9 +12,13 @@ description = "Compatibility layer for reth-primitives and ethereum RPC types" workspace = true [dependencies] +# reth reth-primitives.workspace = true reth-rpc-types.workspace = true reth-trie-common.workspace = true + +# ethereum +alloy-primitives.workspace = true alloy-rlp.workspace = true alloy-rpc-types.workspace = true diff --git a/crates/rpc/rpc-types-compat/src/block.rs b/crates/rpc/rpc-types-compat/src/block.rs index 3b3c22c83b28..1981c0555cf8 100644 --- a/crates/rpc/rpc-types-compat/src/block.rs +++ b/crates/rpc/rpc-types-compat/src/block.rs @@ -1,10 +1,11 @@ //! Compatibility functions for rpc `Block` type. use crate::transaction::from_recovered_with_block_context; +use alloy_primitives::{B256, U256}; use alloy_rlp::Encodable; use alloy_rpc_types::{Transaction, TransactionInfo}; use reth_primitives::{ - Block as PrimitiveBlock, BlockWithSenders, Header as PrimitiveHeader, Withdrawals, B256, U256, + Block as PrimitiveBlock, BlockWithSenders, Header as PrimitiveHeader, Withdrawals, }; use reth_rpc_types::{ Block, BlockError, BlockTransactions, BlockTransactionsKind, Header, WithOtherFields, diff --git a/crates/rpc/rpc-types-compat/src/engine/payload.rs b/crates/rpc/rpc-types-compat/src/engine/payload.rs index 933beb985561..bd2401b96ac8 100644 --- a/crates/rpc/rpc-types-compat/src/engine/payload.rs +++ b/crates/rpc/rpc-types-compat/src/engine/payload.rs @@ -1,10 +1,11 @@ //! Standalone Conversion Functions for Handling Different Versions of Execution Payloads in //! Ethereum's Engine +use alloy_primitives::{B256, U256}; use reth_primitives::{ constants::{EMPTY_OMMER_ROOT_HASH, MAXIMUM_EXTRA_DATA_SIZE}, proofs::{self}, - Block, Header, Request, SealedBlock, TransactionSigned, UintTryTo, Withdrawals, B256, U256, + Block, Header, Request, SealedBlock, TransactionSigned, UintTryTo, Withdrawals, }; use reth_rpc_types::engine::{ payload::{ExecutionPayloadBodyV1, ExecutionPayloadFieldV2, ExecutionPayloadInputV2}, @@ -447,7 +448,7 @@ mod tests { block_to_payload_v3, try_into_block, try_payload_v3_to_block, try_payload_v4_to_block, validate_block_hash, }; - use reth_primitives::{b256, hex, Bytes, U256}; + use alloy_primitives::{b256, hex, Bytes, U256}; use reth_rpc_types::{ engine::{CancunPayloadFields, ExecutionPayloadV3, ExecutionPayloadV4}, ExecutionPayload, ExecutionPayloadV1, ExecutionPayloadV2, diff --git a/crates/rpc/rpc-types-compat/src/transaction/mod.rs b/crates/rpc/rpc-types-compat/src/transaction/mod.rs index 0e5130c03eb4..bc1c498d240f 100644 --- a/crates/rpc/rpc-types-compat/src/transaction/mod.rs +++ b/crates/rpc/rpc-types-compat/src/transaction/mod.rs @@ -1,10 +1,11 @@ //! Compatibility functions for rpc `Transaction` type. +use alloy_primitives::{Address, TxKind}; use alloy_rpc_types::{ request::{TransactionInput, TransactionRequest}, TransactionInfo, }; -use reth_primitives::{Address, TransactionSignedEcRecovered, TxKind, TxType}; +use reth_primitives::{TransactionSignedEcRecovered, TxType}; use reth_rpc_types::{Transaction, WithOtherFields}; use signature::from_primitive_signature; pub use typed::*; diff --git a/crates/rpc/rpc-types-compat/src/transaction/signature.rs b/crates/rpc/rpc-types-compat/src/transaction/signature.rs index fb41f517d533..b68568ee5d4d 100644 --- a/crates/rpc/rpc-types-compat/src/transaction/signature.rs +++ b/crates/rpc/rpc-types-compat/src/transaction/signature.rs @@ -1,4 +1,5 @@ -use reth_primitives::{Signature as PrimitiveSignature, TxType, U256}; +use alloy_primitives::U256; +use reth_primitives::{Signature as PrimitiveSignature, TxType}; use reth_rpc_types::{Parity, Signature}; /// Creates a new rpc signature from a legacy [primitive diff --git a/crates/rpc/rpc/Cargo.toml b/crates/rpc/rpc/Cargo.toml index 20b596681b40..b825fa8c5c1a 100644 --- a/crates/rpc/rpc/Cargo.toml +++ b/crates/rpc/rpc/Cargo.toml @@ -36,7 +36,7 @@ reth-node-api.workspace = true reth-network-types.workspace = true reth-trie.workspace = true -# eth +# ethereum alloy-dyn-abi.workspace = true alloy-rlp.workspace = true alloy-primitives.workspace = true diff --git a/crates/rpc/rpc/src/debug.rs b/crates/rpc/rpc/src/debug.rs index 781bad29da60..95af81a7bd86 100644 --- a/crates/rpc/rpc/src/debug.rs +++ b/crates/rpc/rpc/src/debug.rs @@ -1,3 +1,4 @@ +use alloy_primitives::{Address, Bytes, B256, U256}; use alloy_rlp::{Decodable, Encodable}; use async_trait::async_trait; use jsonrpsee::core::RpcResult; @@ -6,9 +7,7 @@ use reth_evm::{ system_calls::{pre_block_beacon_root_contract_call, pre_block_blockhashes_contract_call}, ConfigureEvmEnv, }; -use reth_primitives::{ - Address, Block, BlockId, BlockNumberOrTag, Bytes, TransactionSignedEcRecovered, B256, U256, -}; +use reth_primitives::{Block, BlockId, BlockNumberOrTag, TransactionSignedEcRecovered}; use reth_provider::{ BlockReaderIdExt, ChainSpecProvider, EvmEnvProvider, HeaderProvider, StateProofProvider, StateProviderFactory, TransactionVariant, diff --git a/crates/rpc/rpc/src/engine.rs b/crates/rpc/rpc/src/engine.rs index 3cdd27f10baa..96d4c674d18a 100644 --- a/crates/rpc/rpc/src/engine.rs +++ b/crates/rpc/rpc/src/engine.rs @@ -1,6 +1,7 @@ use alloy_network::Network; +use alloy_primitives::{Address, Bytes, B256, U256, U64}; use jsonrpsee::core::RpcResult as Result; -use reth_primitives::{Address, BlockId, BlockNumberOrTag, Bytes, B256, U256, U64}; +use reth_primitives::{BlockId, BlockNumberOrTag}; use reth_rpc_api::{EngineEthApiServer, EthApiServer, EthFilterApiServer}; /// Re-export for convenience pub use reth_rpc_engine_api::EngineApi; diff --git a/crates/rpc/rpc/src/eth/bundle.rs b/crates/rpc/rpc/src/eth/bundle.rs index 8f90597187a9..484b8dfe8633 100644 --- a/crates/rpc/rpc/src/eth/bundle.rs +++ b/crates/rpc/rpc/src/eth/bundle.rs @@ -2,12 +2,12 @@ use std::sync::Arc; +use alloy_primitives::{keccak256, U256}; use jsonrpsee::core::RpcResult; use reth_evm::{ConfigureEvm, ConfigureEvmEnv}; use reth_primitives::{ - keccak256, revm_primitives::db::{DatabaseCommit, DatabaseRef}, - PooledTransactionsElement, U256, + PooledTransactionsElement, }; use reth_revm::database::StateProviderDatabase; use reth_rpc_eth_api::{FromEthApiError, FromEvmError}; diff --git a/crates/rpc/rpc/src/eth/core.rs b/crates/rpc/rpc/src/eth/core.rs index 06e1be121374..3868bfcabe41 100644 --- a/crates/rpc/rpc/src/eth/core.rs +++ b/crates/rpc/rpc/src/eth/core.rs @@ -4,9 +4,10 @@ use std::sync::Arc; use alloy_network::AnyNetwork; +use alloy_primitives::U256; use derive_more::Deref; use reth_node_api::{BuilderProvider, FullNodeComponents}; -use reth_primitives::{BlockNumberOrTag, U256}; +use reth_primitives::BlockNumberOrTag; use reth_provider::{BlockReaderIdExt, CanonStateSubscriptions, ChainSpecProvider}; use reth_rpc_eth_api::{ helpers::{EthSigner, SpawnBlocking}, @@ -349,11 +350,12 @@ impl EthApiInner