Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
121 changes: 45 additions & 76 deletions Cargo.lock

Large diffs are not rendered by default.

74 changes: 53 additions & 21 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -407,31 +407,31 @@ alloy-rlp = "0.3.4"
alloy-sol-types = "0.7.2"
alloy-trie = { version = "0.4", default-features = false }

alloy-consensus = { version = "0.2.1", default-features = false }
alloy-eips = { version = "0.2.1", default-features = false }
alloy-genesis = { version = "0.2.1", default-features = false }
alloy-json-rpc = { version = "0.2.1", default-features = false }
alloy-network = { version = "0.2.1", default-features = false }
alloy-node-bindings = { version = "0.2.1", default-features = false }
alloy-consensus = { git = "https://github.com/alloy-rs/alloy", rev = "02ccb77a" }
alloy-eips = { git = "https://github.com/alloy-rs/alloy", rev = "02ccb77a" }
alloy-genesis = { git = "https://github.com/alloy-rs/alloy", rev = "02ccb77a" }
alloy-json-rpc = { git = "https://github.com/alloy-rs/alloy", rev = "02ccb77a" }
alloy-network = { git = "https://github.com/alloy-rs/alloy", rev = "02ccb77a" }
alloy-node-bindings = { git = "https://github.com/alloy-rs/alloy", rev = "02ccb77a" }
alloy-provider = { version = "0.2.1", features = ["reqwest"], default-features = false }
alloy-pubsub = { version = "0.2.1", default-features = false }
alloy-rpc-client = { version = "0.2.1", default-features = false }
alloy-pubsub = { git = "https://github.com/alloy-rs/alloy", rev = "02ccb77a" }
alloy-rpc-client = { git = "https://github.com/alloy-rs/alloy", rev = "02ccb77a" }
alloy-rpc-types = { version = "0.2.1", features = ["eth"], default-features = false }
alloy-rpc-types-admin = { version = "0.2.1", default-features = false }
alloy-rpc-types-anvil = { version = "0.2.1", default-features = false }
alloy-rpc-types-beacon = { version = "0.2.1", default-features = false }
alloy-rpc-types-engine = { version = "0.2.1", default-features = false }
alloy-rpc-types-eth = { version = "0.2.1", default-features = false }
alloy-rpc-types-mev = { version = "0.2.1", default-features = false }
alloy-rpc-types-trace = { version = "0.2.1", default-features = false }
alloy-rpc-types-txpool = { version = "0.2.1", default-features = false }
alloy-serde = { version = "0.2.1", default-features = false }
alloy-signer = { version = "0.2.1", default-features = false }
alloy-signer-local = { version = "0.2.1", default-features = false }
alloy-rpc-types-admin = { git = "https://github.com/alloy-rs/alloy", rev = "02ccb77a" }
alloy-rpc-types-anvil = { git = "https://github.com/alloy-rs/alloy", rev = "02ccb77a" }
alloy-rpc-types-beacon = { git = "https://github.com/alloy-rs/alloy", rev = "02ccb77a" }
alloy-rpc-types-engine = { git = "https://github.com/alloy-rs/alloy", rev = "02ccb77a" }
alloy-rpc-types-eth = { git = "https://github.com/alloy-rs/alloy", rev = "02ccb77a" }
alloy-rpc-types-mev = { git = "https://github.com/alloy-rs/alloy", rev = "02ccb77a" }
alloy-rpc-types-trace = { git = "https://github.com/alloy-rs/alloy", rev = "02ccb77a" }
alloy-rpc-types-txpool = { git = "https://github.com/alloy-rs/alloy", rev = "02ccb77a" }
alloy-serde = { git = "https://github.com/alloy-rs/alloy", rev = "02ccb77a" }
alloy-signer = { git = "https://github.com/alloy-rs/alloy", rev = "02ccb77a" }
alloy-signer-local = { git = "https://github.com/alloy-rs/alloy", rev = "02ccb77a" }
alloy-transport = { version = "0.2.1" }
alloy-transport-http = { version = "0.2.1", features = ["reqwest-rustls-tls"], default-features = false }
alloy-transport-ipc = { version = "0.2.1", default-features = false }
alloy-transport-ws = { version = "0.2.1", default-features = false }
alloy-transport-ipc = { git = "https://github.com/alloy-rs/alloy", rev = "02ccb77a" }
alloy-transport-ws = { git = "https://github.com/alloy-rs/alloy", rev = "02ccb77a" }

