Skip to content

Commit

Permalink
chore: bump alloy 0.11 (#14122)
Browse files Browse the repository at this point in the history
Co-authored-by: Matthias Seitz <[email protected]>
  • Loading branch information
rkrasiuk and mattsse authored Jan 31, 2025
1 parent bd5dde5 commit 5322877
Show file tree
Hide file tree
Showing 25 changed files with 256 additions and 270 deletions.
179 changes: 95 additions & 84 deletions Cargo.lock

Large diffs are not rendered by default.

137 changes: 70 additions & 67 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ reth-zstd-compressors = { path = "crates/storage/zstd-compressors", default-feat
revm = { version = "19.4.0", default-features = false }
revm-primitives = { version = "15.1.0", default-features = false }
revm-interpreter = { version = "15.0.0", default-features = false }
revm-inspectors = "0.14.1"
revm-inspectors = "0.15.0"

# eth
alloy-chains = { version = "0.1.32", default-features = false }
Expand All @@ -434,42 +434,42 @@ alloy-rlp = { version = "0.3.10", default-features = false }
alloy-sol-types = "0.8.15"
alloy-trie = { version = "0.7", default-features = false }

alloy-consensus = { version = "0.9.2", default-features = false }
alloy-contract = { version = "0.9.2", default-features = false }
alloy-eips = { version = "0.9.2", default-features = false }
alloy-genesis = { version = "0.9.2", default-features = false }
alloy-json-rpc = { version = "0.9.2", default-features = false }
alloy-network = { version = "0.9.2", default-features = false }
alloy-network-primitives = { version = "0.9.2", default-features = false }
alloy-node-bindings = { version = "0.9.2", default-features = false }
alloy-provider = { version = "0.9.2", features = ["reqwest"], default-features = false }
alloy-pubsub = { version = "0.9.2", default-features = false }
alloy-rpc-client = { version = "0.9.2", default-features = false }
alloy-rpc-types = { version = "0.9.2", features = ["eth"], default-features = false }
alloy-rpc-types-admin = { version = "0.9.2", default-features = false }
alloy-rpc-types-anvil = { version = "0.9.2", default-features = false }
alloy-rpc-types-beacon = { version = "0.9.2", default-features = false }
alloy-rpc-types-debug = { version = "0.9.2", default-features = false }
alloy-rpc-types-engine = { version = "0.9.2", default-features = false }
alloy-rpc-types-eth = { version = "0.9.2", default-features = false }
alloy-rpc-types-mev = { version = "0.9.2", default-features = false }
alloy-rpc-types-trace = { version = "0.9.2", default-features = false }
alloy-rpc-types-txpool = { version = "0.9.2", default-features = false }
alloy-serde = { version = "0.9.2", default-features = false }
alloy-signer = { version = "0.9.2", default-features = false }
alloy-signer-local = { version = "0.9.2", default-features = false }
alloy-transport = { version = "0.9.2" }
alloy-transport-http = { version = "0.9.2", features = ["reqwest-rustls-tls"], default-features = false }
alloy-transport-ipc = { version = "0.9.2", default-features = false }
alloy-transport-ws = { version = "0.9.2", default-features = false }
alloy-consensus = { version = "0.11.0", default-features = false }
alloy-contract = { version = "0.11.0", default-features = false }
alloy-eips = { version = "0.11.0", default-features = false }
alloy-genesis = { version = "0.11.0", default-features = false }
alloy-json-rpc = { version = "0.11.0", default-features = false }
alloy-network = { version = "0.11.0", default-features = false }
alloy-network-primitives = { version = "0.11.0", default-features = false }
alloy-node-bindings = { version = "0.11.0", default-features = false }
alloy-provider = { version = "0.11.0", features = ["reqwest"], default-features = false }
alloy-pubsub = { version = "0.11.0", default-features = false }
alloy-rpc-client = { version = "0.11.0", default-features = false }
alloy-rpc-types = { version = "0.11.0", features = ["eth"], default-features = false }
alloy-rpc-types-admin = { version = "0.11.0", default-features = false }
alloy-rpc-types-anvil = { version = "0.11.0", default-features = false }
alloy-rpc-types-beacon = { version = "0.11.0", default-features = false }
alloy-rpc-types-debug = { version = "0.11.0", default-features = false }
alloy-rpc-types-engine = { version = "0.11.0", default-features = false }
alloy-rpc-types-eth = { version = "0.11.0", default-features = false }
alloy-rpc-types-mev = { version = "0.11.0", default-features = false }
alloy-rpc-types-trace = { version = "0.11.0", default-features = false }
alloy-rpc-types-txpool = { version = "0.11.0", default-features = false }
alloy-serde = { version = "0.11.0", default-features = false }
alloy-signer = { version = "0.11.0", default-features = false }
alloy-signer-local = { version = "0.11.0", default-features = false }
alloy-transport = { version = "0.11.0" }
alloy-transport-http = { version = "0.11.0", features = ["reqwest-rustls-tls"], default-features = false }
alloy-transport-ipc = { version = "0.11.0", default-features = false }
alloy-transport-ws = { version = "0.11.0", default-features = false }

# op
op-alloy-rpc-types = { version = "0.9.6", default-features = false }
op-alloy-rpc-types-engine = { version = "0.9.6", default-features = false }
op-alloy-network = { version = "0.9.6", default-features = false }
op-alloy-consensus = { version = "0.9.6", default-features = false }
op-alloy-flz = { version = "0.9.6", default-features = false }
op-alloy-rpc-jsonrpsee = { version = "0.9.6", default-features = false }
op-alloy-rpc-types = { version = "0.10.0", default-features = false }
op-alloy-rpc-types-engine = { version = "0.10.0", default-features = false }
op-alloy-network = { version = "0.10.0", default-features = false }
op-alloy-consensus = { version = "0.10.0", default-features = false }
op-alloy-flz = { version = "0.10.0", default-features = false }
op-alloy-rpc-jsonrpsee = { version = "0.10.0", default-features = false }

# misc
aquamarine = "0.6"
Expand Down Expand Up @@ -603,35 +603,38 @@ snmalloc-rs = { version = "0.3.7", features = ["build_cc"] }
crunchy = "=0.2.2"

# [patch.crates-io]
# alloy-consensus = { git = "https://github.com/alloy-rs/alloy", rev = "5492e40" }
# alloy-eips = { git = "https://github.com/alloy-rs/alloy", rev = "5492e40" }
# alloy-genesis = { git = "https://github.com/alloy-rs/alloy", rev = "5492e40" }
# alloy-json-rpc = { git = "https://github.com/alloy-rs/alloy", rev = "5492e40" }
# alloy-network = { git = "https://github.com/alloy-rs/alloy", rev = "5492e40" }
# alloy-network-primitives = { git = "https://github.com/alloy-rs/alloy", rev = "5492e40" }
# alloy-node-bindings = { git = "https://github.com/alloy-rs/alloy", rev = "5492e40" }
# alloy-provider = { git = "https://github.com/alloy-rs/alloy", rev = "5492e40" }
# alloy-pubsub = { git = "https://github.com/alloy-rs/alloy", rev = "5492e40" }
# alloy-rpc-client = { git = "https://github.com/alloy-rs/alloy", rev = "5492e40" }
# alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy", rev = "5492e40" }
# alloy-rpc-types-admin = { git = "https://github.com/alloy-rs/alloy", rev = "5492e40" }
# alloy-rpc-types-anvil = { git = "https://github.com/alloy-rs/alloy", rev = "5492e40" }
# alloy-rpc-types-beacon = { git = "https://github.com/alloy-rs/alloy", rev = "5492e40" }
# alloy-rpc-types-debug = { git = "https://github.com/alloy-rs/alloy", rev = "5492e40" }
# alloy-rpc-types-engine = { git = "https://github.com/alloy-rs/alloy", rev = "5492e40" }
# alloy-rpc-types-eth = { git = "https://github.com/alloy-rs/alloy", rev = "5492e40" }
# alloy-rpc-types-mev = { git = "https://github.com/alloy-rs/alloy", rev = "5492e40" }
# alloy-rpc-types-trace = { git = "https://github.com/alloy-rs/alloy", rev = "5492e40" }
# alloy-rpc-types-txpool = { git = "https://github.com/alloy-rs/alloy", rev = "5492e40" }
# alloy-serde = { git = "https://github.com/alloy-rs/alloy", rev = "5492e40" }
# alloy-signer = { git = "https://github.com/alloy-rs/alloy", rev = "5492e40" }
# alloy-signer-local = { git = "https://github.com/alloy-rs/alloy", rev = "5492e40" }
# alloy-transport = { git = "https://github.com/alloy-rs/alloy", rev = "5492e40" }
# alloy-transport-http = { git = "https://github.com/alloy-rs/alloy", rev = "5492e40" }
# alloy-transport-ipc = { git = "https://github.com/alloy-rs/alloy", rev = "5492e40" }
# alloy-transport-ws = { git = "https://github.com/alloy-rs/alloy", rev = "5492e40" }

# op-alloy-consensus = { git = "https://github.com/alloy-rs/op-alloy", rev = "debfc29" }
# op-alloy-network = { git = "https://github.com/alloy-rs/op-alloy", rev = "debfc29" }
# op-alloy-rpc-types = { git = "https://github.com/alloy-rs/op-alloy", rev = "debfc29" }
# op-alloy-rpc-types-engine = { git = "https://github.com/alloy-rs/op-alloy", rev = "debfc29" }
# alloy-consensus = { git = "https://github.com/alloy-rs/alloy", rev = "cfb13aa" }
# alloy-contract = { git = "https://github.com/alloy-rs/alloy", rev = "cfb13aa" }
# alloy-eips = { git = "https://github.com/alloy-rs/alloy", rev = "cfb13aa" }
# alloy-genesis = { git = "https://github.com/alloy-rs/alloy", rev = "cfb13aa" }
# alloy-json-rpc = { git = "https://github.com/alloy-rs/alloy", rev = "cfb13aa" }
# alloy-network = { git = "https://github.com/alloy-rs/alloy", rev = "cfb13aa" }
# alloy-network-primitives = { git = "https://github.com/alloy-rs/alloy", rev = "cfb13aa" }
# alloy-node-bindings = { git = "https://github.com/alloy-rs/alloy", rev = "cfb13aa" }
# alloy-provider = { git = "https://github.com/alloy-rs/alloy", rev = "cfb13aa" }
# alloy-pubsub = { git = "https://github.com/alloy-rs/alloy", rev = "cfb13aa" }
# alloy-rpc-client = { git = "https://github.com/alloy-rs/alloy", rev = "cfb13aa" }
# alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy", rev = "cfb13aa" }
# alloy-rpc-types-admin = { git = "https://github.com/alloy-rs/alloy", rev = "cfb13aa" }
# alloy-rpc-types-anvil = { git = "https://github.com/alloy-rs/alloy", rev = "cfb13aa" }
# alloy-rpc-types-beacon = { git = "https://github.com/alloy-rs/alloy", rev = "cfb13aa" }
# alloy-rpc-types-debug = { git = "https://github.com/alloy-rs/alloy", rev = "cfb13aa" }
# alloy-rpc-types-engine = { git = "https://github.com/alloy-rs/alloy", rev = "cfb13aa" }
# alloy-rpc-types-eth = { git = "https://github.com/alloy-rs/alloy", rev = "cfb13aa" }
# alloy-rpc-types-mev = { git = "https://github.com/alloy-rs/alloy", rev = "cfb13aa" }
# alloy-rpc-types-trace = { git = "https://github.com/alloy-rs/alloy", rev = "cfb13aa" }
# alloy-rpc-types-txpool = { git = "https://github.com/alloy-rs/alloy", rev = "cfb13aa" }
# alloy-serde = { git = "https://github.com/alloy-rs/alloy", rev = "cfb13aa" }
# alloy-signer = { git = "https://github.com/alloy-rs/alloy", rev = "cfb13aa" }
# alloy-signer-local = { git = "https://github.com/alloy-rs/alloy", rev = "cfb13aa" }
# alloy-transport = { git = "https://github.com/alloy-rs/alloy", rev = "cfb13aa" }
# alloy-transport-http = { git = "https://github.com/alloy-rs/alloy", rev = "cfb13aa" }
# alloy-transport-ipc = { git = "https://github.com/alloy-rs/alloy", rev = "cfb13aa" }
# alloy-transport-ws = { git = "https://github.com/alloy-rs/alloy", rev = "cfb13aa" }
#
# op-alloy-consensus = { git = "https://github.com/alloy-rs/op-alloy", rev = "ad607c1" }
# op-alloy-network = { git = "https://github.com/alloy-rs/op-alloy", rev = "ad607c1" }
# op-alloy-rpc-types = { git = "https://github.com/alloy-rs/op-alloy", rev = "ad607c1" }
# op-alloy-rpc-types-engine = { git = "https://github.com/alloy-rs/op-alloy", rev = "ad607c1" }
#
# revm-inspectors = { git = "https://github.com/paradigmxyz/revm-inspectors", rev = "1207e33" }
40 changes: 15 additions & 25 deletions bin/reth-bench/src/authenticated_transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use alloy_json_rpc::{RequestPacket, ResponsePacket};
use alloy_pubsub::{PubSubConnect, PubSubFrontend};
use alloy_rpc_types_engine::{Claims, JwtSecret};
use alloy_transport::{
utils::guess_local_url, Authorization, Pbf, TransportConnect, TransportError,
utils::guess_local_url, Authorization, BoxTransport, TransportConnect, TransportError,
TransportErrorKind, TransportFut,
};
use alloy_transport_http::{reqwest::Url, Http, ReqwestTransport};
Expand Down Expand Up @@ -175,19 +175,9 @@ impl AuthenticatedTransport {
}

match inner_and_claims.0 {
InnerTransport::Http(ref http) => {
let mut http = http;
http.call(req)
}
InnerTransport::Ws(ref ws) => {
let mut ws = ws;
ws.call(req)
}
InnerTransport::Ipc(ref ipc) => {
let mut ipc = ipc;
// we don't need to recreate the client for IPC
ipc.call(req)
}
InnerTransport::Http(ref mut http) => http.call(req),
InnerTransport::Ws(ref mut ws) => ws.call(req),
InnerTransport::Ipc(ref mut ipc) => ipc.call(req),
}
.await
})
Expand Down Expand Up @@ -221,21 +211,21 @@ impl AuthenticatedTransportConnect {
}

