Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: phase out alloy-rpc-types usage #12395

Merged
merged 7 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 14 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/consensus/debug-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ reth-tracing.workspace = true
alloy-consensus = { workspace = true, features = ["serde"] }
alloy-eips.workspace = true
alloy-provider = { workspace = true, features = ["ws"] }
alloy-rpc-types.workspace = true
alloy-rpc-types-eth.workspace = true
alloy-rpc-types-engine.workspace = true
alloy-primitives.workspace = true

Expand Down
2 changes: 1 addition & 1 deletion crates/consensus/debug-client/src/client.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use alloy_consensus::Transaction;
use alloy_eips::eip2718::Encodable2718;
use alloy_primitives::B256;
use alloy_rpc_types::{Block, BlockTransactions};
use alloy_rpc_types_engine::{ExecutionPayloadV1, ExecutionPayloadV2, ExecutionPayloadV3};
use alloy_rpc_types_eth::{Block, BlockTransactions};
use reth_node_api::EngineTypes;
use reth_rpc_builder::auth::AuthServerHandle;
use reth_tracing::tracing::warn;
Expand Down
2 changes: 1 addition & 1 deletion crates/consensus/debug-client/src/providers/etherscan.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::BlockProvider;
use alloy_eips::BlockNumberOrTag;
use alloy_rpc_types::Block;
use alloy_rpc_types_eth::Block;
use reqwest::Client;
use reth_tracing::tracing::warn;
use serde::Deserialize;
Expand Down
2 changes: 1 addition & 1 deletion crates/consensus/debug-client/src/providers/rpc.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::BlockProvider;
use alloy_eips::BlockNumberOrTag;
use alloy_provider::{Provider, ProviderBuilder};
use alloy_rpc_types::{Block, BlockTransactionsKind};
use alloy_rpc_types_eth::{Block, BlockTransactionsKind};
use futures::StreamExt;
use tokio::sync::mpsc::Sender;

Expand Down
3 changes: 2 additions & 1 deletion crates/e2e-test-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ tokio-stream.workspace = true
serde_json.workspace = true
alloy-signer.workspace = true
alloy-signer-local = { workspace = true, features = ["mnemonic"] }
alloy-rpc-types.workspace = true
alloy-rpc-types-eth.workspace = true
alloy-rpc-types-engine.workspace = true
alloy-network.workspace = true
alloy-consensus = { workspace = true, features = ["kzg"] }
tracing.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/e2e-test-utils/src/node.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::{marker::PhantomData, pin::Pin};

