Skip to content

Commit

Permalink
feat: bump alloy (#12930)
Browse files Browse the repository at this point in the history
Co-authored-by: Ryan Schneider <[email protected]>
  • Loading branch information
klkvr and ryanschneider authored Dec 2, 2024
1 parent 890f082 commit 7f88e62
Show file tree
Hide file tree
Showing 41 changed files with 385 additions and 203 deletions.
174 changes: 104 additions & 70 deletions Cargo.lock

Large diffs are not rendered by default.

131 changes: 66 additions & 65 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ reth-trie-sparse = { path = "crates/trie/sparse" }

# revm
revm = { version = "18.0.0", features = ["std"], default-features = false }
revm-inspectors = "0.11.0"
revm-inspectors = "0.12.0"
revm-primitives = { version = "14.0.0", features = [
"std",
], default-features = false }
Expand All @@ -436,46 +436,46 @@ alloy-rlp = { version = "0.3.4", default-features = false }
alloy-sol-types = "0.8.11"
alloy-trie = { version = "0.7", default-features = false }

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

# op
op-alloy-rpc-types = "0.6.7"
op-alloy-rpc-types-engine = "0.6.7"
op-alloy-network = "0.6.7"
op-alloy-consensus = "0.6.7"
op-alloy-rpc-types = "0.7.1"
op-alloy-rpc-types-engine = "0.7.1"
op-alloy-network = "0.7.1"
op-alloy-consensus = "0.7.1"

# misc
aquamarine = "0.6"
Expand Down Expand Up @@ -611,35 +611,36 @@ tikv-jemalloc-ctl = "0.6"
tikv-jemallocator = "0.6"
tracy-client = "0.17.3"

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

#op-alloy-consensus = { git = "https://github.com/alloy-rs/op-alloy", rev = "6a042e7681b1" }
#op-alloy-network = { git = "https://github.com/alloy-rs/op-alloy", rev = "6a042e7681b1" }
#op-alloy-rpc-types = { git = "https://github.com/alloy-rs/op-alloy", rev = "6a042e7681b1" }
#op-alloy-rpc-types-engine = { git = "https://github.com/alloy-rs/op-alloy", rev = "6a042e7681b1" }
# [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" }
2 changes: 2 additions & 0 deletions bin/reth/src/commands/debug_cmd/build_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ impl<C: ChainSpecParser<ChainSpec = ChainSpec>> Command<C> {
suggested_fee_recipient: self.suggested_fee_recipient,
// TODO: add support for withdrawals
withdrawals: None,
target_blobs_per_block: None,
max_blobs_per_block: None,
};
let payload_config = PayloadConfig::new(
Arc::new(SealedHeader::new(best_block.header().clone(), best_block.hash())),
Expand Down
4 changes: 2 additions & 2 deletions crates/chain-state/src/in_memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ use reth_chainspec::ChainInfo;
use reth_execution_types::{Chain, ExecutionOutcome};
use reth_metrics::{metrics::Gauge, Metrics};
use reth_primitives::{
BlockWithSenders, EthPrimitives, HeaderExt, NodePrimitives, Receipts, SealedBlock,
SealedBlockFor, SealedBlockWithSenders, SealedHeader, TransactionMeta,
BlockWithSenders, EthPrimitives, NodePrimitives, Receipts, SealedBlock, SealedBlockFor,
SealedBlockWithSenders, SealedHeader, TransactionMeta,
};
use reth_primitives_traits::{Block, BlockBody as _, SignedTransaction};
use reth_storage_api::StateProviderBox;
Expand Down
3 changes: 2 additions & 1 deletion crates/consensus/common/src/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,8 @@ mod tests {
blob_gas_used: None,
excess_blob_gas: None,
parent_beacon_block_root: None,
requests_hash: None
requests_hash: None,
target_blobs_per_block: None,
};
// size: 0x9b5

Expand Down
2 changes: 2 additions & 0 deletions crates/engine/local/src/payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ where
.chain_spec
.is_cancun_active_at_timestamp(timestamp)
.then(B256::random),
target_blobs_per_block: None,
max_blobs_per_block: None,
}
}
}
Expand Down
1 change: 1 addition & 0 deletions crates/engine/util/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ workspace = true
# reth
reth-primitives.workspace = true
reth-errors.workspace = true
reth-consensus-common.workspace = true
reth-fs-util.workspace = true
reth-rpc-types-compat.workspace = true
reth-engine-primitives.workspace = true
Expand Down
3 changes: 2 additions & 1 deletion crates/engine/util/src/reorg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -415,11 +415,12 @@ where
transactions_root: proofs::calculate_transaction_root(&transactions),
receipts_root: outcome.receipts_root_slow(reorg_target.header.number).unwrap(),
logs_bloom: outcome.block_logs_bloom(reorg_target.header.number).unwrap(),
requests_hash: None, // TODO(prague)
gas_used: cumulative_gas_used,
blob_gas_used: blob_gas_used.map(Into::into),
excess_blob_gas: excess_blob_gas.map(Into::into),
state_root: state_provider.state_root(hashed_state)?,
requests_hash: None, // TODO(prague)
target_blobs_per_block: None, // TODO(prague)
},
body: BlockBody {
transactions,
Expand Down
6 changes: 6 additions & 0 deletions crates/ethereum/engine-primitives/src/payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,8 @@ mod tests {
.unwrap(),
withdrawals: None,
parent_beacon_block_root: None,
target_blobs_per_block: None,
max_blobs_per_block: None,
};

// Verify that the generated payload ID matches the expected value
Expand Down Expand Up @@ -369,6 +371,8 @@ mod tests {
},
]),
parent_beacon_block_root: None,
target_blobs_per_block: None,
max_blobs_per_block: None,
};

