Skip to content
Closed
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
69 changes: 48 additions & 21 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ members = [
"crates/rpc/rpc-api/",
"crates/rpc/rpc-builder/",
"crates/rpc/rpc-engine-api/",
"crates/rpc/rpc-eth-api/",
"crates/rpc/rpc-layer",
"crates/rpc/rpc-testing-util/",
"crates/rpc/rpc-types-compat/",
Expand Down Expand Up @@ -317,6 +318,7 @@ reth-rpc-api = { path = "crates/rpc/rpc-api" }
reth-rpc-api-testing-util = { path = "crates/rpc/rpc-testing-util" }
reth-rpc-builder = { path = "crates/rpc/rpc-builder" }
reth-rpc-engine-api = { path = "crates/rpc/rpc-engine-api" }
reth-rpc-eth-api = { path = "crates/rpc/rpc-eth-api" }
reth-rpc-layer = { path = "crates/rpc/rpc-layer" }
reth-rpc-server-types = { path = "crates/rpc/rpc-server-types" }
reth-rpc-types = { path = "crates/rpc/rpc-types" }
Expand Down
2 changes: 1 addition & 1 deletion crates/e2e-test-utils/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use alloy_consensus::TxEnvelope;
use alloy_network::eip2718::Decodable2718;
use reth::{api::FullNodeComponents, builder::rpc::RpcRegistry, rpc::api::DebugApiServer};
use reth_primitives::{Bytes, B256};
use reth_rpc::eth::{api::EthTransactions, error::EthResult};
use reth_rpc::eth::{servers::EthTransactions, EthResult};

pub struct RpcTestContext<Node: FullNodeComponents> {
pub inner: RpcRegistry<Node>,
Expand Down
2 changes: 1 addition & 1 deletion crates/ethereum/node/tests/e2e/dev.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::utils::EthNode;
use futures::StreamExt;
use reth::rpc::eth::api::EthTransactions;
use reth::rpc::eth::servers::EthTransactions;
use reth_e2e_test_utils::setup;
use reth_primitives::{b256, hex, ChainSpec, Genesis};
use reth_provider::CanonStateSubscriptions;
Expand Down
4 changes: 2 additions & 2 deletions crates/node-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ reth-storage-errors.workspace = true
reth-provider.workspace = true
reth-network = { workspace = true, features = ["serde"] }
reth-network-p2p.workspace = true
reth-rpc.workspace = true
reth-rpc-server-types.workspace = true
reth-rpc-types.workspace = true
reth-rpc-types-compat.workspace = true
reth-rpc-api = { workspace = true, features = ["client"] }
reth-rpc-eth-api = { workspace = true, features = ["client"] }
reth-transaction-pool.workspace = true
reth-tracing.workspace = true
reth-config.workspace = true
Expand Down Expand Up @@ -101,10 +101,10 @@ reth-network-peers.workspace = true
[features]
optimism = [
"reth-primitives/optimism",
"reth-rpc/optimism",
"reth-provider/optimism",
"reth-rpc-types-compat/optimism",
"reth-beacon-consensus/optimism",
"reth-rpc-eth-api/optimism",
]

jemalloc = ["dep:tikv-jemalloc-ctl"]
Expand Down
2 changes: 1 addition & 1 deletion crates/node-core/src/args/gas_price_oracle.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::primitives::U256;
use clap::Args;
use reth_rpc::eth::gas_oracle::GasPriceOracleConfig;
use reth_rpc_eth_api::GasPriceOracleConfig;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to avoid these changes, instead this should be re-exported from reth-rpc

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eth is the only reth-rpc module used in reth-node-core builder, hence why I went with updating the dep here

use reth_rpc_server_types::constants::gas_oracle::{
DEFAULT_GAS_PRICE_BLOCKS, DEFAULT_GAS_PRICE_PERCENTILE, DEFAULT_IGNORE_GAS_PRICE,
DEFAULT_MAX_GAS_PRICE,
Expand Down
2 changes: 1 addition & 1 deletion crates/node-core/src/args/rpc_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use clap::{
Arg, Args, Command,
};
use rand::Rng;
use reth_rpc::eth::RPC_DEFAULT_GAS_CAP;
use reth_rpc_eth_api::RPC_DEFAULT_GAS_CAP;

use reth_rpc_server_types::{constants, RethRpcModule, RpcModuleSelection};
use std::{
Expand Down
4 changes: 2 additions & 2 deletions crates/node-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ pub mod rpc {
}
/// Re-exported from `reth_rpc::eth`.
pub mod eth {
pub use reth_rpc::eth::*;
pub use reth_rpc_eth_api::*;
}

/// Re-exported from `reth_rpc::rpc`.
pub mod result {
pub use reth_rpc::result::*;
pub use reth_rpc_eth_api::result::*;
}

/// Re-exported from `reth_rpc::eth`.
Expand Down
5 changes: 3 additions & 2 deletions crates/node/builder/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,9 @@ impl<Node: FullNodeComponents> Clone for RpcRegistry<Node> {
/// [`AuthRpcModule`].
///
/// This can be used to access installed modules, or create commonly used handlers like
/// [`reth_rpc::EthApi`], and ultimately merge additional rpc handler into the configured transport
/// modules [`TransportRpcModules`] as well as configured authenticated methods [`AuthRpcModule`].
/// [`reth_rpc::eth::EthApi`], and ultimately merge additional rpc handler into the configured
/// transport modules [`TransportRpcModules`] as well as configured authenticated methods
/// [`AuthRpcModule`].
#[allow(missing_debug_implementations)]
pub struct RpcContext<'a, Node: FullNodeComponents> {
/// The node components.
Expand Down
2 changes: 1 addition & 1 deletion crates/optimism/node/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
use jsonrpsee::types::ErrorObject;
use reqwest::Client;
use reth_rpc::eth::{
api::RawTransactionForwarder,
error::{EthApiError, EthResult},
servers::RawTransactionForwarder,
};
use reth_rpc_types::ToRpcError;
use std::sync::{atomic::AtomicUsize, Arc};
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 @@ -18,7 +18,7 @@ reth-evm-optimism = { workspace = true, features = ["optimism"] }
revm = { workspace = true, features = ["optimism"] }
reth-network-api.workspace = true
reth-rpc = { workspace = true, features = ["optimism"] }
reth-rpc-api.workspace = true
reth-rpc-eth-api = { workspace = true, features = ["optimism"] }
reth-rpc-types.workspace = true
reth-primitives = { workspace = true, features = ["optimism"] }
reth-provider = { workspace = true, features = ["optimism"] }
Expand Down
3 changes: 2 additions & 1 deletion crates/optimism/rpc/src/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
use reth_primitives::TransactionMeta;
use reth_provider::{BlockReaderIdExt, ChainSpecProvider, HeaderProvider};
use reth_rpc::eth::{
api::{EthBlocks, LoadBlock, LoadReceipt, ReceiptBuilder},
error::EthResult,
servers::{EthBlocks, LoadBlock, LoadReceipt},
ReceiptBuilder,
};
use reth_rpc_types::{AnyTransactionReceipt, BlockId};

Expand Down
8 changes: 4 additions & 4 deletions crates/optimism/rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

use std::sync::Arc;

use reth_rpc::{
call_impl, eth::api::EthApiInner, eth_call_impl, eth_fees_impl, eth_state_impl,
eth_transactions_impl, load_block_impl, load_fee_impl, load_state_impl, load_transaction_impl,
use reth_rpc_eth_api::{
call_impl, eth_call_impl, eth_fees_impl, eth_state_impl, eth_transactions_impl,
load_block_impl, load_fee_impl, load_state_impl, load_transaction_impl, servers::EthApiInner,
spawn_blocking_impl, trace_impl,
};

Expand All @@ -26,7 +26,7 @@ pub mod transaction;
/// `Eth` API implementation for OP networks.
///
/// This type provides OP specific extension of default functionality for handling `eth_` related
/// requests. See [`EthApi`](reth_rpc::EthApi) for the default L1 implementation.
/// requests. See [`EthApi`](reth_rpc_eth_api::EthApi) for the default L1 implementation.
#[allow(missing_debug_implementations)]
#[allow(dead_code)]
#[derive(Clone)]
Expand Down
2 changes: 1 addition & 1 deletion crates/optimism/rpc/src/pending_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use reth_provider::{
BlockReaderIdExt, ChainSpecProvider, EvmEnvProvider, ExecutionOutcome, StateProviderFactory,
};
use reth_rpc::eth::{
api::{LoadPendingBlock, SpawnBlocking},
servers::{LoadPendingBlock, SpawnBlocking},
PendingBlock,
};
use reth_transaction_pool::TransactionPool;
Expand Down
3 changes: 2 additions & 1 deletion crates/optimism/rpc/src/receipt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ use crate::{transaction::OptimismTxMeta, OptimismApi};
use reth_primitives::{Receipt, TransactionMeta, TransactionSigned};
use reth_provider::{BlockIdReader, ChainSpecProvider};
use reth_rpc::eth::{
api::{LoadReceipt, ReceiptBuilder},
cache::EthStateCache,
error::{EthApiError, EthResult},
servers::LoadReceipt,
ReceiptBuilder,
};
use reth_rpc_types::{AnyTransactionReceipt, OptimismTransactionReceiptFields};

Expand Down
9 changes: 7 additions & 2 deletions crates/rpc/rpc-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,21 @@ workspace = true
# reth
reth-primitives.workspace = true
reth-rpc-types.workspace = true
reth-rpc-eth-api.workspace = true
reth-engine-primitives.workspace = true
reth-network-peers.workspace = true

# misc
alloy-dyn-abi = { workspace = true, features = ["eip712"] }
jsonrpsee = { workspace = true, features = ["server", "macros"] }
serde = { workspace = true, features = ["derive"] }

[dev-dependencies]
serde_json.workspace = true

[features]
client = ["jsonrpsee/client", "jsonrpsee/async-client"]
client = [
"jsonrpsee/client",
"jsonrpsee/async-client",
"reth-rpc-eth-api/client"
]
optimism = ["reth-rpc-eth-api/optimism"]
Loading