use alloy_primitives::{BlockHash, BlockNumber, Bytes, B256};
use alloy_rpc_types::BlockNumberOrTag;
use alloy_rpc_types_eth::BlockNumberOrTag;
use eyre::Ok;
use futures_util::Future;
use reth::{
Expand Down
2 changes: 1 addition & 1 deletion crates/e2e-test-utils/src/traits.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use alloy_rpc_types::engine::ExecutionPayloadEnvelopeV4;
use alloy_rpc_types_engine::ExecutionPayloadEnvelopeV4;
use op_alloy_rpc_types_engine::{OpExecutionPayloadEnvelopeV3, OpExecutionPayloadEnvelopeV4};
use reth::rpc::types::engine::{ExecutionPayloadEnvelopeV3, ExecutionPayloadV3};

Expand Down
2 changes: 1 addition & 1 deletion crates/e2e-test-utils/src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use alloy_network::{
eip2718::Encodable2718, Ethereum, EthereumWallet, TransactionBuilder, TransactionBuilder4844,
};
use alloy_primitives::{hex, Address, Bytes, TxKind, B256, U256};
use alloy_rpc_types::{Authorization, TransactionInput, TransactionRequest};
use alloy_rpc_types_eth::{Authorization, TransactionInput, TransactionRequest};
use alloy_signer::SignerSync;
use alloy_signer_local::PrivateKeySigner;
use eyre::Ok;
Expand Down
1 change: 0 additions & 1 deletion crates/optimism/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ reth-optimism-forks.workspace = true
alloy-eips.workspace = true
alloy-primitives.workspace = true
alloy-rpc-types-eth.workspace = true
alloy-rpc-types.workspace = true
alloy-consensus.workspace = true
op-alloy-network.workspace = true
op-alloy-rpc-types.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/optimism/rpc/src/error.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! RPC errors specific to OP.

use alloy_rpc_types::error::EthRpcErrorCode;
use alloy_rpc_types_eth::error::EthRpcErrorCode;
use jsonrpsee_types::error::INTERNAL_ERROR_CODE;
use reth_optimism_evm::OpBlockExecutionError;
use reth_primitives::revm_primitives::{InvalidTransaction, OptimismInvalidTransaction};
Expand Down
2 changes: 1 addition & 1 deletion crates/optimism/rpc/src/eth/block.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Loads and formats OP block RPC response.

use alloy_rpc_types::BlockId;
use alloy_rpc_types_eth::BlockId;
use op_alloy_network::Network;
use op_alloy_rpc_types::OpTransactionReceipt;
use reth_chainspec::ChainSpecProvider;
Expand Down
2 changes: 1 addition & 1 deletion crates/optimism/rpc/src/eth/receipt.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Loads and formats OP receipt RPC response.

use alloy_eips::eip2718::Encodable2718;
use alloy_rpc_types::{Log, TransactionReceipt};
use alloy_rpc_types_eth::{Log, TransactionReceipt};
use op_alloy_consensus::{
DepositTransaction, OpDepositReceipt, OpDepositReceiptWithBloom, OpReceiptEnvelope,
};
Expand Down
4 changes: 2 additions & 2 deletions crates/optimism/rpc/src/eth/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use alloy_consensus::{Signed, Transaction as _};
use alloy_primitives::{Bytes, B256};
use alloy_rpc_types::TransactionInfo;
use alloy_rpc_types_eth::TransactionInfo;
use op_alloy_consensus::OpTxEnvelope;
use op_alloy_rpc_types::Transaction;
use reth_node_api::FullNodeComponents;
Expand Down Expand Up @@ -121,7 +121,7 @@ where
.unwrap_or_else(|| inner.max_fee_per_gas());

Transaction {
inner: alloy_rpc_types::Transaction {
inner: alloy_rpc_types_eth::Transaction {
inner,
block_hash,
block_number,
Expand Down
2 changes: 1 addition & 1 deletion crates/rpc/rpc-api/src/anvil.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use jsonrpsee::{core::RpcResult, proc_macros::rpc};

use alloy_primitives::{Address, Bytes, B256, U256};
use alloy_rpc_types::Block;
use alloy_rpc_types_anvil::{Forking, Metadata, MineOptions, NodeInfo};
use alloy_rpc_types_eth::Block;

/// Anvil rpc interface.
/// https://book.getfoundry.sh/reference/anvil/#custom-methods
Expand Down
3 changes: 1 addition & 2 deletions crates/rpc/rpc-api/src/debug.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use alloy_eips::{BlockId, BlockNumberOrTag};
use alloy_primitives::{Address, Bytes, B256};
use alloy_rpc_types::{Block, Bundle, StateContext};
use alloy_rpc_types_debug::ExecutionWitness;
use alloy_rpc_types_eth::transaction::TransactionRequest;
use alloy_rpc_types_eth::{transaction::TransactionRequest, Block, Bundle, StateContext};
use alloy_rpc_types_trace::geth::{
BlockTraceResult, GethDebugTracingCallOptions, GethDebugTracingOptions, GethTrace, TraceResult,
};
Expand Down
8 changes: 4 additions & 4 deletions crates/rpc/rpc-api/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
use alloy_eips::{eip4844::BlobAndProofV1, eip7685::Requests, BlockId, BlockNumberOrTag};
use alloy_json_rpc::RpcObject;
use alloy_primitives::{Address, BlockHash, Bytes, B256, U256, U64};
use alloy_rpc_types::{
state::StateOverride, BlockOverrides, EIP1186AccountProofResponse, Filter, Log, SyncStatus,
};
use alloy_rpc_types_engine::{
ClientVersionV1, ExecutionPayloadBodiesV1, ExecutionPayloadInputV2, ExecutionPayloadV1,
ExecutionPayloadV3, ForkchoiceState, ForkchoiceUpdated, PayloadId, PayloadStatus,
TransitionConfiguration,
};
use alloy_rpc_types_eth::transaction::TransactionRequest;
use alloy_rpc_types_eth::{
state::StateOverride, transaction::TransactionRequest, BlockOverrides,
EIP1186AccountProofResponse, Filter, Log, SyncStatus,
};
use alloy_serde::JsonStorageKey;
use jsonrpsee::{core::RpcResult, proc_macros::rpc};
use reth_engine_primitives::EngineTypes;
Expand Down
2 changes: 1 addition & 1 deletion crates/rpc/rpc-api/src/otterscan.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use alloy_eips::BlockId;
use alloy_json_rpc::RpcObject;
use alloy_primitives::{Address, Bytes, TxHash, B256};
use alloy_rpc_types::Header;
use alloy_rpc_types_eth::Header;
use alloy_rpc_types_trace::otterscan::{
BlockDetails, ContractCreator, InternalOperation, OtsBlockTransactions, TraceEntry,
TransactionsWithReceipts,
Expand Down
5 changes: 3 additions & 2 deletions crates/rpc/rpc-api/src/trace.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use alloy_eips::BlockId;
use alloy_primitives::{map::HashSet, Bytes, B256};
use alloy_rpc_types::{state::StateOverride, BlockOverrides, Index};
use alloy_rpc_types_eth::transaction::TransactionRequest;
use alloy_rpc_types_eth::{
state::StateOverride, transaction::TransactionRequest, BlockOverrides, Index,
};
use alloy_rpc_types_trace::{
filter::TraceFilter,
opcode::{BlockOpcodeGas, TransactionOpcodeGas},
Expand Down
2 changes: 1 addition & 1 deletion crates/rpc/rpc-eth-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ reth-trie.workspace = true
reth-node-api.workspace = true

# ethereum
alloy-serde.workspace = true
alloy-eips.workspace = true
alloy-dyn-abi = { workspace = true, features = ["eip712"] }
alloy-json-rpc.workspace = true
alloy-network.workspace = true
alloy-primitives.workspace = true
alloy-rpc-types-eth.workspace = true
alloy-rpc-types.workspace = true
alloy-rpc-types-mev.workspace = true
alloy-consensus.workspace = true

Expand Down
10 changes: 5 additions & 5 deletions crates/rpc/rpc-eth-api/src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ use alloy_dyn_abi::TypedData;
use alloy_eips::{eip2930::AccessListResult, BlockId, BlockNumberOrTag};
use alloy_json_rpc::RpcObject;
use alloy_primitives::{Address, Bytes, B256, B64, U256, U64};
use alloy_rpc_types::{
serde_helpers::JsonStorageKey,
use alloy_rpc_types_eth::{
simulate::{SimulatePayload, SimulatedBlock},
state::{EvmOverrides, StateOverride},
transaction::TransactionRequest,
BlockOverrides, Bundle, EIP1186AccountProofResponse, EthCallResponse, FeeHistory, Header,
Index, StateContext, SyncStatus, Work,
};
use alloy_rpc_types_eth::transaction::TransactionRequest;
use alloy_serde::JsonStorageKey;
use jsonrpsee::{core::RpcResult, proc_macros::rpc};
use reth_rpc_server_types::{result::internal_rpc_err, ToRpcResult};
use tracing::trace;
Expand Down Expand Up @@ -276,7 +276,7 @@ pub trait EthApi<T: RpcObject, B: RpcObject, R: RpcObject> {
&self,
address: Address,
block: BlockId,
) -> RpcResult<Option<alloy_rpc_types::Account>>;
) -> RpcResult<Option<alloy_rpc_types_eth::Account>>;

/// Introduced in EIP-1559, returns suggestion for the priority for dynamic fee transactions.
#[method(name = "maxPriorityFeePerGas")]
Expand Down Expand Up @@ -694,7 +694,7 @@ where
&self,
address: Address,
block: BlockId,
) -> RpcResult<Option<alloy_rpc_types::Account>> {
) -> RpcResult<Option<alloy_rpc_types_eth::Account>> {
trace!(target: "rpc::eth", "Serving eth_getAccount");
Ok(EthState::get_account(self, address, block).await?)
}
Expand Down
2 changes: 1 addition & 1 deletion crates/rpc/rpc-eth-api/src/filter.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! `eth_` RPC API for filtering.

use alloy_json_rpc::RpcObject;
use alloy_rpc_types::{Filter, FilterChanges, FilterId, Log, PendingTransactionFilterKind};
use alloy_rpc_types_eth::{Filter, FilterChanges, FilterId, Log, PendingTransactionFilterKind};
use jsonrpsee::{core::RpcResult, proc_macros::rpc};

/// Rpc Interface for poll-based ethereum filter API.
Expand Down
2 changes: 1 addition & 1 deletion crates/rpc/rpc-eth-api/src/helpers/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use std::sync::Arc;

use alloy_eips::BlockId;
use alloy_rpc_types::{Block, Header, Index};
use alloy_rpc_types_eth::{Block, Header, Index};
use futures::Future;
use reth_primitives::{Receipt, SealedBlock, SealedBlockWithSenders};
use reth_provider::{BlockIdReader, BlockReader, BlockReaderIdExt, HeaderProvider};
Expand Down
4 changes: 2 additions & 2 deletions crates/rpc/rpc-eth-api/src/helpers/call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ use crate::{
use alloy_consensus::BlockHeader;
use alloy_eips::{eip1559::calc_next_block_base_fee, eip2930::AccessListResult};
use alloy_primitives::{Address, Bytes, TxKind, B256, U256};
use alloy_rpc_types::{
use alloy_rpc_types_eth::{
simulate::{SimBlock, SimulatePayload, SimulatedBlock},
state::{EvmOverrides, StateOverride},
transaction::TransactionRequest,
BlockId, Bundle, EthCallResponse, StateContext, TransactionInfo,
};
use alloy_rpc_types_eth::transaction::TransactionRequest;
use futures::Future;
use reth_chainspec::{EthChainSpec, MIN_TRANSACTION_GAS};
use reth_evm::{ConfigureEvm, ConfigureEvmEnv};
Expand Down
Loading
Loading