Skip to content

Commit

Permalink
rpc: rm useless alloy_rpc_types reexport (#11098)
Browse files Browse the repository at this point in the history
Co-authored-by: Emilia Hane <[email protected]>
  • Loading branch information
tcoratger and emhane authored Sep 22, 2024
1 parent 63dfa9a commit 159bf2c
Show file tree
Hide file tree
Showing 70 changed files with 133 additions and 115 deletions.
12 changes: 10 additions & 2 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions crates/consensus/debug-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,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

auto_impl.workspace = true
futures.workspace = true
Expand Down
3 changes: 2 additions & 1 deletion crates/consensus/debug-client/src/client.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
use alloy_consensus::TxEnvelope;
use alloy_eips::eip2718::Encodable2718;
use alloy_rpc_types::{Block, BlockTransactions};
use reth_node_api::EngineTypes;
use reth_node_core::{
primitives::B256,
rpc::types::{Block, BlockTransactions, ExecutionPayloadV2, ExecutionPayloadV3},
rpc::types::{ExecutionPayloadV2, ExecutionPayloadV3},
};
use reth_rpc_builder::auth::AuthServerHandle;
use reth_rpc_types::ExecutionPayloadV1;
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,7 +1,7 @@
use crate::BlockProvider;
use alloy_eips::BlockNumberOrTag;
use alloy_rpc_types::Block;
use reqwest::Client;
use reth_node_core::rpc::types::Block;
use reth_tracing::tracing::warn;
use serde::Deserialize;
use std::time::Duration;
Expand Down
3 changes: 1 addition & 2 deletions crates/consensus/debug-client/src/providers/rpc.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
use crate::BlockProvider;
use alloy_eips::BlockNumberOrTag;
use alloy_provider::{Provider, ProviderBuilder};
use alloy_rpc_types::{Block, BlockTransactionsKind};
use futures::StreamExt;
use reth_node_core::rpc::types::Block;
use reth_rpc_types::BlockTransactionsKind;
use tokio::sync::mpsc::Sender;

/// Block provider that fetches new blocks from an RPC endpoint using a websocket connection.
Expand Down
2 changes: 1 addition & 1 deletion crates/optimism/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ reth-provider.workspace = true
reth-rpc-eth-api.workspace = true
reth-rpc-eth-types.workspace = true
reth-rpc-server-types.workspace = true
reth-rpc-types.workspace = true
reth-tasks = { workspace = true, features = ["rayon"] }
reth-transaction-pool.workspace = true
reth-rpc.workspace = true
Expand All @@ -35,6 +34,7 @@ reth-optimism-forks.workspace = true
# ethereum
alloy-primitives.workspace = true
alloy-rpc-types-eth.workspace = true
alloy-rpc-types.workspace = true
op-alloy-network.workspace = true
op-alloy-rpc-types.workspace = true
op-alloy-consensus.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,12 +1,12 @@
//! RPC errors specific to OP.
use alloy_rpc_types::error::EthRpcErrorCode;
use jsonrpsee_types::error::INTERNAL_ERROR_CODE;
use reth_evm_optimism::OptimismBlockExecutionError;
use reth_primitives::revm_primitives::{InvalidTransaction, OptimismInvalidTransaction};
use reth_rpc_eth_api::AsEthApiError;
use reth_rpc_eth_types::EthApiError;
use reth_rpc_server_types::result::{internal_rpc_err, rpc_err};
use reth_rpc_types::error::EthRpcErrorCode;

/// Optimism specific errors, that extend [`EthApiError`].
#[derive(Debug, thiserror::Error)]
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,5 +1,6 @@
//! Loads and formats OP block RPC response.
use alloy_rpc_types::BlockId;
use op_alloy_network::Network;
use op_alloy_rpc_types::OpTransactionReceipt;
use reth_chainspec::{ChainSpec, ChainSpecProvider};
Expand All @@ -11,7 +12,6 @@ use reth_rpc_eth_api::{
RpcReceipt,
};
use reth_rpc_eth_types::EthStateCache;
use reth_rpc_types::BlockId;

use crate::{OpEthApi, OpEthApiError, OpReceiptBuilder};

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,5 +1,6 @@
//! Loads and formats OP receipt RPC response.
use alloy_rpc_types::{AnyReceiptEnvelope, Log, TransactionReceipt};
use op_alloy_consensus::{OpDepositReceipt, OpDepositReceiptWithBloom, OpReceiptEnvelope};
use op_alloy_rpc_types::{
receipt::L1BlockInfo, OpTransactionReceipt, OptimismTransactionReceiptFields,
Expand All @@ -12,7 +13,6 @@ use reth_primitives::{Receipt, TransactionMeta, TransactionSigned, TxType};
use reth_provider::ChainSpecProvider;
use reth_rpc_eth_api::{helpers::LoadReceipt, FromEthApiError, RpcReceipt};
use reth_rpc_eth_types::{EthApiError, EthStateCache, ReceiptBuilder};
use reth_rpc_types::{AnyReceiptEnvelope, Log, TransactionReceipt};

use crate::{OpEthApi, OpEthApiError};

Expand Down
2 changes: 1 addition & 1 deletion crates/optimism/rpc/src/eth/transaction.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! Loads and formats OP transaction RPC response.
use alloy_primitives::{Bytes, B256};
use alloy_rpc_types::TransactionInfo;
use op_alloy_rpc_types::Transaction;
use reth_node_api::FullNodeComponents;
use reth_primitives::TransactionSignedEcRecovered;
Expand All @@ -11,7 +12,6 @@ use reth_rpc_eth_api::{
FromEthApiError, FullEthApiTypes, TransactionCompat,
};
use reth_rpc_eth_types::{utils::recover_raw_transaction, EthStateCache};
use reth_rpc_types::TransactionInfo;
use reth_transaction_pool::{PoolTransaction, TransactionOrigin, TransactionPool};

use crate::{OpEthApi, SequencerClient};
Expand Down
1 change: 1 addition & 0 deletions crates/rpc/rpc-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ alloy-eips.workspace = true
alloy-json-rpc.workspace = true
alloy-primitives.workspace = true
alloy-rpc-types-eth.workspace = true
alloy-rpc-types.workspace = true
alloy-rpc-types-debug.workspace = true
alloy-rpc-types-trace.workspace = true
alloy-rpc-types-anvil.workspace = true
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 reth_rpc_types::Block;

/// Anvil rpc interface.
/// https://book.getfoundry.sh/reference/anvil/#custom-methods
Expand Down
2 changes: 1 addition & 1 deletion crates/rpc/rpc-api/src/debug.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
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_trace::geth::{
BlockTraceResult, GethDebugTracingCallOptions, GethDebugTracingOptions, GethTrace, TraceResult,
};
use jsonrpsee::{core::RpcResult, proc_macros::rpc};
use reth_primitives::{BlockId, BlockNumberOrTag};
use reth_rpc_types::{Block, Bundle, StateContext};

/// Debug rpc interface.
#[cfg_attr(not(feature = "client"), rpc(server, namespace = "debug"))]
Expand Down
6 changes: 4 additions & 2 deletions crates/rpc/rpc-api/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
use alloy_eips::{eip4844::BlobAndProofV1, 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_eth::transaction::TransactionRequest;
use jsonrpsee::{core::RpcResult, proc_macros::rpc};
use reth_engine_primitives::EngineTypes;
Expand All @@ -15,8 +18,7 @@ use reth_rpc_types::{
ExecutionPayloadInputV2, ExecutionPayloadV1, ExecutionPayloadV3, ExecutionPayloadV4,
ForkchoiceState, ForkchoiceUpdated, PayloadId, PayloadStatus, TransitionConfiguration,
},
state::StateOverride,
BlockOverrides, EIP1186AccountProofResponse, Filter, JsonStorageKey, Log, SyncStatus,
JsonStorageKey,
};
// NOTE: We can't use associated types in the `EngineApi` trait because of jsonrpsee, so we use a
// generic here. It would be nice if the rpc macro would understand which types need to have serde.
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,12 +1,12 @@
use alloy_json_rpc::RpcObject;
use alloy_primitives::{Address, Bytes, TxHash, B256};
use alloy_rpc_types::Header;
use alloy_rpc_types_trace::otterscan::{
BlockDetails, ContractCreator, InternalOperation, OtsBlockTransactions, TraceEntry,
TransactionsWithReceipts,
};
use jsonrpsee::{core::RpcResult, proc_macros::rpc};
use reth_primitives::BlockId;
use reth_rpc_types::Header;

/// Otterscan rpc interface.
#[cfg_attr(not(feature = "client"), rpc(server, namespace = "ots"))]
Expand Down
2 changes: 1 addition & 1 deletion crates/rpc/rpc-api/src/rpc.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use alloy_rpc_types::RpcModules;
use jsonrpsee::{core::RpcResult, proc_macros::rpc};
use reth_rpc_types::RpcModules;

/// RPC namespace, used to find the versions of all rpc modules
#[cfg_attr(not(feature = "client"), rpc(server, namespace = "rpc"))]
Expand Down
2 changes: 1 addition & 1 deletion crates/rpc/rpc-api/src/trace.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use alloy_primitives::{Bytes, B256};
use alloy_rpc_types::{state::StateOverride, BlockOverrides, Index};
use alloy_rpc_types_eth::transaction::TransactionRequest;
use alloy_rpc_types_trace::{
filter::TraceFilter,
Expand All @@ -7,7 +8,6 @@ use alloy_rpc_types_trace::{
};
use jsonrpsee::{core::RpcResult, proc_macros::rpc};
use reth_primitives::BlockId;
use reth_rpc_types::{state::StateOverride, BlockOverrides, Index};
use std::collections::HashSet;

/// Ethereum trace API
Expand Down
1 change: 1 addition & 0 deletions crates/rpc/rpc-builder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ reth-primitives.workspace = true

# ethereum
alloy-network.workspace = true
alloy-rpc-types.workspace = true

# rpc/net
jsonrpsee = { workspace = true, features = ["server"] }
Expand Down
2 changes: 1 addition & 1 deletion crates/rpc/rpc-builder/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ where
+ EthTransactions<
NetworkTypes: alloy_network::Network<
TransactionResponse = reth_rpc_types::WithOtherFields<
reth_rpc_types::Transaction,
alloy_rpc_types::Transaction,
>,
>,
>,
Expand Down
8 changes: 4 additions & 4 deletions crates/rpc/rpc-builder/tests/it/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
use crate::utils::{launch_http, launch_http_ws, launch_ws};
use alloy_primitives::{hex_literal::hex, Address, Bytes, TxHash, B256, B64, U256, U64};
use alloy_rpc_types::{
Block, FeeHistory, Filter, Index, Log, PendingTransactionFilterKind, SyncStatus, Transaction,
TransactionReceipt,
};
use alloy_rpc_types_eth::transaction::TransactionRequest;
use alloy_rpc_types_trace::filter::TraceFilter;
use jsonrpsee::{
Expand All @@ -22,10 +26,6 @@ use reth_rpc_api::{
Web3ApiClient,
};
use reth_rpc_server_types::RethRpcModule;
use reth_rpc_types::{
Block, FeeHistory, Filter, Index, Log, PendingTransactionFilterKind, SyncStatus, Transaction,
TransactionReceipt,
};
use serde::{de::DeserializeOwned, Deserialize, Serialize};
use serde_json::Value;
use std::collections::HashSet;
Expand Down
2 changes: 1 addition & 1 deletion crates/rpc/rpc-builder/tests/it/middleware.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::utils::{test_address, test_rpc_builder};
use alloy_rpc_types::{Block, Receipt, Transaction};
use jsonrpsee::{
server::{middleware::rpc::RpcServiceT, RpcServiceBuilder},
types::Request,
Expand All @@ -8,7 +9,6 @@ use reth_rpc::EthApi;
use reth_rpc_builder::{RpcServerConfig, TransportRpcModuleConfig};
use reth_rpc_eth_api::EthApiClient;
use reth_rpc_server_types::RpcModuleSelection;
use reth_rpc_types::{Block, Receipt, Transaction};
use std::{
future::Future,
pin::Pin,
Expand Down
1 change: 1 addition & 0 deletions crates/rpc/rpc-eth-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ 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

# rpc
Expand Down
Loading

0 comments on commit 159bf2c

Please sign in to comment.