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

chore(rpc): move impl of eth api server out of reth-rpc-eth-api #9135

Merged
merged 78 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
a0cfb0c
scaffold eth api
mattsse May 22, 2024
8a2379b
chore(rpc): decouple op receipt response (#8353)
emhane May 27, 2024
f4f7786
chore(op): remove redundant trait `NetworkEthApi` (#8411)
emhane May 27, 2024
a737ae0
chore(op): L1 receipt rpc methods default trait methods (#8437)
emhane May 31, 2024
39d4366
Merge branch 'main' into matt/scaffold-ethapi
emhane Jun 1, 2024
7913c07
Merge branch 'main' into matt/scaffold-ethapi
emhane Jun 5, 2024
9ba4cd2
Merge branch 'main' into matt/scaffold-ethapi
emhane Jun 5, 2024
3d42231
chore(rpc): trait for blocking task (#8538)
emhane Jun 5, 2024
da5c170
Merge branch 'main' into matt/scaffold-ethapi
emhane Jun 6, 2024
67d276b
Merge branch 'matt/scaffold-ethapi' of github.com:paradigmxyz/reth in…
emhane Jun 6, 2024
f04b38c
Merge branch 'main' into matt/scaffold-ethapi
emhane Jun 8, 2024
ade9d40
Fix lint
emhane Jun 8, 2024
a30c184
chore(rpc): default trait methods `EthTransactions` (#8639)
emhane Jun 8, 2024
cea088d
chore(rpc): pending block helper trait (#8640)
emhane Jun 8, 2024
bc24e8e
chore(rpc): `EthTransactions` default trait methods using pending blo…
emhane Jun 8, 2024
f89077b
chore(rpc): reusable eth api `EthCall` (#8683)
emhane Jun 11, 2024
f8276cc
Merge branch 'main' into matt/scaffold-ethapi
emhane Jun 11, 2024
197b182
chore(rpc): `EthBlocks` default impl (#8723)
emhane Jun 11, 2024
e4f9fdc
chore(rpc): move message signing to `EthTransactions` (#8759)
emhane Jun 12, 2024
ba562d1
Merge branch 'main' into matt/scaffold-ethapi
emhane Jun 13, 2024
0c04916
Fix merge conflicts
emhane Jun 13, 2024
9c579e1
chore(rpc): impl `EthApiServer` helper traits on type like `EthApi` (…
emhane Jun 13, 2024
56ed575
chore(rpc): remove `FillableTransaction` (#8800)
emhane Jun 14, 2024
926c86f
Move EthApi trait to own crate
emhane Jun 14, 2024
2c78d29
Impl EthApiServer for generic type
emhane Jun 14, 2024
f6fe8b5
Move eth api trait and impl into reth-rpc-eth-api
emhane Jun 14, 2024
53a97b8
Run fmt
emhane Jun 14, 2024
6a3b059
Structure reth-rpc-eth-api fs
emhane Jun 15, 2024
dd8920c
Add missing docs
emhane Jun 17, 2024
713923e
Fix deps
emhane Jun 17, 2024
592ab02
Fix docs
emhane Jun 17, 2024
e466faf
Merge branch 'main' into matt/scaffold-ethapi
emhane Jun 17, 2024
e2a9be3
Bump secp256k1
emhane Jun 17, 2024
1de7000
Merge branch 'emhane/bump-secp256k1' into matt/scaffold-ethapi
emhane Jun 17, 2024
fffcc9f
Fix merge conflicts
emhane Jun 17, 2024
db5df93
Merge branch 'matt/scaffold-ethapi' into emhane/move-ethapi
emhane Jun 17, 2024
9ec86df
Fix docs
emhane Jun 17, 2024
90a9c4f
Fix lint
emhane Jun 17, 2024
fda6a66
Fix lint
emhane Jun 17, 2024
76db237
Fix deps
emhane Jun 17, 2024
a7642a9
Fix deps
emhane Jun 17, 2024
c5f6c5a
Enable dev feature for revm primitives
emhane Jun 17, 2024
9ecf026
Feature gate api client export
emhane Jun 17, 2024
fb78bdb
Fix deps
emhane Jun 17, 2024
abff53f
Re-impl op behaviour for EthApi
emhane Jun 17, 2024
4934521
Merge branch 'main' into emhane/ethapi-crate
emhane Jun 17, 2024
85055be
Fix docs
emhane Jun 17, 2024
0b8c131
Fix manifest
emhane Jun 17, 2024
15fc4d8
Remove op default trait method impl
emhane Jun 17, 2024
ce9d876
Add missing op dep
emhane Jun 17, 2024
1237462
fixup! Remove op default trait method impl
emhane Jun 17, 2024
8cba5b8
Merge branch 'main' into emhane/ethapi-crate
emhane Jun 19, 2024
3833795
Fix merge conflicts
emhane Jun 19, 2024
4c4ec2e
Shrink scope, remove reth-optimism-rpc crate
emhane Jun 19, 2024
66560bb
Merge branch 'main' into emhane/ethapi-crate
emhane Jun 19, 2024
e9bba83
Fix merge conflicts
emhane Jun 19, 2024
99c0dcf
fixup! Fix merge conflicts
emhane Jun 19, 2024
7f1335e
Merge branch 'main' into emhane/ethapi-crate
emhane Jun 20, 2024
921ac96
Merge branch 'main' into emhane/ethapi-crate
emhane Jun 21, 2024
715ede0
Merge branch 'main' into emhane/ethapi-crate
emhane Jun 26, 2024
c741859
Fix lint
emhane Jun 26, 2024
afc92d4
Simplify EthBlocks trait method signatures
emhane Jun 26, 2024
d8558ff
Improve usability TraceExt trait
emhane Jun 26, 2024
0f1afac
Merge branch 'main' into emhane/ethapi-crate
emhane Jun 26, 2024
4bf7e34
Move impl of eth api back to rpc crate
emhane Jun 26, 2024
ed48237
fixup! Move impl of eth api back to rpc crate
emhane Jun 27, 2024
c5f3c5d
Fix deps for optimism feature and jsonrpsee-types
emhane Jun 27, 2024
fd9a638
Move eth server types to new crate reth-rpc-eth-server-types
emhane Jun 27, 2024
d55c5d9
Use concrete type BlockId as helper trait method param
emhane Jun 27, 2024
9249967
Add 'test-utils' feature to dev-deps
emhane Jun 27, 2024
b971ed8
Fix docs
emhane Jun 27, 2024
64cdad2
Merge branch 'emhane/ethapi-crate' into emhane/move-ethapi-impl-to-rpc
emhane Jun 27, 2024
252628b
Fix merge conflicts
emhane Jun 27, 2024
ed393b8
Remove redundant dev-deps, tests moved into reth-rpc/src/eth/core.rs
emhane Jun 27, 2024
c2c88db
Fix crate descriptions
emhane Jun 27, 2024
6df13a0
Rename crate reth-rpc-eth-server-types to reth-rpc-eth-types
emhane Jun 27, 2024
7123f67
Fix description of reth-rpc-eth-api crate
emhane Jun 27, 2024
98599cf
Merge branch 'main' into emhane/move-ethapi-impl-to-rpc
emhane Jun 27, 2024
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
63 changes: 55 additions & 8 deletions Cargo.lock

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

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,10 @@ members = [
"crates/rpc/rpc-builder/",
"crates/rpc/rpc-engine-api/",
"crates/rpc/rpc-eth-api/",
"crates/rpc/rpc-eth-types/",
"crates/rpc/rpc-layer",
"crates/rpc/rpc-testing-util/",
"crates/rpc/rpc-server-types/",
"crates/rpc/rpc-types-compat/",
"crates/rpc/rpc-types/",
"crates/rpc/rpc/",
Expand Down Expand Up @@ -342,6 +344,7 @@ 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-eth-types = { path = "crates/rpc/rpc-eth-types" }
reth-rpc-server-types = { path = "crates/rpc/rpc-server-types" }
reth-rpc-types = { path = "crates/rpc/rpc-types" }
reth-rpc-types-compat = { path = "crates/rpc/rpc-types-compat" }
Expand Down
3 changes: 3 additions & 0 deletions bin/reth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ reth-rpc.workspace = true
reth-rpc-types.workspace = true
reth-rpc-types-compat.workspace = true
reth-rpc-api = { workspace = true, features = ["client"] }
reth-rpc-eth-types.workspace = true
reth-rpc-server-types.workspace = true
reth-network = { workspace = true, features = ["serde"] }
reth-network-p2p.workspace = true
reth-net-banlist.workspace = true
Expand Down Expand Up @@ -153,6 +155,7 @@ optimism = [
"reth-blockchain-tree/optimism",
"dep:reth-node-optimism",
"reth-node-core/optimism",
"reth-rpc-eth-types/optimism",
]

# no-op feature flag for switching between the `optimism` and default functionality in CI matrices
Expand Down
13 changes: 11 additions & 2 deletions bin/reth/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,15 @@ pub mod rpc {
pub use reth_rpc_types::*;
}

/// Re-exported from `reth_rpc_server_types`.
pub mod server_types {
pub use reth_rpc_server_types::*;
/// Re-exported from `reth_rpc_eth_types`.
pub mod eth {
pub use reth_rpc_eth_types::*;
}
}

/// Re-exported from `reth_rpc_api`.
pub mod api {
pub use reth_rpc_api::*;
Expand All @@ -159,10 +168,10 @@ pub mod rpc {

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

/// Re-exported from `reth_rpc::eth`.
/// Re-exported from `reth_rpc_types_compat`.
pub mod compat {
pub use reth_rpc_types_compat::*;
}
Expand Down
9 changes: 7 additions & 2 deletions crates/e2e-test-utils/src/rpc.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
use alloy_consensus::TxEnvelope;
use alloy_network::eip2718::Decodable2718;
use reth::{api::FullNodeComponents, builder::rpc::RpcRegistry, rpc::api::DebugApiServer};
use reth::{
builder::{rpc::RpcRegistry, FullNodeComponents},
rpc::{
api::{eth::helpers::EthTransactions, DebugApiServer},
server_types::eth::EthResult,
},
};
use reth_primitives::{Bytes, B256};
use reth_rpc::eth::{servers::EthTransactions, EthResult};

pub struct RpcTestContext<Node: FullNodeComponents> {
pub inner: RpcRegistry<Node>,
Expand Down
8 changes: 5 additions & 3 deletions crates/ethereum/node/tests/e2e/dev.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
use crate::utils::EthNode;
use std::sync::Arc;

use alloy_genesis::Genesis;
use alloy_primitives::{b256, hex};
use futures::StreamExt;
use reth::rpc::eth::servers::EthTransactions;
use reth::rpc::api::eth::helpers::EthTransactions;
use reth_chainspec::ChainSpec;
use reth_e2e_test_utils::setup;
use reth_provider::CanonStateSubscriptions;
use std::sync::Arc;

use crate::utils::EthNode;

#[tokio::test]
async fn can_run_dev_node() -> eyre::Result<()> {
Expand Down
2 changes: 2 additions & 0 deletions crates/node-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ reth-storage-errors.workspace = true
reth-provider.workspace = true
reth-network = { workspace = true, features = ["serde"] }
reth-network-p2p.workspace = true
reth-rpc-eth-types.workspace = true
reth-rpc-server-types.workspace = true
reth-rpc-types.workspace = true
reth-rpc-types-compat.workspace = true
Expand Down Expand Up @@ -103,6 +104,7 @@ optimism = [
"reth-rpc-types-compat/optimism",
"reth-beacon-consensus/optimism",
"reth-rpc-eth-api/optimism",
"reth-rpc-eth-types/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_api::GasPriceOracleConfig;
use reth_rpc_eth_types::GasPriceOracleConfig;
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
22 changes: 11 additions & 11 deletions crates/node-core/src/args/rpc_server.rs
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
//! clap [Args](clap::Args) for RPC related arguments.

use crate::args::{
types::{MaxU32, ZeroAsNoneU64},
GasPriceOracleArgs, RpcStateCacheArgs,
use std::{
ffi::OsStr,
net::{IpAddr, Ipv4Addr},
path::PathBuf,
};

use alloy_rpc_types_engine::JwtSecret;
use clap::{
builder::{PossibleValue, RangedU64ValueParser, TypedValueParser},
Arg, Args, Command,
};
use rand::Rng;
use reth_rpc_eth_api::RPC_DEFAULT_GAS_CAP;

use reth_rpc_server_types::{constants, RethRpcModule, RpcModuleSelection};
use std::{
ffi::OsStr,
net::{IpAddr, Ipv4Addr},
path::PathBuf,

use crate::args::{
types::{MaxU32, ZeroAsNoneU64},
GasPriceOracleArgs, RpcStateCacheArgs,
};

/// Default max number of subscriptions per connection.
Expand Down Expand Up @@ -152,7 +152,7 @@ pub struct RpcServerArgs {
alias = "rpc-gascap",
value_name = "GAS_CAP",
value_parser = RangedU64ValueParser::<u64>::new().range(1..),
default_value_t = RPC_DEFAULT_GAS_CAP.into()
default_value_t = constants::gas_oracle::RPC_DEFAULT_GAS_CAP
)]
pub rpc_gas_cap: u64,

Expand Down Expand Up @@ -285,7 +285,7 @@ impl Default for RpcServerArgs {
rpc_max_tracing_requests: constants::default_max_tracing_requests(),
rpc_max_blocks_per_filter: constants::DEFAULT_MAX_BLOCKS_PER_FILTER.into(),
rpc_max_logs_per_response: (constants::DEFAULT_MAX_LOGS_PER_RESPONSE as u64).into(),
rpc_gas_cap: RPC_DEFAULT_GAS_CAP.into(),
rpc_gas_cap: constants::gas_oracle::RPC_DEFAULT_GAS_CAP,
gas_price_oracle: GasPriceOracleArgs::default(),
rpc_state_cache: RpcStateCacheArgs::default(),
}
Expand Down
2 changes: 1 addition & 1 deletion crates/node-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub mod rpc {

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

/// Re-exported from `reth_rpc::eth`.
Expand Down
8 changes: 7 additions & 1 deletion crates/optimism/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ reth-beacon-consensus.workspace = true
reth-optimism-consensus.workspace = true
revm-primitives.workspace = true
reth-discv5.workspace = true
reth-rpc-eth-types.workspace = true
reth-rpc-eth-api.workspace = true

# async
async-trait.workspace = true
Expand All @@ -44,11 +46,14 @@ tracing.workspace = true
# misc
clap.workspace = true
serde.workspace = true
serde_json.workspace = true
eyre.workspace = true
parking_lot.workspace = true
thiserror.workspace = true

# rpc
jsonrpsee.workspace = true
jsonrpsee-types.workspace = true
serde_json.workspace = true

[dev-dependencies]
reth.workspace = true
Expand All @@ -71,4 +76,5 @@ optimism = [
"reth-beacon-consensus/optimism",
"reth-revm/optimism",
"reth-auto-seal-consensus/optimism",
"reth-rpc-eth-types/optimism"
]
Loading
Loading