# op
op-alloy-rpc-types = "0.1"
Expand Down Expand Up @@ -549,3 +549,35 @@ serial_test = "3"
similar-asserts = "1.5.0"
tempfile = "3.8"
test-fuzz = "5"

[patch.crates-io]
alloy-consensus = { git = "https://github.com/alloy-rs/alloy", rev = "02ccb77a" }
alloy-eips = { git = "https://github.com/alloy-rs/alloy", rev = "02ccb77a" }
alloy-genesis = { git = "https://github.com/alloy-rs/alloy", rev = "02ccb77a" }
alloy-json-rpc = { git = "https://github.com/alloy-rs/alloy", rev = "02ccb77a" }
alloy-network = { git = "https://github.com/alloy-rs/alloy", rev = "02ccb77a" }
alloy-node-bindings = { git = "https://github.com/alloy-rs/alloy", rev = "02ccb77a" }
alloy-provider = { git = "https://github.com/alloy-rs/alloy", rev = "02ccb77a" }
alloy-pubsub = { git = "https://github.com/alloy-rs/alloy", rev = "02ccb77a" }
alloy-rpc-client = { git = "https://github.com/alloy-rs/alloy", rev = "02ccb77a" }
alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy", rev = "02ccb77a" }
alloy-rpc-types-admin = { git = "https://github.com/alloy-rs/alloy", rev = "02ccb77a" }
alloy-rpc-types-anvil = { git = "https://github.com/alloy-rs/alloy", rev = "02ccb77a" }
alloy-rpc-types-beacon = { git = "https://github.com/alloy-rs/alloy", rev = "02ccb77a" }
alloy-rpc-types-engine = { git = "https://github.com/alloy-rs/alloy", rev = "02ccb77a" }
alloy-rpc-types-eth = { git = "https://github.com/alloy-rs/alloy", rev = "02ccb77a" }
alloy-rpc-types-mev = { git = "https://github.com/alloy-rs/alloy", rev = "02ccb77a" }
alloy-rpc-types-trace = { git = "https://github.com/alloy-rs/alloy", rev = "02ccb77a" }
alloy-rpc-types-txpool = { git = "https://github.com/alloy-rs/alloy", rev = "02ccb77a" }
alloy-serde = { git = "https://github.com/alloy-rs/alloy", rev = "02ccb77a" }
alloy-signer = { git = "https://github.com/alloy-rs/alloy", rev = "02ccb77a" }
alloy-signer-local = { git = "https://github.com/alloy-rs/alloy", rev = "02ccb77a" }
alloy-transport = { git = "https://github.com/alloy-rs/alloy", rev = "02ccb77a" }
alloy-transport-http = { git = "https://github.com/alloy-rs/alloy", rev = "02ccb77a" }
alloy-transport-ipc = { git = "https://github.com/alloy-rs/alloy", rev = "02ccb77a" }
alloy-transport-ws = { git = "https://github.com/alloy-rs/alloy", rev = "02ccb77a" }
revm = { git = "https://github.com/bluealloy/revm", rev = "caadc71" }
revm-primitives = { git = "https://github.com/bluealloy/revm", rev = "caadc71" }
revm-inspectors = { git = "https://github.com/klkvr/evm-inspectors", rev = "b51baec" }
op-alloy-rpc-types = { git = "https://github.com/alloy-rs/op-alloy", rev = "ccf4dbe" }
op-alloy-network = { git = "https://github.com/alloy-rs/op-alloy", rev = "ccf4dbe" }
22 changes: 5 additions & 17 deletions bin/reth-bench/src/bench/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@