// Verify that the generated payload ID matches the expected value
Expand Down Expand Up @@ -401,6 +405,8 @@ mod tests {
)
.unwrap(),
),
target_blobs_per_block: None,
max_blobs_per_block: None,
};

// Verify that the generated payload ID matches the expected value
Expand Down
15 changes: 10 additions & 5 deletions crates/ethereum/evm/src/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::{
dao_fork::{DAO_HARDFORK_BENEFICIARY, DAO_HARDKFORK_ACCOUNTS},
EthEvmConfig,
};
use alloc::{boxed::Box, sync::Arc, vec, vec::Vec};
use alloc::{boxed::Box, sync::Arc, vec::Vec};
use alloy_consensus::Transaction as _;
use alloy_eips::eip7685::Requests;
use core::fmt::Display;
Expand Down Expand Up @@ -232,7 +232,12 @@ where
let deposit_requests =
crate::eip6110::parse_deposits_from_receipts(&self.chain_spec, receipts)?;

let mut requests = Requests::new(vec![deposit_requests]);
let mut requests = Requests::default();

if !deposit_requests.is_empty() {
requests.push_request(core::iter::once(0).chain(deposit_requests).collect());
}

requests.extend(self.system_caller.apply_post_execution_changes(&mut evm)?);
requests
} else {
Expand Down Expand Up @@ -1127,9 +1132,9 @@ mod tests {
let receipt = receipts.first().unwrap();
assert!(receipt.success);

assert!(requests[0].is_empty(), "there should be no deposits");
assert!(!requests[1].is_empty(), "there should be a withdrawal");
assert!(requests[2].is_empty(), "there should be no consolidations");
// There should be exactly one entry with withdrawal requests
assert_eq!(requests.len(), 1);
assert_eq!(requests[0][0], 1);
}

#[test]
Expand Down
3 changes: 2 additions & 1 deletion crates/ethereum/node/tests/e2e/rpc.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::utils::eth_payload_attributes;
use alloy_eips::{calc_next_block_base_fee, eip2718::Encodable2718};
use alloy_eips::{calc_next_block_base_fee, eip2718::Encodable2718, eip4844};
use alloy_primitives::{Address, B256, U256};
use alloy_provider::{network::EthereumWallet, Provider, ProviderBuilder, SendableTx};
use alloy_rpc_types_beacon::relay::{
Expand Down Expand Up @@ -240,6 +240,7 @@ async fn test_flashbots_validate_v4() -> eyre::Result<()> {
execution_payload: block_to_payload_v3(payload.block().clone()),
blobs_bundle: BlobsBundleV1::new([]),
execution_requests: payload.requests().unwrap_or_default().to_vec(),
target_blobs_per_block: eip4844::TARGET_BLOBS_PER_BLOCK,
signature: Default::default(),
},
parent_beacon_block_root: attrs.parent_beacon_block_root.unwrap(),
Expand Down
2 changes: 2 additions & 0 deletions crates/ethereum/node/tests/e2e/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ pub(crate) fn eth_payload_attributes(timestamp: u64) -> EthPayloadBuilderAttribu
suggested_fee_recipient: Address::ZERO,
withdrawals: Some(vec![]),
parent_beacon_block_root: Some(B256::ZERO),
target_blobs_per_block: None,
max_blobs_per_block: None,
};
EthPayloadBuilderAttributes::new(B256::ZERO, attributes)
}
Expand Down
28 changes: 26 additions & 2 deletions crates/ethereum/payload/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
#![allow(clippy::useless_let_if_seq)]

