From 02404ad9758cf3625ded6d5fa409be47b5520fc2 Mon Sep 17 00:00:00 2001 From: Yash Atreya <44857776+yash-atreya@users.noreply.github.com> Date: Tue, 27 Aug 2024 17:02:01 +0530 Subject: [PATCH 1/3] chore: rm alloy-eips and bump primitives --- Cargo.lock | 95 ++++++++++++------- crates/primitives/Cargo.toml | 12 ++- crates/primitives/src/env/eip7702.rs | 2 +- crates/primitives/src/lib.rs | 2 +- .../revm/src/handler/mainnet/pre_execution.rs | 10 +- 5 files changed, 73 insertions(+), 48 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7e528a35ed..33bcd69162 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -61,27 +61,47 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f58047cc851e58c26224521d1ecda466e3d746ebca0274cd5427aa660a88c353" dependencies = [ "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-rlp", "alloy-serde", "c-kzg", "serde", ] +[[package]] +name = "alloy-eip2930" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0069cf0642457f87a01a014f6dc29d5d893cd4fd8fddf0c3cdfad1bb3ebafc41" +dependencies = [ + "alloy-primitives 0.8.0", + "alloy-rlp", + "serde", +] + +[[package]] +name = "alloy-eip7702" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37d319bb544ca6caeab58c39cea8921c55d924d4f68f2c60f24f914673f9a74a" +dependencies = [ + "alloy-primitives 0.8.0", + "alloy-rlp", + "k256", + "serde", +] + [[package]] name = "alloy-eips" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9431c99a3b3fe606ede4b3d4043bdfbcb780c45b8d8d226c3804e2b75cfbe68" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-rlp", "alloy-serde", - "arbitrary", "c-kzg", - "k256", "once_cell", - "rand", "serde", "sha2", ] @@ -92,7 +112,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e76a9feec2352c78545d1a37415699817bae8dc41654bd1bfe57d6cdd5433bd" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.7.7", "serde", "serde_json", "thiserror", @@ -108,7 +128,7 @@ dependencies = [ "alloy-consensus", "alloy-eips", "alloy-json-rpc", - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-rpc-types-eth", "alloy-serde", "alloy-signer", @@ -124,6 +144,28 @@ name = "alloy-primitives" version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ccb3ead547f4532bc8af961649942f0b9c16ee9226e26caa3f38420651cc0bf4" +dependencies = [ + "alloy-rlp", + "bytes", + "cfg-if", + "const-hex", + "derive_more", + "hex-literal", + "itoa", + "k256", + "keccak-asm", + "proptest", + "rand", + "ruint", + "serde", + "tiny-keccak", +] + +[[package]] +name = "alloy-primitives" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a767e59c86900dd7c3ce3ecef04f3ace5ac9631ee150beb8b7d22f7fa3bbb2d7" dependencies = [ "alloy-rlp", "arbitrary", @@ -132,7 +174,6 @@ dependencies = [ "const-hex", "derive_arbitrary", "derive_more", - "ethereum_ssz", "getrandom", "hex-literal", "itoa", @@ -157,7 +198,7 @@ dependencies = [ "alloy-eips", "alloy-json-rpc", "alloy-network", - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-rpc-client", "alloy-rpc-types-eth", "alloy-transport", @@ -229,7 +270,7 @@ checksum = "605fa8462732bb8fd0645a9941e12961e079d45ae6a44634c826f8229c187bdf" dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-rlp", "alloy-serde", "alloy-sol-types", @@ -245,8 +286,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "15c5b9057acc02aee1b8aac2b5a0729cb0f73d080082c111313e5d1f92a96630" dependencies = [ - "alloy-primitives", - "arbitrary", + "alloy-primitives 0.7.7", "serde", "serde_json", ] @@ -257,7 +297,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37f10592696f4ab8b687d5a8ab55e998a14ea0ca5f8eb20ad74a96ad671bb54a" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.7.7", "async-trait", "auto_impl", "elliptic-curve", @@ -318,7 +358,7 @@ version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a91ca40fa20793ae9c3841b83e74569d1cc9af29a2f5237314fd3452d51e38c7" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-sol-macro", "const-hex", "serde", @@ -390,9 +430,6 @@ name = "arbitrary" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" -dependencies = [ - "derive_arbitrary", -] [[package]] name = "ark-ff" @@ -1285,17 +1322,6 @@ dependencies = [ "uint", ] -[[package]] -name = "ethereum_ssz" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d3627f83d8b87b432a5fad9934b4565260722a141a2c40f371f8080adec9425" -dependencies = [ - "ethereum-types", - "itertools 0.10.5", - "smallvec", -] - [[package]] name = "ethers-contract" version = "2.0.14" @@ -1421,7 +1447,6 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" dependencies = [ - "arbitrary", "byteorder", "rand", "rustc-hex", @@ -2789,13 +2814,13 @@ dependencies = [ [[package]] name = "proptest-derive" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf16337405ca084e9c78985114633b6827711d22b9e6ef6c6c0d665eb3f0b6e" +checksum = "6ff7ff745a347b87471d859a377a9a404361e7efc2a971d73424a6d183c0fc77" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.70", ] [[package]] @@ -3075,8 +3100,9 @@ dependencies = [ name = "revm-primitives" version = "8.0.0" dependencies = [ - "alloy-eips", - "alloy-primitives", + "alloy-eip2930", + "alloy-eip7702", + "alloy-primitives 0.8.0", "auto_impl", "bitflags 2.6.0", "bitvec", @@ -4224,7 +4250,6 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" dependencies = [ - "arbitrary", "byteorder", "crunchy", "hex", diff --git a/crates/primitives/Cargo.toml b/crates/primitives/Cargo.toml index 8dadd07554..87e13732a5 100644 --- a/crates/primitives/Cargo.toml +++ b/crates/primitives/Cargo.toml @@ -22,8 +22,11 @@ rust_2018_idioms = "deny" all = "warn" [dependencies] -alloy-eips = { version = "0.2", default-features = false, features = ["k256"] } -alloy-primitives = { version = "0.7.7", default-features = false, features = [ +alloy-eip7702 = { version = "0.1", default-features = false, features = [ + "k256", +] } +alloy-eip2930 = { version = "0.1", default-features = false } +alloy-primitives = { version = "0.8.0", default-features = false, features = [ "rlp", ] } hashbrown = "0.14" @@ -59,7 +62,6 @@ hex = { version = "0.4", default-features = false } default = ["std", "c-kzg", "portable"] std = [ "serde?/std", - "alloy-eips/std", "alloy-primitives/std", "hex/std", "bitvec/std", @@ -68,7 +70,8 @@ std = [ hashbrown = [] serde = [ "dep:serde", - "alloy-eips/serde", + "alloy-eip7702/serde", + "alloy-eip2930/serde", "alloy-primitives/serde", "hex/serde", "hashbrown/serde", @@ -79,7 +82,6 @@ serde = [ ] arbitrary = [ "std", - "alloy-eips/arbitrary", "alloy-primitives/arbitrary", "bitflags/arbitrary", ] diff --git a/crates/primitives/src/env/eip7702.rs b/crates/primitives/src/env/eip7702.rs index c5f888b665..7e785c98b9 100644 --- a/crates/primitives/src/env/eip7702.rs +++ b/crates/primitives/src/env/eip7702.rs @@ -1,4 +1,4 @@ -pub use alloy_eips::eip7702::{Authorization, SignedAuthorization}; +pub use alloy_eip7702::{Authorization, SignedAuthorization}; pub use alloy_primitives::Signature; use crate::Address; diff --git a/crates/primitives/src/lib.rs b/crates/primitives/src/lib.rs index e29efe9b12..4d981675a3 100644 --- a/crates/primitives/src/lib.rs +++ b/crates/primitives/src/lib.rs @@ -19,7 +19,7 @@ pub mod result; pub mod specification; pub mod state; pub mod utilities; -pub use alloy_eips::eip2930::{AccessList, AccessListItem}; +pub use alloy_eip2930::{AccessList, AccessListItem}; pub use alloy_primitives::{ self, address, b256, bytes, fixed_bytes, hex, hex_literal, ruint, uint, Address, Bytes, FixedBytes, Log, LogData, TxKind, B256, I256, U256, diff --git a/crates/revm/src/handler/mainnet/pre_execution.rs b/crates/revm/src/handler/mainnet/pre_execution.rs index 8d04986de8..87d0dceb54 100644 --- a/crates/revm/src/handler/mainnet/pre_execution.rs +++ b/crates/revm/src/handler/mainnet/pre_execution.rs @@ -60,8 +60,8 @@ pub fn load_accounts( }; // 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() != U256::ZERO + && authorization.chain_id() != U256::from(context.evm.inner.env.cfg.chain_id) { continue; } @@ -81,10 +81,8 @@ pub fn load_accounts( } // 4. If nonce list item is length one, verify the nonce of authority is equal to nonce. - if let Some(nonce) = authorization.nonce() { - if nonce != authority_acc.info.nonce { - continue; - } + if authorization.nonce() != authority_acc.info.nonce { + continue; } // warm code account and get the code. From afa435516a65a94dbc9eaec0548965305bf25751 Mon Sep 17 00:00:00 2001 From: Yash Atreya <44857776+yash-atreya@users.noreply.github.com> Date: Tue, 27 Aug 2024 17:16:42 +0530 Subject: [PATCH 2/3] bump alloy in dev deps --- Cargo.lock | 126 ++++++++++++++++++++++++++++++++++---- bins/revm-test/Cargo.toml | 6 +- crates/revm/Cargo.toml | 2 +- 3 files changed, 118 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 33bcd69162..f70850c346 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -106,6 +106,18 @@ dependencies = [ "sha2", ] +[[package]] +name = "alloy-json-abi" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "299d2a937b6c60968df3dad2a988b0f0e03277b344639a4f7a31bd68e6285e59" +dependencies = [ + "alloy-primitives 0.8.0", + "alloy-sol-type-parser", + "serde", + "serde_json", +] + [[package]] name = "alloy-json-rpc" version = "0.2.0" @@ -132,7 +144,7 @@ dependencies = [ "alloy-rpc-types-eth", "alloy-serde", "alloy-signer", - "alloy-sol-types", + "alloy-sol-types 0.7.7", "async-trait", "auto_impl", "futures-utils-wasm", @@ -273,7 +285,7 @@ dependencies = [ "alloy-primitives 0.7.7", "alloy-rlp", "alloy-serde", - "alloy-sol-types", + "alloy-sol-types 0.7.7", "itertools 0.13.0", "serde", "serde_json", @@ -311,8 +323,22 @@ version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b40397ddcdcc266f59f959770f601ce1280e699a91fc1862f29cef91707cd09" dependencies = [ - "alloy-sol-macro-expander", - "alloy-sol-macro-input", + "alloy-sol-macro-expander 0.7.7", + "alloy-sol-macro-input 0.7.7", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.70", +] + +[[package]] +name = "alloy-sol-macro" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "183bcfc0f3291d9c41a3774172ee582fb2ce6eb6569085471d8f225de7bb86fc" +dependencies = [ + "alloy-sol-macro-expander 0.8.0", + "alloy-sol-macro-input 0.8.0", "proc-macro-error", "proc-macro2", "quote", @@ -325,7 +351,7 @@ version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "867a5469d61480fea08c7333ffeca52d5b621f5ca2e44f271b117ec1fc9a0525" dependencies = [ - "alloy-sol-macro-input", + "alloy-sol-macro-input 0.7.7", "const-hex", "heck 0.5.0", "indexmap", @@ -333,7 +359,25 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.70", - "syn-solidity", + "syn-solidity 0.7.7", + "tiny-keccak", +] + +[[package]] +name = "alloy-sol-macro-expander" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71c4d842beb7a6686d04125603bc57614d5ed78bf95e4753274db3db4ba95214" +dependencies = [ + "alloy-sol-macro-input 0.8.0", + "const-hex", + "heck 0.5.0", + "indexmap", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.70", + "syn-solidity 0.8.0", "tiny-keccak", ] @@ -349,7 +393,32 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.70", - "syn-solidity", + "syn-solidity 0.7.7", +] + +[[package]] +name = "alloy-sol-macro-input" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1306e8d3c9e6e6ecf7a39ffaf7291e73a5f655a2defd366ee92c2efebcdf7fee" +dependencies = [ + "const-hex", + "dunce", + "heck 0.5.0", + "proc-macro2", + "quote", + "syn 2.0.70", + "syn-solidity 0.8.0", +] + +[[package]] +name = "alloy-sol-type-parser" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4691da83dce9c9b4c775dd701c87759f173bd3021cbf2e60cde00c5fe6d7241" +dependencies = [ + "serde", + "winnow 0.6.18", ] [[package]] @@ -359,7 +428,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a91ca40fa20793ae9c3841b83e74569d1cc9af29a2f5237314fd3452d51e38c7" dependencies = [ "alloy-primitives 0.7.7", - "alloy-sol-macro", + "alloy-sol-macro 0.7.7", + "const-hex", +] + +[[package]] +name = "alloy-sol-types" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "577e262966e92112edbd15b1b2c0947cc434d6e8311df96d3329793fe8047da9" +dependencies = [ + "alloy-json-abi", + "alloy-primitives 0.8.0", + "alloy-sol-macro 0.8.0", "const-hex", "serde", ] @@ -3037,7 +3118,7 @@ version = "13.0.0" dependencies = [ "alloy-eips", "alloy-provider", - "alloy-sol-types", + "alloy-sol-types 0.8.0", "alloy-transport", "anyhow", "auto_impl", @@ -3120,8 +3201,8 @@ dependencies = [ name = "revm-test" version = "0.1.0" dependencies = [ - "alloy-sol-macro", - "alloy-sol-types", + "alloy-sol-macro 0.8.0", + "alloy-sol-types 0.8.0", "bytes", "eyre", "hex", @@ -3857,6 +3938,18 @@ dependencies = [ "syn 2.0.70", ] +[[package]] +name = "syn-solidity" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "284c41c2919303438fcf8dede4036fd1e82d4fc0fbb2b279bd2a1442c909ca92" +dependencies = [ + "paste", + "proc-macro2", + "quote", + "syn 2.0.70", +] + [[package]] name = "sync_wrapper" version = "0.1.2" @@ -4123,7 +4216,7 @@ checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ "indexmap", "toml_datetime", - "winnow", + "winnow 0.5.40", ] [[package]] @@ -4655,6 +4748,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "winnow" +version = "0.6.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" +dependencies = [ + "memchr", +] + [[package]] name = "winreg" version = "0.50.0" diff --git a/bins/revm-test/Cargo.toml b/bins/revm-test/Cargo.toml index 0dd649091b..6139ee2eb5 100644 --- a/bins/revm-test/Cargo.toml +++ b/bins/revm-test/Cargo.toml @@ -7,10 +7,10 @@ edition = "2021" [dependencies] bytes = "1.7" hex = "0.4" -revm = { path = "../../crates/revm", version = "13.0.0", default-features=false } +revm = { path = "../../crates/revm", version = "13.0.0", default-features = false } microbench = "0.5" -alloy-sol-macro = "0.7.7" -alloy-sol-types = "0.7.7" +alloy-sol-macro = "0.8.0" +alloy-sol-types = "0.8.0" regex = "1.10.6" eyre = "0.6.12" diff --git a/crates/revm/Cargo.toml b/crates/revm/Cargo.toml index 2eaae45a32..8e111ad6db 100644 --- a/crates/revm/Cargo.toml +++ b/crates/revm/Cargo.toml @@ -54,7 +54,7 @@ alloy-eips = { version = "0.2", optional = true, default-features = false } alloy-transport = { version = "0.2", optional = true, default-features = false } [dev-dependencies] -alloy-sol-types = { version = "0.7.7", default-features = false, features = [ +alloy-sol-types = { version = "0.8.0", default-features = false, features = [ "std", ] } ethers-contract = { version = "2.0.14", default-features = false } From be485607c8ebd092a83eb21ff448d5f1e2fbd022 Mon Sep 17 00:00:00 2001 From: Yash Atreya <44857776+yash-atreya@users.noreply.github.com> Date: Wed, 28 Aug 2024 16:22:39 +0530 Subject: [PATCH 3/3] bump alloy to 0.3 --- Cargo.lock | 195 +++++++++++----------------------- crates/revm/Cargo.toml | 8 +- crates/revm/src/db/alloydb.rs | 7 +- 3 files changed, 70 insertions(+), 140 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f70850c346..038b205c82 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -56,12 +56,12 @@ dependencies = [ [[package]] name = "alloy-consensus" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f58047cc851e58c26224521d1ecda466e3d746ebca0274cd5427aa660a88c353" +checksum = "7198a527b4c4762cb88d54bcaeb0428f4298b72552c9c8ec4af614b4a4990c59" dependencies = [ "alloy-eips", - "alloy-primitives 0.7.7", + "alloy-primitives", "alloy-rlp", "alloy-serde", "c-kzg", @@ -74,7 +74,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0069cf0642457f87a01a014f6dc29d5d893cd4fd8fddf0c3cdfad1bb3ebafc41" dependencies = [ - "alloy-primitives 0.8.0", + "alloy-primitives", "alloy-rlp", "serde", ] @@ -85,7 +85,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37d319bb544ca6caeab58c39cea8921c55d924d4f68f2c60f24f914673f9a74a" dependencies = [ - "alloy-primitives 0.8.0", + "alloy-primitives", "alloy-rlp", "k256", "serde", @@ -93,11 +93,13 @@ dependencies = [ [[package]] name = "alloy-eips" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9431c99a3b3fe606ede4b3d4043bdfbcb780c45b8d8d226c3804e2b75cfbe68" +checksum = "159eab0e4e15b88571f55673af37314f4b8f17630dc1b393c3d70f2128a1d494" dependencies = [ - "alloy-primitives 0.7.7", + "alloy-eip2930", + "alloy-eip7702", + "alloy-primitives", "alloy-rlp", "alloy-serde", "c-kzg", @@ -112,7 +114,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "299d2a937b6c60968df3dad2a988b0f0e03277b344639a4f7a31bd68e6285e59" dependencies = [ - "alloy-primitives 0.8.0", + "alloy-primitives", "alloy-sol-type-parser", "serde", "serde_json", @@ -120,11 +122,12 @@ dependencies = [ [[package]] name = "alloy-json-rpc" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e76a9feec2352c78545d1a37415699817bae8dc41654bd1bfe57d6cdd5433bd" +checksum = "f7733446dd531f8eb877331fea02f6c40bdbb47444a17dc3464bf75319cc073a" dependencies = [ - "alloy-primitives 0.7.7", + "alloy-primitives", + "alloy-sol-types", "serde", "serde_json", "thiserror", @@ -133,18 +136,19 @@ dependencies = [ [[package]] name = "alloy-network" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3223d71dc78f464b2743418d0be8b5c894313e272105a6206ad5e867d67b3ce2" +checksum = "b80851d1697fc4fa2827998e3ee010a3d1fc59c7d25e87070840169fcf465832" dependencies = [ "alloy-consensus", "alloy-eips", "alloy-json-rpc", - "alloy-primitives 0.7.7", + "alloy-network-primitives", + "alloy-primitives", "alloy-rpc-types-eth", "alloy-serde", "alloy-signer", - "alloy-sol-types 0.7.7", + "alloy-sol-types", "async-trait", "auto_impl", "futures-utils-wasm", @@ -152,25 +156,14 @@ dependencies = [ ] [[package]] -name = "alloy-primitives" -version = "0.7.7" +name = "alloy-network-primitives" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccb3ead547f4532bc8af961649942f0b9c16ee9226e26caa3f38420651cc0bf4" +checksum = "d76a2336889f3d0624b18213239d27f4f34eb476eb35bef22f6a8cc24e0c0078" dependencies = [ - "alloy-rlp", - "bytes", - "cfg-if", - "const-hex", - "derive_more", - "hex-literal", - "itoa", - "k256", - "keccak-asm", - "proptest", - "rand", - "ruint", + "alloy-primitives", + "alloy-serde", "serde", - "tiny-keccak", ] [[package]] @@ -201,16 +194,17 @@ dependencies = [ [[package]] name = "alloy-provider" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29da7457d853cb8199ec04b227d5d2ef598be3e59fc2bbad70c8be213292f32" +checksum = "f2d2a195caa6707f5ce13905794865765afc6d9ea92c3a56e3a973c168d703bc" dependencies = [ "alloy-chains", "alloy-consensus", "alloy-eips", "alloy-json-rpc", "alloy-network", - "alloy-primitives 0.7.7", + "alloy-network-primitives", + "alloy-primitives", "alloy-rpc-client", "alloy-rpc-types-eth", "alloy-transport", @@ -226,6 +220,7 @@ dependencies = [ "reqwest 0.12.5", "serde", "serde_json", + "thiserror", "tokio", "tracing", "url", @@ -255,9 +250,9 @@ dependencies = [ [[package]] name = "alloy-rpc-client" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8a9e609524fa31c2c70eb24c0da60796809193ad4787a6dfe6d0db0d3ac112d" +checksum = "ed31cdba2b23d71c555505b06674f8e7459496abfd7f4875d268434ef5a99ee6" dependencies = [ "alloy-json-rpc", "alloy-transport", @@ -276,16 +271,17 @@ dependencies = [ [[package]] name = "alloy-rpc-types-eth" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "605fa8462732bb8fd0645a9941e12961e079d45ae6a44634c826f8229c187bdf" +checksum = "c0ba05d6ee4db0d89113294a614137940f79abfc2c40a9a3bee2995660358776" dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives 0.7.7", + "alloy-network-primitives", + "alloy-primitives", "alloy-rlp", "alloy-serde", - "alloy-sol-types 0.7.7", + "alloy-sol-types", "itertools 0.13.0", "serde", "serde_json", @@ -294,22 +290,22 @@ dependencies = [ [[package]] name = "alloy-serde" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15c5b9057acc02aee1b8aac2b5a0729cb0f73d080082c111313e5d1f92a96630" +checksum = "bfd260ede54f0b53761fdd04133acc10ae70427f66a69aa9590529bbd066cd58" dependencies = [ - "alloy-primitives 0.7.7", + "alloy-primitives", "serde", "serde_json", ] [[package]] name = "alloy-signer" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37f10592696f4ab8b687d5a8ab55e998a14ea0ca5f8eb20ad74a96ad671bb54a" +checksum = "7b5193ee6b370b89db154d7dc40c6a8e6ce11213865baaf2b418a9f2006be762" dependencies = [ - "alloy-primitives 0.7.7", + "alloy-primitives", "async-trait", "auto_impl", "elliptic-curve", @@ -317,59 +313,27 @@ dependencies = [ "thiserror", ] -[[package]] -name = "alloy-sol-macro" -version = "0.7.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b40397ddcdcc266f59f959770f601ce1280e699a91fc1862f29cef91707cd09" -dependencies = [ - "alloy-sol-macro-expander 0.7.7", - "alloy-sol-macro-input 0.7.7", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 2.0.70", -] - [[package]] name = "alloy-sol-macro" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "183bcfc0f3291d9c41a3774172ee582fb2ce6eb6569085471d8f225de7bb86fc" dependencies = [ - "alloy-sol-macro-expander 0.8.0", - "alloy-sol-macro-input 0.8.0", + "alloy-sol-macro-expander", + "alloy-sol-macro-input", "proc-macro-error", "proc-macro2", "quote", "syn 2.0.70", ] -[[package]] -name = "alloy-sol-macro-expander" -version = "0.7.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "867a5469d61480fea08c7333ffeca52d5b621f5ca2e44f271b117ec1fc9a0525" -dependencies = [ - "alloy-sol-macro-input 0.7.7", - "const-hex", - "heck 0.5.0", - "indexmap", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 2.0.70", - "syn-solidity 0.7.7", - "tiny-keccak", -] - [[package]] name = "alloy-sol-macro-expander" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71c4d842beb7a6686d04125603bc57614d5ed78bf95e4753274db3db4ba95214" dependencies = [ - "alloy-sol-macro-input 0.8.0", + "alloy-sol-macro-input", "const-hex", "heck 0.5.0", "indexmap", @@ -377,25 +341,10 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.70", - "syn-solidity 0.8.0", + "syn-solidity", "tiny-keccak", ] -[[package]] -name = "alloy-sol-macro-input" -version = "0.7.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e482dc33a32b6fadbc0f599adea520bd3aaa585c141a80b404d0a3e3fa72528" -dependencies = [ - "const-hex", - "dunce", - "heck 0.5.0", - "proc-macro2", - "quote", - "syn 2.0.70", - "syn-solidity 0.7.7", -] - [[package]] name = "alloy-sol-macro-input" version = "0.8.0" @@ -408,7 +357,7 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.70", - "syn-solidity 0.8.0", + "syn-solidity", ] [[package]] @@ -421,17 +370,6 @@ dependencies = [ "winnow 0.6.18", ] -[[package]] -name = "alloy-sol-types" -version = "0.7.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a91ca40fa20793ae9c3841b83e74569d1cc9af29a2f5237314fd3452d51e38c7" -dependencies = [ - "alloy-primitives 0.7.7", - "alloy-sol-macro 0.7.7", - "const-hex", -] - [[package]] name = "alloy-sol-types" version = "0.8.0" @@ -439,17 +377,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "577e262966e92112edbd15b1b2c0947cc434d6e8311df96d3329793fe8047da9" dependencies = [ "alloy-json-abi", - "alloy-primitives 0.8.0", - "alloy-sol-macro 0.8.0", + "alloy-primitives", + "alloy-sol-macro", "const-hex", "serde", ] [[package]] name = "alloy-transport" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d0590afbdacf2f8cca49d025a2466f3b6584a016a8b28f532f29f8da1007bae" +checksum = "454220c714857cf68af87d788d1f0638ad8766268b94f6a49fed96cbc2ab382c" dependencies = [ "alloy-json-rpc", "base64 0.22.1", @@ -466,9 +404,9 @@ dependencies = [ [[package]] name = "alloy-transport-http" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d8f1eefa8cb9e7550740ee330feba4fed303a77ad3085707546f9152a88c380" +checksum = "377f2353d7fea03a2dba6b9ffbb7d610402c040dd5700d1fae8b9ec2673eed9b" dependencies = [ "alloy-json-rpc", "alloy-transport", @@ -1152,11 +1090,12 @@ dependencies = [ [[package]] name = "dashmap" -version = "5.5.3" +version = "6.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" +checksum = "804c8821570c3f8b70230c2ba75ffa5c0f9a4189b9a432b6656c536712acae28" dependencies = [ "cfg-if", + "crossbeam-utils", "hashbrown", "lock_api", "once_cell", @@ -3118,7 +3057,7 @@ version = "13.0.0" dependencies = [ "alloy-eips", "alloy-provider", - "alloy-sol-types 0.8.0", + "alloy-sol-types", "alloy-transport", "anyhow", "auto_impl", @@ -3183,7 +3122,7 @@ version = "8.0.0" dependencies = [ "alloy-eip2930", "alloy-eip7702", - "alloy-primitives 0.8.0", + "alloy-primitives", "auto_impl", "bitflags 2.6.0", "bitvec", @@ -3201,8 +3140,8 @@ dependencies = [ name = "revm-test" version = "0.1.0" dependencies = [ - "alloy-sol-macro 0.8.0", - "alloy-sol-types 0.8.0", + "alloy-sol-macro", + "alloy-sol-types", "bytes", "eyre", "hex", @@ -3926,18 +3865,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "syn-solidity" -version = "0.7.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c837dc8852cb7074e46b444afb81783140dab12c58867b49fb3898fbafedf7ea" -dependencies = [ - "paste", - "proc-macro2", - "quote", - "syn 2.0.70", -] - [[package]] name = "syn-solidity" version = "0.8.0" diff --git a/crates/revm/Cargo.toml b/crates/revm/Cargo.toml index 8e111ad6db..f35eeb307e 100644 --- a/crates/revm/Cargo.toml +++ b/crates/revm/Cargo.toml @@ -49,9 +49,9 @@ ethers-providers = { version = "2.0", optional = true } ethers-core = { version = "2.0", optional = true } # alloydb -alloy-provider = { version = "0.2", optional = true, default-features = false } -alloy-eips = { version = "0.2", optional = true, default-features = false } -alloy-transport = { version = "0.2", optional = true, default-features = false } +alloy-provider = { version = "0.3", optional = true, default-features = false } +alloy-eips = { version = "0.3", optional = true, default-features = false } +alloy-transport = { version = "0.3", optional = true, default-features = false } [dev-dependencies] alloy-sol-types = { version = "0.8.0", default-features = false, features = [ @@ -64,7 +64,7 @@ indicatif = "0.17" reqwest = { version = "0.12" } rstest = "0.22.0" -alloy-provider = "0.2" +alloy-provider = "0.3" [features] default = ["std", "c-kzg", "secp256k1", "portable", "blst"] diff --git a/crates/revm/src/db/alloydb.rs b/crates/revm/src/db/alloydb.rs index 1caf4151be..f03685282f 100644 --- a/crates/revm/src/db/alloydb.rs +++ b/crates/revm/src/db/alloydb.rs @@ -3,7 +3,10 @@ use crate::{ primitives::{AccountInfo, Address, Bytecode, B256, U256}, }; use alloy_eips::BlockId; -use alloy_provider::{Network, Provider}; +use alloy_provider::{ + network::{BlockResponse, HeaderResponse}, + Network, Provider, +}; use alloy_transport::{Transport, TransportError}; use std::future::IntoFuture; use tokio::runtime::{Handle, Runtime}; @@ -129,7 +132,7 @@ impl> DatabaseRef for AlloyD .get_block_by_number(number.into(), false), )?; // SAFETY: If the number is given, the block is supposed to be finalized, so unwrapping is safe. - Ok(B256::new(*block.unwrap().header.hash.unwrap())) + Ok(B256::new(*block.unwrap().header().hash())) } fn code_by_hash_ref(&self, _code_hash: B256) -> Result {