use crate::{authenticated_transport::AuthenticatedTransportConnect, bench_mode::BenchMode};
use alloy_eips::BlockNumberOrTag;
use alloy_provider::{
network::{AnyNetwork, Ethereum},
Provider, ProviderBuilder, RootProvider,
};
use alloy_provider::{network::AnyNetwork, Provider, ProviderBuilder, RootProvider};
use alloy_rpc_client::ClientBuilder;
use alloy_rpc_types_engine::JwtSecret;
use alloy_transport::BoxTransport;
Expand All @@ -24,7 +21,7 @@ pub(crate) struct BenchContext {
/// The auth provider used for engine API queries.
pub(crate) auth_provider: RootProvider<BoxTransport, AnyNetwork>,
/// The block provider used for block queries.
pub(crate) block_provider: RootProvider<Http<Client>, Ethereum>,
pub(crate) block_provider: RootProvider<Http<Client>, AnyNetwork>,
/// The benchmark mode, which defines whether the benchmark should run for a closed or open
/// range of blocks.
pub(crate) benchmark_mode: BenchMode,
Expand All @@ -46,7 +43,8 @@ impl BenchContext {
}

// set up alloy client for blocks
let block_provider = ProviderBuilder::new().on_http(rpc_url.parse()?);
let block_provider =
ProviderBuilder::new().network::<AnyNetwork>().on_http(rpc_url.parse()?);

// If neither `--from` nor `--to` are provided, we will run the benchmark continuously,
// starting at the latest block.
Expand Down Expand Up @@ -95,17 +93,7 @@ impl BenchContext {
}
};

let next_block = match first_block.header.number {
Some(number) => {
// fetch next block
number + 1
}
None => {
// this should never happen
return Err(eyre::eyre!("First block number is None"));
}
};

