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(deps): bump alloy #10537

Merged
merged 14 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from 13 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
463 changes: 227 additions & 236 deletions Cargo.lock

Large diffs are not rendered by default.

68 changes: 37 additions & 31 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -407,47 +407,48 @@ revm-primitives = { version = "8.0.0", features = [

# eth
alloy-chains = "0.1.18"
alloy-dyn-abi = "0.7.2"
alloy-primitives = { version = "0.7.2", default-features = false }
alloy-dyn-abi = "0.8.0"
alloy-primitives = { version = "0.8.0", default-features = false }
alloy-rlp = "0.3.4"
alloy-sol-types = "0.7.2"
alloy-trie = { version = "0.4", default-features = false }
alloy-sol-types = "0.8.0"
alloy-trie = { version = "0.5", 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-provider = { version = "0.2.1", features = [
alloy-consensus = { version = "0.3.0", default-features = false }
alloy-eips = { version = "0.3.0", default-features = false }
alloy-genesis = { version = "0.3.0", default-features = false }
alloy-json-rpc = { version = "0.3.0", default-features = false }
alloy-network = { version = "0.3.0", default-features = false }
alloy-node-bindings = { version = "0.3.0", default-features = false }
alloy-provider = { version = "0.3.0", 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-rpc-types = { version = "0.2.1", features = [
alloy-pubsub = { version = "0.3.0", default-features = false }
alloy-rpc-client = { version = "0.3.0", default-features = false }
alloy-rpc-types = { version = "0.3.0", 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-transport = { version = "0.2.1" }
alloy-transport-http = { version = "0.2.1", features = [
alloy-rpc-types-admin = { version = "0.3.0", default-features = false }
alloy-rpc-types-anvil = { version = "0.3.0", default-features = false }
alloy-rpc-types-beacon = { version = "0.3.0", default-features = false }
alloy-rpc-types-engine = { version = "0.3.0", default-features = false }
alloy-rpc-types-eth = { version = "0.3.0", default-features = false }
alloy-rpc-types-mev = { version = "0.3.0", default-features = false }
alloy-rpc-types-trace = { version = "0.3.0", default-features = false }
alloy-rpc-types-txpool = { version = "0.3.0", default-features = false }
alloy-serde = { version = "0.3.0", default-features = false }
alloy-signer = { version = "0.3.0", default-features = false }
alloy-signer-local = { version = "0.3.0", default-features = false }
alloy-transport = { version = "0.3.0" }
alloy-transport-http = { version = "0.3.0", 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 = { version = "0.3.0", default-features = false }
alloy-transport-ws = { version = "0.3.0", default-features = false }

# op
op-alloy-rpc-types = "0.1"
op-alloy-network = "0.1"
op-alloy-rpc-types = "0.2"
op-alloy-rpc-types-engine = "0.2"
op-alloy-network = "0.2"

# misc
aquamarine = "0.5"
Expand Down Expand Up @@ -561,3 +562,8 @@ serial_test = "3"
similar-asserts = "1.5.0"
tempfile = "3.8"
test-fuzz = "5"

[patch.crates-io]
revm = { git = "https://github.com/klkvr/revm", rev = "84839ba" }
revm-primitives = { git = "https://github.com/klkvr/revm", rev = "84839ba" }
revm-inspectors = { git = "https://github.com/klkvr/evm-inspectors", rev = "4674d04" }
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 })
}
}
28 changes: 5 additions & 23 deletions bin/reth-bench/src/bench/new_payload_fcu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,8 @@ impl Command {
while benchmark_mode.contains(next_block) {
let block_res = block_provider.get_block_by_number(next_block.into(), true).await;
let block = block_res.unwrap().unwrap();
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)
}
None => {
// we don't have the hash, so let's just hash it
Block::try_from(block).unwrap().seal_slow()
}
};

let block_hash = block.header.hash;
let block = Block::try_from(block.inner).unwrap().seal(block_hash);
let head_block_hash = block.hash();
let safe_block_hash = block_provider
.get_block_by_number(block.number.saturating_sub(32).into(), false);
Expand All @@ -65,18 +56,9 @@ impl Command {

let (safe, finalized) = tokio::join!(safe_block_hash, finalized_block_hash,);

let safe_block_hash = safe
.unwrap()
.expect("finalized block exists")
.header
.hash
.expect("finalized block has hash");
let finalized_block_hash = finalized
.unwrap()
.expect("finalized block exists")
.header
.hash
.expect("finalized block has hash");
let safe_block_hash = safe.unwrap().expect("finalized block exists").header.hash;
let finalized_block_hash =
finalized.unwrap().expect("finalized block exists").header.hash;

next_block += 1;
sender
Expand Down
12 changes: 2 additions & 10 deletions bin/reth-bench/src/bench/new_payload_only.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,8 @@ impl Command {
while benchmark_mode.contains(next_block) {
let block_res = block_provider.get_block_by_number(next_block.into(), true).await;
let block = block_res.unwrap().unwrap();
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)
}
None => {
// we don't have the hash, so let's just hash it
Block::try_from(block).unwrap().seal_slow()
}
};
let block_hash = block.header.hash;
let block = Block::try_from(block.inner).unwrap().seal(block_hash);

next_block += 1;
sender.send(block).await.unwrap();
Expand Down
2 changes: 1 addition & 1 deletion bin/reth/src/commands/debug_cmd/build_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ impl Command {
#[cfg(feature = "optimism")]
reth_node_optimism::OptimismPayloadBuilderAttributes::try_new(
best_block.hash(),
reth_rpc_types::engine::OptimismPayloadAttributes {
reth_rpc_types::optimism::OptimismPayloadAttributes {
payload_attributes: payload_attrs,
transactions: None,
no_tx_pool: None,
Expand Down
6 changes: 3 additions & 3 deletions crates/consensus/debug-client/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pub trait BlockProvider: Send + Sync + 'static {
None => return Ok(B256::default()),
};
let block = self.get_block(previous_block_number).await?;
block.header.hash.ok_or_else(|| eyre::eyre!("previous block does not have hash"))
Ok(block.header.hash)
}
}
}
Expand Down Expand Up @@ -198,13 +198,13 @@ 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,
extra_data: block.header.extra_data.clone(),
base_fee_per_gas: block.header.base_fee_per_gas.unwrap().try_into().unwrap(),
block_hash: block.header.hash.unwrap(),
block_hash: block.header.hash,
transactions: transactions
.into_iter()
.map(|tx| {
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
2 changes: 1 addition & 1 deletion crates/consensus/debug-client/src/providers/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl BlockProvider for RpcBlockProvider {

while let Some(block) = stream.next().await {
let full_block = ws_provider
.get_block_by_hash(block.header.hash.unwrap(), BlockTransactionsKind::Full)
.get_block_by_hash(block.header.hash, BlockTransactionsKind::Full)
.await
.expect("failed to get block")
.expect("block not found");
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
2 changes: 1 addition & 1 deletion crates/e2e-test-utils/src/traits.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use reth::rpc::types::{
engine::{ExecutionPayloadEnvelopeV3, OptimismExecutionPayloadEnvelopeV3},
engine::ExecutionPayloadEnvelopeV3, optimism::OptimismExecutionPayloadEnvelopeV3,
ExecutionPayloadV3,
};

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
Loading
Loading