use alloy_consensus::{Header, EMPTY_OMMER_ROOT_HASH};
use alloy_eips::{eip4844::MAX_DATA_GAS_PER_BLOCK, eip7685::Requests, merge::BEACON_NONCE};
use alloy_eips::{
eip4844::MAX_DATA_GAS_PER_BLOCK, eip7002::WITHDRAWAL_REQUEST_TYPE,
eip7251::CONSOLIDATION_REQUEST_TYPE, eip7685::Requests, merge::BEACON_NONCE,
};
use alloy_primitives::U256;
use reth_basic_payload_builder::{
commit_withdrawals, is_better_payload, BuildArguments, BuildOutcome, PayloadBuilder,
Expand Down Expand Up @@ -365,7 +368,27 @@ where
)
.map_err(|err| PayloadBuilderError::Internal(err.into()))?;

Some(Requests::new(vec![deposit_requests, withdrawal_requests, consolidation_requests]))
let mut requests = Requests::default();

if !deposit_requests.is_empty() {
requests.push_request(core::iter::once(0).chain(deposit_requests).collect());
}

if !withdrawal_requests.is_empty() {
requests.push_request(
core::iter::once(WITHDRAWAL_REQUEST_TYPE).chain(withdrawal_requests).collect(),
);
}

if !consolidation_requests.is_empty() {
requests.push_request(
core::iter::once(CONSOLIDATION_REQUEST_TYPE)
.chain(consolidation_requests)
.collect(),
);
}

Some(requests)
} else {
None
};
Expand Down Expand Up @@ -452,6 +475,7 @@ where
blob_gas_used: blob_gas_used.map(Into::into),
excess_blob_gas: excess_blob_gas.map(Into::into),
requests_hash,
target_blobs_per_block: None,
};

let withdrawals = chain_spec
Expand Down
2 changes: 1 addition & 1 deletion crates/evm/execution-types/src/execution_outcome.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ impl<T> ExecutionOutcome<T> {
}
}

impl<T: Receipt> ExecutionOutcome<T> {
impl<T: Receipt<Log = Log>> ExecutionOutcome<T> {
/// Returns an iterator over all block logs.
pub fn logs(&self, block_number: BlockNumber) -> Option<impl Iterator<Item = &Log>> {
let index = self.block_number_to_index(block_number)?;
Expand Down
Loading

0 comments on commit 7f88e62

Please sign in to comment.