impl TransportConnect for AuthenticatedTransportConnect {
type Transport = AuthenticatedTransport;

fn is_local(&self) -> bool {
guess_local_url(&self.url)
}

fn get_transport<'a: 'b, 'b>(&'a self) -> Pbf<'b, Self::Transport, TransportError> {
AuthenticatedTransport::connect(self.url.clone(), self.jwt)
.map(|res| match res {
Ok(transport) => Ok(transport),
Err(err) => {
Err(TransportError::Transport(TransportErrorKind::Custom(Box::new(err))))
}
})
.boxed()
async fn get_transport(&self) -> Result<BoxTransport, TransportError> {
Ok(BoxTransport::new(
AuthenticatedTransport::connect(self.url.clone(), self.jwt)
.map(|res| match res {
Ok(transport) => Ok(transport),
Err(err) => {
Err(TransportError::Transport(TransportErrorKind::Custom(Box::new(err))))
}
})
.await?,
))
}
}

Expand Down
18 changes: 8 additions & 10 deletions bin/reth-bench/src/bench/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
use crate::{authenticated_transport::AuthenticatedTransportConnect, bench_mode::BenchMode};
use alloy_eips::BlockNumberOrTag;
use alloy_provider::{network::AnyNetwork, Provider, ProviderBuilder, RootProvider};
use alloy_provider::{network::AnyNetwork, Provider, RootProvider};
use alloy_rpc_client::ClientBuilder;
use alloy_rpc_types_engine::JwtSecret;
use alloy_transport::BoxTransport;
use alloy_transport_http::Http;
use reqwest::{Client, Url};
use reqwest::Url;
use reth_node_core::args::BenchmarkArgs;
use tracing::info;