let next_block = first_block.header.number + 1;
Ok(Self { auth_provider, block_provider, benchmark_mode, next_block })
}
}
4 changes: 2 additions & 2 deletions bin/reth-bench/src/bench/new_payload_fcu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ impl Command {
let block = match block.header.hash {
Some(block_hash) => {
// we can reuse the hash in the response
Block::try_from(block).unwrap().seal(block_hash)
Block::try_from(block.inner).unwrap().seal(block_hash)
}
None => {
// we don't have the hash, so let's just hash it
Block::try_from(block).unwrap().seal_slow()
Block::try_from(block.inner).unwrap().seal_slow()
}
};

Expand Down
4 changes: 2 additions & 2 deletions bin/reth-bench/src/bench/new_payload_only.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ impl Command {
let block = match block.header.hash {
Some(block_hash) => {
// we can reuse the hash in the response
Block::try_from(block).unwrap().seal(block_hash)
Block::try_from(block.inner).unwrap().seal(block_hash)
}
None => {
// we don't have the hash, so let's just hash it
Block::try_from(block).unwrap().seal_slow()
Block::try_from(block.inner).unwrap().seal_slow()
}
};

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
Expand Up @@ -198,7 +198,7 @@ pub fn block_to_execution_payload_v3(block: Block) -> ExecutionNewPayload {
receipts_root: block.header.receipts_root,
logs_bloom: block.header.logs_bloom,
prev_randao: block.header.mix_hash.unwrap(),
block_number: block.header.number.unwrap(),
block_number: block.header.number,
gas_limit: block.header.gas_limit.try_into().unwrap(),
gas_used: block.header.gas_used.try_into().unwrap(),
timestamp: block.header.timestamp,
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
Expand Up @@ -63,7 +63,7 @@ impl BlockProvider for EtherscanBlockProvider {
continue
}
};
let block_number = block.header.number.unwrap();
let block_number = block.header.number;
if Some(block_number) == last_block_number {
continue;
}
Expand Down
4 changes: 3 additions & 1 deletion crates/e2e-test-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ where
N::AddOns: NodeAddOns<
Adapter<N>,
EthApi: FullEthApiServer<
NetworkTypes: Network<TransactionResponse = reth_rpc_types::Transaction>,
NetworkTypes: Network<
TransactionResponse = reth_rpc_types::WithOtherFields<reth_rpc_types::Transaction>,
>,
> + AddDevSigners
+ EthApiBuilderProvider<Adapter<N>>,
>,
Expand Down
3 changes: 2 additions & 1 deletion crates/e2e-test-utils/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use reth::{
};
use reth_node_builder::{EthApiTypes, NodeAddOns, NodeTypes};
use reth_primitives::{BlockHash, BlockNumber, Bytes, B256};
use reth_rpc_types::WithOtherFields;
use reth_stages_types::StageId;
use tokio_stream::StreamExt;

Expand Down Expand Up @@ -94,7 +95,7 @@ where
From<<Node::Engine as PayloadTypes>::BuiltPayload> + PayloadEnvelopeExt,
AddOns::EthApi: EthApiSpec + EthTransactions + TraceExt,
<AddOns::EthApi as EthApiTypes>::NetworkTypes:
Network<TransactionResponse = alloy_rpc_types::Transaction>,
Network<TransactionResponse = WithOtherFields<alloy_rpc_types::Transaction>>,
Copy link
Collaborator

Choose a reason for hiding this comment

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

@emhane how feasible do you think using OpNetwork is after this pr?

{
let mut chain = Vec::with_capacity(length as usize);
for i in 0..length {
Expand Down
8 changes: 6 additions & 2 deletions crates/e2e-test-utils/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use reth::{
};
use reth_node_builder::EthApiTypes;
use reth_primitives::{Bytes, B256};
use reth_rpc_types::WithOtherFields;

#[allow(missing_debug_implementations)]
pub struct RpcTestContext<Node: FullNodeComponents, EthApi: EthApiTypes> {
Expand All @@ -19,8 +20,11 @@ impl<Node, EthApi> RpcTestContext<Node, EthApi>
where
Node: FullNodeComponents,
EthApi: EthApiSpec
+ EthTransactions<NetworkTypes: Network<TransactionResponse = alloy_rpc_types::Transaction>>
+ TraceExt,
+ EthTransactions<
NetworkTypes: Network<
TransactionResponse = WithOtherFields<alloy_rpc_types::Transaction>,
>,
> + TraceExt,
{
/// Injects a raw transaction into the node tx pool via RPC server
pub async fn inject_tx(&self, raw_tx: Bytes) -> Result<B256, EthApi::Error> {
Expand Down
6 changes: 0 additions & 6 deletions crates/ethereum/evm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,6 @@ mod tests {
// Ensure that the logs database is empty
assert!(evm.context.evm.inner.db.logs.is_empty());

// Ensure that there are no valid authorizations in the EVM context
assert!(evm.context.evm.inner.valid_authorizations.is_empty());

// No Optimism
assert_eq!(evm.handler.cfg, HandlerCfg { spec_id: SpecId::LATEST, ..Default::default() });
}
Expand Down Expand Up @@ -357,9 +354,6 @@ mod tests {
// Ensure that the logs database is empty
assert!(evm.context.evm.inner.db.logs.is_empty());

// Ensure that there are no valid authorizations in the EVM context
assert!(evm.context.evm.inner.valid_authorizations.is_empty());

// No Optimism
assert_eq!(evm.handler.cfg, HandlerCfg { spec_id: SpecId::LATEST, ..Default::default() });
}
Expand Down
7 changes: 5 additions & 2 deletions crates/node/builder/src/builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
pub mod add_ons;
mod states;

use reth_rpc_types::WithOtherFields;
pub use states::*;

use std::sync::Arc;
Expand Down Expand Up @@ -330,7 +331,7 @@ where
>
+ FullEthApiServer<
NetworkTypes: alloy_network::Network<
TransactionResponse = reth_rpc_types::Transaction
TransactionResponse = WithOtherFields<reth_rpc_types::Transaction>,
>,
>
+ AddDevSigners
Expand Down Expand Up @@ -479,7 +480,9 @@ where
NodeAdapter<RethFullAdapter<DB, T>, CB::Components>,
EthApi: EthApiBuilderProvider<NodeAdapter<RethFullAdapter<DB, T>, CB::Components>>
+ FullEthApiServer<
NetworkTypes: alloy_network::Network<TransactionResponse = reth_rpc_types::Transaction>,
NetworkTypes: alloy_network::Network<
TransactionResponse = WithOtherFields<reth_rpc_types::Transaction>,
>,
> + AddDevSigners,
>,
{
Expand Down
6 changes: 4 additions & 2 deletions crates/node/builder/src/launch/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use reth_node_core::{
use reth_node_events::{cl::ConsensusLayerHealthEvents, node};
use reth_provider::providers::BlockchainProvider2;
use reth_rpc_engine_api::{capabilities::EngineCapabilities, EngineApi};
use reth_rpc_types::engine::ClientVersionV1;
use reth_rpc_types::{engine::ClientVersionV1, WithOtherFields};
use reth_tasks::TaskExecutor;
use reth_tokio_util::EventSender;
use reth_tracing::tracing::{debug, error, info};
Expand Down Expand Up @@ -67,7 +67,9 @@ where
NodeAdapter<T, CB::Components>,
EthApi: EthApiBuilderProvider<NodeAdapter<T, CB::Components>>
+ FullEthApiServer<
NetworkTypes: alloy_network::Network<TransactionResponse = reth_rpc_types::Transaction>,
NetworkTypes: alloy_network::Network<
TransactionResponse = WithOtherFields<reth_rpc_types::Transaction>,
>,
> + AddDevSigners,
>,
{
Expand Down
6 changes: 4 additions & 2 deletions crates/node/builder/src/launch/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use reth_node_events::{cl::ConsensusLayerHealthEvents, node};
use reth_primitives::format_ether;
use reth_provider::providers::BlockchainProvider;
use reth_rpc_engine_api::{capabilities::EngineCapabilities, EngineApi};
use reth_rpc_types::engine::ClientVersionV1;
use reth_rpc_types::{engine::ClientVersionV1, WithOtherFields};
use reth_tasks::TaskExecutor;
use reth_tracing::tracing::{debug, info};
use reth_transaction_pool::TransactionPool;
Expand Down Expand Up @@ -111,7 +111,9 @@ where
NodeAdapter<T, CB::Components>,
EthApi: EthApiBuilderProvider<NodeAdapter<T, CB::Components>>
+ FullEthApiServer<
NetworkTypes: alloy_network::Network<TransactionResponse = reth_rpc_types::Transaction>,
NetworkTypes: alloy_network::Network<
TransactionResponse = WithOtherFields<reth_rpc_types::Transaction>,
>,
> + AddDevSigners,
>,
{
Expand Down
5 changes: 4 additions & 1 deletion crates/node/builder/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ use reth_rpc_builder::{
RpcModuleBuilder, RpcRegistryInner, RpcServerHandle, TransportRpcModules,
};
use reth_rpc_layer::JwtSecret;
use reth_rpc_types::WithOtherFields;
use reth_tasks::TaskExecutor;
use reth_tracing::tracing::{debug, info};

Expand Down Expand Up @@ -300,7 +301,9 @@ where
Engine: EngineApiServer<Node::Engine>,
EthApi: EthApiBuilderProvider<Node>
+ FullEthApiServer<
NetworkTypes: alloy_network::Network<TransactionResponse = reth_rpc_types::Transaction>,
NetworkTypes: alloy_network::Network<
TransactionResponse = WithOtherFields<reth_rpc_types::Transaction>,
>,
>,
{
let auth_config = config.rpc.auth_server_config(jwt_secret)?;
Expand Down
6 changes: 0 additions & 6 deletions crates/optimism/evm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,6 @@ mod tests {
// Ensure that the logs database is empty
assert!(evm.context.evm.inner.db.logs.is_empty());

// Ensure that there are no valid authorizations in the EVM context
assert!(evm.context.evm.inner.valid_authorizations.is_empty());

// Optimism in handler
assert_eq!(evm.handler.cfg, HandlerCfg { spec_id: SpecId::LATEST, is_optimism: true });

Expand Down Expand Up @@ -372,9 +369,6 @@ mod tests {
// Ensure that the logs database is empty
assert!(evm.context.evm.inner.db.logs.is_empty());

// Ensure that there are no valid authorizations in the EVM context
assert!(evm.context.evm.inner.valid_authorizations.is_empty());

// Default spec ID
assert_eq!(evm.handler.spec_id(), SpecId::LATEST);

Expand Down
4 changes: 2 additions & 2 deletions crates/optimism/rpc/src/eth/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use std::{fmt, sync::Arc};

use alloy_primitives::U256;
use derive_more::Deref;
use op_alloy_network::Optimism;
use op_alloy_network::AnyNetwork;
use reth_chainspec::ChainSpec;
use reth_evm::ConfigureEvm;
use reth_network_api::NetworkInfo;
Expand Down Expand Up @@ -95,7 +95,7 @@ where
N: FullNodeComponents,
{
type Error = OpEthApiError;
type NetworkTypes = Optimism;
type NetworkTypes = AnyNetwork;
}

impl<N> EthApiSpec for OpEthApi<N>
Expand Down
Loading