From cab9bb1f5a6a2795ae170b6ae9c6da5d1fc4c52b Mon Sep 17 00:00:00 2001 From: rakita Date: Sat, 10 Aug 2024 01:40:55 +0200 Subject: [PATCH] path to latest alloy-eips --- Cargo.lock | 21 +++++++++++++------ Cargo.toml | 3 +++ .../revm/src/handler/mainnet/pre_execution.rs | 10 ++++----- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ca07789f60..4ec8b82dd8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -63,7 +63,7 @@ dependencies = [ "alloy-eips", "alloy-primitives", "alloy-rlp", - "alloy-serde", + "alloy-serde 0.2.0", "c-kzg", "serde", ] @@ -71,12 +71,11 @@ dependencies = [ [[package]] name = "alloy-eips" version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9431c99a3b3fe606ede4b3d4043bdfbcb780c45b8d8d226c3804e2b75cfbe68" +source = "git+https://github.com/alloy-rs/alloy?rev=fd159f6#fd159f6985058d2480fb89f63315e35680a07956" dependencies = [ "alloy-primitives", "alloy-rlp", - "alloy-serde", + "alloy-serde 0.2.1", "arbitrary", "c-kzg", "k256", @@ -110,7 +109,7 @@ dependencies = [ "alloy-json-rpc", "alloy-primitives", "alloy-rpc-types-eth", - "alloy-serde", + "alloy-serde 0.2.0", "alloy-signer", "alloy-sol-types", "async-trait", @@ -231,7 +230,7 @@ dependencies = [ "alloy-eips", "alloy-primitives", "alloy-rlp", - "alloy-serde", + "alloy-serde 0.2.0", "alloy-sol-types", "itertools 0.13.0", "serde", @@ -244,6 +243,16 @@ name = "alloy-serde" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "15c5b9057acc02aee1b8aac2b5a0729cb0f73d080082c111313e5d1f92a96630" +dependencies = [ + "alloy-primitives", + "serde", + "serde_json", +] + +[[package]] +name = "alloy-serde" +version = "0.2.1" +source = "git+https://github.com/alloy-rs/alloy?rev=fd159f6#fd159f6985058d2480fb89f63315e35680a07956" dependencies = [ "alloy-primitives", "arbitrary", diff --git a/Cargo.toml b/Cargo.toml index 426d6e403f..7a9e558994 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,3 +22,6 @@ debug = true [profile.ethtests] inherits = "test" opt-level = 3 + +[patch.crates-io] +alloy-eips = { git = "https://github.com/alloy-rs/alloy", rev = "fd159f6" } \ No newline at end of file diff --git a/crates/revm/src/handler/mainnet/pre_execution.rs b/crates/revm/src/handler/mainnet/pre_execution.rs index eadb004f02..c0a32ceb18 100644 --- a/crates/revm/src/handler/mainnet/pre_execution.rs +++ b/crates/revm/src/handler/mainnet/pre_execution.rs @@ -121,8 +121,8 @@ pub fn apply_eip7702_auth_list( }; // 2. Verify the chain id is either 0 or the chain's current ID. - if authorization.chain_id() != 0 - && authorization.chain_id() != context.evm.inner.env.cfg.chain_id + if !authorization.chain_id().is_zero() + && authorization.chain_id() != U256::from(context.evm.inner.env.cfg.chain_id) { continue; } @@ -146,10 +146,8 @@ pub fn apply_eip7702_auth_list( // 4. If nonce list item is length one, verify the nonce of authority is equal to nonce. // // In case of signer setting its own delegation nonce will be bumped twice - if let Some(nonce) = authorization.nonce() { - if nonce != authority_acc.info.nonce { - continue; - } + if authorization.nonce() != authority_acc.info.nonce { + continue; } // 5. Refund the sender PER_EMPTY_ACCOUNT_COST - PER_AUTH_BASE_COST gas if authority exists in the trie.