Expand All @@ -19,9 +17,9 @@ use tracing::info;
/// range of blocks, and the next block to fetch.
pub(crate) struct BenchContext {
/// The auth provider is used for engine API queries.
pub(crate) auth_provider: RootProvider<BoxTransport, AnyNetwork>,
pub(crate) auth_provider: RootProvider<AnyNetwork>,
/// The block provider is used for block queries.
pub(crate) block_provider: RootProvider<Http<Client>, AnyNetwork>,
pub(crate) block_provider: RootProvider<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 @@ -43,8 +41,8 @@ impl BenchContext {
}

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

// If neither `--from` nor `--to` are provided, we will run the benchmark continuously,
// starting at the latest block.
Expand All @@ -68,8 +66,8 @@ impl BenchContext {
// construct the authed transport
info!("Connecting to Engine RPC at {} for replay", auth_url);
let auth_transport = AuthenticatedTransportConnect::new(auth_url, jwt);
let client = ClientBuilder::default().connect_boxed(auth_transport).await?;
let auth_provider = RootProvider::<_, AnyNetwork>::new(client);
let client = ClientBuilder::default().connect_with(auth_transport).await?;
let auth_provider = RootProvider::<AnyNetwork>::new(client);

let first_block = match benchmark_mode {
BenchMode::Continuous => {
Expand Down
13 changes: 6 additions & 7 deletions bin/reth-bench/src/valid_payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ use alloy_rpc_types_engine::{
ExecutionPayload, ExecutionPayloadInputV2, ExecutionPayloadV1, ExecutionPayloadV3,
ForkchoiceState, ForkchoiceUpdated, PayloadAttributes, PayloadStatus,
};
use alloy_transport::{Transport, TransportResult};
use alloy_transport::TransportResult;
use reth_node_api::EngineApiMessageVersion;
use tracing::error;

/// An extension trait for providers that implement the engine API, to wait for a VALID response.
#[async_trait::async_trait]
pub trait EngineApiValidWaitExt<N, T>: Send + Sync {
pub trait EngineApiValidWaitExt<N>: Send + Sync {
/// Calls `engine_newPayloadV1` with the given [ExecutionPayloadV1], and waits until the
/// response is VALID.
async fn new_payload_v1_wait(
Expand Down Expand Up @@ -64,11 +64,10 @@ pub trait EngineApiValidWaitExt<N, T>: Send + Sync {
}

#[async_trait::async_trait]
impl<T, N, P> EngineApiValidWaitExt<N, T> for P
impl<N, P> EngineApiValidWaitExt<N> for P
where
N: Network,
T: Transport + Clone,
P: EngineApi<N, T>,
P: EngineApi<N>,
{
async fn new_payload_v1_wait(
&self,
Expand Down Expand Up @@ -208,7 +207,7 @@ where
///
/// # Panics
/// If the given payload is a V3 payload, but a parent beacon block root is provided as `None`.
pub(crate) async fn call_new_payload<N, T, P: EngineApiValidWaitExt<N, T>>(
pub(crate) async fn call_new_payload<N, P: EngineApiValidWaitExt<N>>(
provider: P,
payload: ExecutionPayload,
parent_beacon_block_root: Option<B256>,
Expand Down Expand Up @@ -246,7 +245,7 @@ pub(crate) async fn call_new_payload<N, T, P: EngineApiValidWaitExt<N, T>>(
/// Calls the correct `engine_forkchoiceUpdated` method depending on the given
/// `EngineApiMessageVersion`, using the provided forkchoice state and payload attributes for the
/// actual engine api message call.
pub(crate) async fn call_forkchoice_updated<N, T, P: EngineApiValidWaitExt<N, T>>(
pub(crate) async fn call_forkchoice_updated<N, P: EngineApiValidWaitExt<N>>(
provider: P,
message_version: EngineApiMessageVersion,
forkchoice_state: ForkchoiceState,
Expand Down
8 changes: 3 additions & 5 deletions crates/chainspec/src/spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ use alloy_consensus::{
Header,
};
use alloy_eips::{
eip1559::INITIAL_BASE_FEE,
eip6110::MAINNET_DEPOSIT_CONTRACT_ADDRESS,
eip7685::EMPTY_REQUESTS_HASH,
eip7840::{BlobParams, BlobScheduleItem},
eip1559::INITIAL_BASE_FEE, eip6110::MAINNET_DEPOSIT_CONTRACT_ADDRESS,
eip7685::EMPTY_REQUESTS_HASH, eip7840::BlobParams,
};
use alloy_genesis::Genesis;
use alloy_primitives::{address, b256, Address, BlockNumber, B256, U256};
Expand Down Expand Up @@ -174,7 +172,7 @@ pub struct HardforkBlobParams {
impl HardforkBlobParams {
/// Constructs params for chainspec from a provided blob schedule.
/// Falls back to defaults if the schedule is empty.
pub fn from_schedule(blob_schedule: &BTreeMap<String, BlobScheduleItem>) -> Self {
pub fn from_schedule(blob_schedule: &BTreeMap<String, BlobParams>) -> Self {
let extract = |key: &str, default: fn() -> BlobParams| {
blob_schedule
.get(key)
Expand Down
4 changes: 2 additions & 2 deletions crates/cli/commands/src/test_vectors/compact.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ where
let type_name = type_name::<T>();
print!("{}", &type_name);

let mut bytes = std::iter::repeat(0u8).take(256).collect::<Vec<u8>>();
let mut bytes = std::iter::repeat_n(0u8, 256).collect::<Vec<u8>>();
let mut compact_buffer = vec![];

let mut values = Vec::with_capacity(VECTOR_SIZE);
Expand All @@ -215,7 +215,7 @@ where
Err(err) => {
if tries < 5 && matches!(err, arbitrary::Error::NotEnoughData) {
tries += 1;
bytes.extend(std::iter::repeat(0u8).take(256));
bytes.extend(std::iter::repeat_n(0u8, 256));
} else {
return Err(err)?
}
Expand Down
Loading

0 comments on commit 5322877

Please sign in to comment.