Skip to content

Commit f373efe

Browse files
authored
refactor: phase out alloy-rpc-types usage (paradigmxyz#12395)
1 parent c5ab424 commit f373efe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+106
-110
lines changed

Cargo.lock

Lines changed: 14 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/consensus/debug-client/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ reth-tracing.workspace = true
2121
alloy-consensus = { workspace = true, features = ["serde"] }
2222
alloy-eips.workspace = true
2323
alloy-provider = { workspace = true, features = ["ws"] }
24-
alloy-rpc-types.workspace = true
24+
alloy-rpc-types-eth.workspace = true
2525
alloy-rpc-types-engine.workspace = true
2626
alloy-primitives.workspace = true
2727

crates/consensus/debug-client/src/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use alloy_consensus::Transaction;
22
use alloy_eips::eip2718::Encodable2718;
33
use alloy_primitives::B256;
4-
use alloy_rpc_types::{Block, BlockTransactions};
54
use alloy_rpc_types_engine::{ExecutionPayloadV1, ExecutionPayloadV2, ExecutionPayloadV3};
5+
use alloy_rpc_types_eth::{Block, BlockTransactions};
66
use reth_node_api::EngineTypes;
77
use reth_rpc_builder::auth::AuthServerHandle;
88
use reth_tracing::tracing::warn;

crates/consensus/debug-client/src/providers/etherscan.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::BlockProvider;
22
use alloy_eips::BlockNumberOrTag;
3-
use alloy_rpc_types::Block;
3+
use alloy_rpc_types_eth::Block;
44
use reqwest::Client;
55
use reth_tracing::tracing::warn;
66
use serde::Deserialize;

crates/consensus/debug-client/src/providers/rpc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::BlockProvider;
22
use alloy_eips::BlockNumberOrTag;
33
use alloy_provider::{Provider, ProviderBuilder};
4-
use alloy_rpc_types::{Block, BlockTransactionsKind};
4+
use alloy_rpc_types_eth::{Block, BlockTransactionsKind};
55
use futures::StreamExt;
66
use tokio::sync::mpsc::Sender;
77

crates/e2e-test-utils/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ tokio-stream.workspace = true
4141
serde_json.workspace = true
4242
alloy-signer.workspace = true
4343
alloy-signer-local = { workspace = true, features = ["mnemonic"] }
44-
alloy-rpc-types.workspace = true
44+
alloy-rpc-types-eth.workspace = true
45+
alloy-rpc-types-engine.workspace = true
4546
alloy-network.workspace = true
4647
alloy-consensus = { workspace = true, features = ["kzg"] }
4748
tracing.workspace = true

crates/e2e-test-utils/src/node.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::{marker::PhantomData, pin::Pin};
22

33
use alloy_primitives::{BlockHash, BlockNumber, Bytes, B256};
4-
use alloy_rpc_types::BlockNumberOrTag;
4+
use alloy_rpc_types_eth::BlockNumberOrTag;
55
use eyre::Ok;
66
use futures_util::Future;
77
use reth::{

crates/e2e-test-utils/src/traits.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use alloy_rpc_types::engine::ExecutionPayloadEnvelopeV4;
1+
use alloy_rpc_types_engine::ExecutionPayloadEnvelopeV4;
22
use op_alloy_rpc_types_engine::{OpExecutionPayloadEnvelopeV3, OpExecutionPayloadEnvelopeV4};
33
use reth::rpc::types::engine::{ExecutionPayloadEnvelopeV3, ExecutionPayloadV3};
44

crates/e2e-test-utils/src/transaction.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use alloy_network::{
44
eip2718::Encodable2718, Ethereum, EthereumWallet, TransactionBuilder, TransactionBuilder4844,
55
};
66
use alloy_primitives::{hex, Address, Bytes, TxKind, B256, U256};
7-
use alloy_rpc_types::{Authorization, TransactionInput, TransactionRequest};
7+
use alloy_rpc_types_eth::{Authorization, TransactionInput, TransactionRequest};
88
use alloy_signer::SignerSync;
99
use alloy_signer_local::PrivateKeySigner;
1010
use eyre::Ok;

crates/optimism/rpc/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ reth-optimism-forks.workspace = true
3737
alloy-eips.workspace = true
3838
alloy-primitives.workspace = true
3939
alloy-rpc-types-eth.workspace = true
40-
alloy-rpc-types.workspace = true
4140
alloy-consensus.workspace = true
4241
op-alloy-network.workspace = true
4342
op-alloy-rpc-types.workspace = true

crates/optimism/rpc/src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! RPC errors specific to OP.
22
3-
use alloy_rpc_types::error::EthRpcErrorCode;
3+
use alloy_rpc_types_eth::error::EthRpcErrorCode;
44
use jsonrpsee_types::error::INTERNAL_ERROR_CODE;
55
use reth_optimism_evm::OpBlockExecutionError;
66
use reth_primitives::revm_primitives::{InvalidTransaction, OptimismInvalidTransaction};

crates/optimism/rpc/src/eth/block.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Loads and formats OP block RPC response.
22
3-
use alloy_rpc_types::BlockId;
3+
use alloy_rpc_types_eth::BlockId;
44
use op_alloy_network::Network;
55
use op_alloy_rpc_types::OpTransactionReceipt;
66
use reth_chainspec::ChainSpecProvider;

crates/optimism/rpc/src/eth/receipt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Loads and formats OP receipt RPC response.
22
33
use alloy_eips::eip2718::Encodable2718;
4-
use alloy_rpc_types::{Log, TransactionReceipt};
4+
use alloy_rpc_types_eth::{Log, TransactionReceipt};
55
use op_alloy_consensus::{
66
DepositTransaction, OpDepositReceipt, OpDepositReceiptWithBloom, OpReceiptEnvelope,
77
};

crates/optimism/rpc/src/eth/transaction.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
use alloy_consensus::{Signed, Transaction as _};
44
use alloy_primitives::{Bytes, B256};
5-
use alloy_rpc_types::TransactionInfo;
5+
use alloy_rpc_types_eth::TransactionInfo;
66
use op_alloy_consensus::OpTxEnvelope;
77
use op_alloy_rpc_types::Transaction;
88
use reth_node_api::FullNodeComponents;
@@ -121,7 +121,7 @@ where
121121
.unwrap_or_else(|| inner.max_fee_per_gas());
122122

123123
Transaction {
124-
inner: alloy_rpc_types::Transaction {
124+
inner: alloy_rpc_types_eth::Transaction {
125125
inner,
126126
block_hash,
127127
block_number,

crates/rpc/rpc-api/src/anvil.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use jsonrpsee::{core::RpcResult, proc_macros::rpc};
22

33
use alloy_primitives::{Address, Bytes, B256, U256};
4-
use alloy_rpc_types::Block;
54
use alloy_rpc_types_anvil::{Forking, Metadata, MineOptions, NodeInfo};
5+
use alloy_rpc_types_eth::Block;
66

77
/// Anvil rpc interface.
88
/// https://book.getfoundry.sh/reference/anvil/#custom-methods

crates/rpc/rpc-api/src/debug.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
use alloy_eips::{BlockId, BlockNumberOrTag};
22
use alloy_primitives::{Address, Bytes, B256};
3-
use alloy_rpc_types::{Block, Bundle, StateContext};
43
use alloy_rpc_types_debug::ExecutionWitness;
5-
use alloy_rpc_types_eth::transaction::TransactionRequest;
4+
use alloy_rpc_types_eth::{transaction::TransactionRequest, Block, Bundle, StateContext};
65
use alloy_rpc_types_trace::geth::{
76
BlockTraceResult, GethDebugTracingCallOptions, GethDebugTracingOptions, GethTrace, TraceResult,
87
};

crates/rpc/rpc-api/src/engine.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
use alloy_eips::{eip4844::BlobAndProofV1, eip7685::Requests, BlockId, BlockNumberOrTag};
77
use alloy_json_rpc::RpcObject;
88
use alloy_primitives::{Address, BlockHash, Bytes, B256, U256, U64};
9-
use alloy_rpc_types::{
10-
state::StateOverride, BlockOverrides, EIP1186AccountProofResponse, Filter, Log, SyncStatus,
11-
};
129
use alloy_rpc_types_engine::{
1310
ClientVersionV1, ExecutionPayloadBodiesV1, ExecutionPayloadInputV2, ExecutionPayloadV1,
1411
ExecutionPayloadV3, ForkchoiceState, ForkchoiceUpdated, PayloadId, PayloadStatus,
1512
TransitionConfiguration,
1613
};
17-
use alloy_rpc_types_eth::transaction::TransactionRequest;
14+
use alloy_rpc_types_eth::{
15+
state::StateOverride, transaction::TransactionRequest, BlockOverrides,
16+
EIP1186AccountProofResponse, Filter, Log, SyncStatus,
17+
};
1818
use alloy_serde::JsonStorageKey;
1919
use jsonrpsee::{core::RpcResult, proc_macros::rpc};
2020
use reth_engine_primitives::EngineTypes;

crates/rpc/rpc-api/src/otterscan.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use alloy_eips::BlockId;
22
use alloy_json_rpc::RpcObject;
33
use alloy_primitives::{Address, Bytes, TxHash, B256};
4-
use alloy_rpc_types::Header;
4+
use alloy_rpc_types_eth::Header;
55
use alloy_rpc_types_trace::otterscan::{
66
BlockDetails, ContractCreator, InternalOperation, OtsBlockTransactions, TraceEntry,
77
TransactionsWithReceipts,

crates/rpc/rpc-api/src/trace.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
use alloy_eips::BlockId;
22
use alloy_primitives::{map::HashSet, Bytes, B256};
3-
use alloy_rpc_types::{state::StateOverride, BlockOverrides, Index};
4-
use alloy_rpc_types_eth::transaction::TransactionRequest;
3+
use alloy_rpc_types_eth::{
4+
state::StateOverride, transaction::TransactionRequest, BlockOverrides, Index,
5+
};
56
use alloy_rpc_types_trace::{
67
filter::TraceFilter,
78
opcode::{BlockOpcodeGas, TransactionOpcodeGas},

crates/rpc/rpc-eth-api/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ reth-trie.workspace = true
3333
reth-node-api.workspace = true
3434

3535
# ethereum
36+
alloy-serde.workspace = true
3637
alloy-eips.workspace = true
3738
alloy-dyn-abi = { workspace = true, features = ["eip712"] }
3839
alloy-json-rpc.workspace = true
3940
alloy-network.workspace = true
4041
alloy-primitives.workspace = true
4142
alloy-rpc-types-eth.workspace = true
42-
alloy-rpc-types.workspace = true
4343
alloy-rpc-types-mev.workspace = true
4444
alloy-consensus.workspace = true
4545

crates/rpc/rpc-eth-api/src/core.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ use alloy_dyn_abi::TypedData;
44
use alloy_eips::{eip2930::AccessListResult, BlockId, BlockNumberOrTag};
55
use alloy_json_rpc::RpcObject;
66
use alloy_primitives::{Address, Bytes, B256, B64, U256, U64};
7-
use alloy_rpc_types::{
8-
serde_helpers::JsonStorageKey,
7+
use alloy_rpc_types_eth::{
98
simulate::{SimulatePayload, SimulatedBlock},
109
state::{EvmOverrides, StateOverride},
10+
transaction::TransactionRequest,
1111
BlockOverrides, Bundle, EIP1186AccountProofResponse, EthCallResponse, FeeHistory, Header,
1212
Index, StateContext, SyncStatus, Work,
1313
};
14-
use alloy_rpc_types_eth::transaction::TransactionRequest;
14+
use alloy_serde::JsonStorageKey;
1515
use jsonrpsee::{core::RpcResult, proc_macros::rpc};
1616
use reth_rpc_server_types::{result::internal_rpc_err, ToRpcResult};
1717
use tracing::trace;
@@ -276,7 +276,7 @@ pub trait EthApi<T: RpcObject, B: RpcObject, R: RpcObject> {
276276
&self,
277277
address: Address,
278278
block: BlockId,
279-
) -> RpcResult<Option<alloy_rpc_types::Account>>;
279+
) -> RpcResult<Option<alloy_rpc_types_eth::Account>>;
280280

281281
/// Introduced in EIP-1559, returns suggestion for the priority for dynamic fee transactions.
282282
#[method(name = "maxPriorityFeePerGas")]
@@ -694,7 +694,7 @@ where
694694
&self,
695695
address: Address,
696696
block: BlockId,
697-
) -> RpcResult<Option<alloy_rpc_types::Account>> {
697+
) -> RpcResult<Option<alloy_rpc_types_eth::Account>> {
698698
trace!(target: "rpc::eth", "Serving eth_getAccount");
699699
Ok(EthState::get_account(self, address, block).await?)
700700
}

crates/rpc/rpc-eth-api/src/filter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! `eth_` RPC API for filtering.
22
33
use alloy_json_rpc::RpcObject;
4-
use alloy_rpc_types::{Filter, FilterChanges, FilterId, Log, PendingTransactionFilterKind};
4+
use alloy_rpc_types_eth::{Filter, FilterChanges, FilterId, Log, PendingTransactionFilterKind};
55
use jsonrpsee::{core::RpcResult, proc_macros::rpc};
66

77
/// Rpc Interface for poll-based ethereum filter API.

crates/rpc/rpc-eth-api/src/helpers/block.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use std::sync::Arc;
44

55
use alloy_eips::BlockId;
6-
use alloy_rpc_types::{Block, Header, Index};
6+
use alloy_rpc_types_eth::{Block, Header, Index};
77
use futures::Future;
88
use reth_primitives::{Receipt, SealedBlock, SealedBlockWithSenders};
99
use reth_provider::{BlockIdReader, BlockReader, BlockReaderIdExt, HeaderProvider};

crates/rpc/rpc-eth-api/src/helpers/call.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ use crate::{
88
use alloy_consensus::BlockHeader;
99
use alloy_eips::{eip1559::calc_next_block_base_fee, eip2930::AccessListResult};
1010
use alloy_primitives::{Address, Bytes, TxKind, B256, U256};
11-
use alloy_rpc_types::{
11+
use alloy_rpc_types_eth::{
1212
simulate::{SimBlock, SimulatePayload, SimulatedBlock},
1313
state::{EvmOverrides, StateOverride},
14+
transaction::TransactionRequest,
1415
BlockId, Bundle, EthCallResponse, StateContext, TransactionInfo,
1516
};
16-
use alloy_rpc_types_eth::transaction::TransactionRequest;
1717
use futures::Future;
1818
use reth_chainspec::{EthChainSpec, MIN_TRANSACTION_GAS};
1919
use reth_evm::{ConfigureEvm, ConfigureEvmEnv};

0 commit comments

Comments
 (0)