From 295bab38ee2f5c8f005322fa1fe71bc13cc6d84a Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 12 Dec 2024 11:13:57 -0500 Subject: [PATCH] feat: bump alloy to 0.7.3. (#930) --- Cargo.lock | 481 +++++++++++++------ Cargo.toml | 34 +- Makefile | 4 + crates/builder/src/transaction_tracker.rs | 36 +- crates/pool/Cargo.toml | 1 + crates/pool/src/chain.rs | 7 +- crates/provider/src/alloy/entry_point/mod.rs | 8 +- crates/rpc/Cargo.toml | 2 + crates/rpc/src/eth/api.rs | 28 +- crates/rpc/src/eth/events/common.rs | 11 +- crates/rpc/src/eth/events/mod.rs | 1 - 11 files changed, 414 insertions(+), 199 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a9c69f42c..c7c59c694 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -57,25 +57,40 @@ dependencies = [ [[package]] name = "alloy-consensus" -version = "0.4.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "705687d5bfd019fee57cf9e206b27b30a9a9617535d5590a02b171e813208f8e" +checksum = "a101d4d016f47f13890a74290fdd17b05dd175191d9337bc600791fb96e4dea8" dependencies = [ "alloy-eips", "alloy-primitives", "alloy-rlp", - "alloy-serde", + "alloy-serde 0.7.3", + "alloy-trie", "auto_impl", "c-kzg", "derive_more 1.0.0", "serde", ] +[[package]] +name = "alloy-consensus-any" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa60357dda9a3d0f738f18844bd6d0f4a5924cc5cf00bfad2ff1369897966123" +dependencies = [ + "alloy-consensus", + "alloy-eips", + "alloy-primitives", + "alloy-rlp", + "alloy-serde 0.7.3", + "serde", +] + [[package]] name = "alloy-contract" -version = "0.4.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "917f7d12cf3971dc8c11c9972f732b35ccb9aaaf5f28f2f87e9e6523bee3a8ad" +checksum = "2869e4fb31331d3b8c58c7db567d1e4e4e94ef64640beda3b6dd9b7045690941" dependencies = [ "alloy-dyn-abi", "alloy-json-abi", @@ -88,14 +103,14 @@ dependencies = [ "alloy-transport", "futures", "futures-util", - "thiserror", + "thiserror 2.0.6", ] [[package]] name = "alloy-dyn-abi" -version = "0.8.5" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b499852e1d0e9b8c6db0f24c48998e647c0d5762a01090f955106a7700e4611" +checksum = "41056bde53ae10ffbbf11618efbe1e0290859e5eab0fe9ef82ebdb62f12a866f" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -121,26 +136,27 @@ dependencies = [ [[package]] name = "alloy-eip7702" -version = "0.1.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea59dc42102bc9a1905dc57901edc6dd48b9f38115df86c7d252acba70d71d04" +checksum = "4c986539255fb839d1533c128e190e557e52ff652c9ef62939e233a81dd93f7e" dependencies = [ "alloy-primitives", "alloy-rlp", + "derive_more 1.0.0", "serde", ] [[package]] name = "alloy-eips" -version = "0.4.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ffb906284a1e1f63c4607da2068c8197458a352d0b3e9796e67353d72a9be85" +checksum = "8b6755b093afef5925f25079dd5a7c8d096398b804ba60cb5275397b06b31689" dependencies = [ "alloy-eip2930", "alloy-eip7702", "alloy-primitives", "alloy-rlp", - "alloy-serde", + "alloy-serde 0.7.3", "c-kzg", "derive_more 1.0.0", "once_cell", @@ -155,15 +171,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8429cf4554eed9b40feec7f4451113e76596086447550275e3def933faf47ce3" dependencies = [ "alloy-primitives", - "alloy-serde", + "alloy-serde 0.4.2", + "serde", +] + +[[package]] +name = "alloy-genesis" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aeec8e6eab6e52b7c9f918748c9b811e87dbef7312a2e3a2ca1729a92966a6af" +dependencies = [ + "alloy-primitives", + "alloy-serde 0.7.3", + "alloy-trie", "serde", ] [[package]] name = "alloy-json-abi" -version = "0.8.5" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a438d4486b5d525df3b3004188f9d5cd1d65cd30ecc41e5a3ccef6f6342e8af9" +checksum = "c357da577dfb56998d01f574d81ad7a1958d248740a7981b205d69d65a7da404" dependencies = [ "alloy-primitives", "alloy-sol-type-parser", @@ -173,49 +201,53 @@ dependencies = [ [[package]] name = "alloy-json-rpc" -version = "0.4.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8fa8a1a3c4cbd221f2b8e3693aeb328fca79a757fe556ed08e47bbbc2a70db7" +checksum = "4fa077efe0b834bcd89ff4ba547f48fb081e4fdc3673dd7da1b295a2cf2bb7b7" dependencies = [ "alloy-primitives", "alloy-sol-types", "serde", "serde_json", - "thiserror", + "thiserror 2.0.6", "tracing", ] [[package]] name = "alloy-network" -version = "0.4.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85fa23a6a9d612b52e402c995f2d582c25165ec03ac6edf64c861a76bc5b87cd" +checksum = "209a1882a08e21aca4aac6e2a674dc6fcf614058ef8cb02947d63782b1899552" dependencies = [ "alloy-consensus", + "alloy-consensus-any", "alloy-eips", "alloy-json-rpc", "alloy-network-primitives", "alloy-primitives", + "alloy-rpc-types-any", "alloy-rpc-types-eth", - "alloy-serde", + "alloy-serde 0.7.3", "alloy-signer", "alloy-sol-types", "async-trait", "auto_impl", "futures-utils-wasm", - "thiserror", + "serde", + "serde_json", + "thiserror 2.0.6", ] [[package]] name = "alloy-network-primitives" -version = "0.4.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "801492711d4392b2ccf5fc0bc69e299fa1aab15167d74dcaa9aab96a54f684bd" +checksum = "c20219d1ad261da7a6331c16367214ee7ded41d001fabbbd656fbf71898b2773" dependencies = [ "alloy-consensus", "alloy-eips", "alloy-primitives", - "alloy-serde", + "alloy-serde 0.7.3", "serde", ] @@ -225,30 +257,48 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4f1334a738aa1710cb8227441b3fcc319202ce78e967ef37406940242df4a454" dependencies = [ - "alloy-genesis", + "alloy-genesis 0.4.2", + "alloy-primitives", + "k256", + "rand", + "serde_json", + "tempfile", + "thiserror 1.0.64", + "tracing", + "url", +] + +[[package]] +name = "alloy-node-bindings" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bffcf33dd319f21cd6f066d81cbdef0326d4bdaaf7cfe91110bc090707858e9f" +dependencies = [ + "alloy-genesis 0.7.3", "alloy-primitives", "k256", "rand", "serde_json", "tempfile", - "thiserror", + "thiserror 2.0.6", "tracing", "url", ] [[package]] name = "alloy-primitives" -version = "0.8.5" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "260d3ff3bff0bb84599f032a2f2c6828180b0ea0cd41fdaf44f39cef3ba41861" +checksum = "6259a506ab13e1d658796c31e6e39d2e2ee89243bcc505ddc613b35732e0a430" dependencies = [ "alloy-rlp", "bytes", "cfg-if", "const-hex", "derive_more 1.0.0", + "foldhash", "getrandom", - "hashbrown 0.14.5", + "hashbrown 0.15.2", "hex-literal", "indexmap 2.5.0", "itoa", @@ -266,9 +316,9 @@ dependencies = [ [[package]] name = "alloy-provider" -version = "0.4.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcfaa4ffec0af04e3555686b8aacbcdf7d13638133a0672749209069750f78a6" +checksum = "9eefa6f4c798ad01f9b4202d02cea75f5ec11fa180502f4701e2b47965a8c0bb" dependencies = [ "alloy-chains", "alloy-consensus", @@ -276,12 +326,14 @@ dependencies = [ "alloy-json-rpc", "alloy-network", "alloy-network-primitives", - "alloy-node-bindings", + "alloy-node-bindings 0.7.3", "alloy-primitives", "alloy-rpc-client", "alloy-rpc-types-anvil", + "alloy-rpc-types-debug", "alloy-rpc-types-eth", "alloy-rpc-types-trace", + "alloy-signer", "alloy-signer-local", "alloy-transport", "alloy-transport-http", @@ -292,21 +344,24 @@ dependencies = [ "futures", "futures-utils-wasm", "lru", + "parking_lot", "pin-project", "reqwest", + "schnellru", "serde", "serde_json", - "thiserror", + "thiserror 2.0.6", "tokio", "tracing", "url", + "wasmtimer", ] [[package]] name = "alloy-rlp" -version = "0.3.8" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26154390b1d205a4a7ac7352aa2eb4f81f391399d4e2f546fb81a2f8bb383f62" +checksum = "f542548a609dca89fcd72b3b9f355928cf844d4363c5eed9c5273a3dd225e097" dependencies = [ "alloy-rlp-derive", "arrayvec", @@ -315,20 +370,20 @@ dependencies = [ [[package]] name = "alloy-rlp-derive" -version = "0.3.8" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d0f2d905ebd295e7effec65e5f6868d153936130ae718352771de3e7d03c75c" +checksum = "5a833d97bf8a5f0f878daf2c8451fff7de7f9de38baa5a45d936ec718d81255a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] name = "alloy-rpc-client" -version = "0.4.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "370143ed581aace6e663342d21d209c6b2e34ee6142f7d6675adb518deeaf0dc" +checksum = "ed30bf1041e84cabc5900f52978ca345dd9969f2194a945e6fdec25b0620705c" dependencies = [ "alloy-json-rpc", "alloy-primitives", @@ -344,31 +399,55 @@ dependencies = [ "tower 0.5.1", "tracing", "url", + "wasmtimer", ] [[package]] name = "alloy-rpc-types-anvil" -version = "0.4.2" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d33bc190844626c08e21897736dbd7956ab323c09e6f141b118d1c8b7aff689e" +dependencies = [ + "alloy-primitives", + "alloy-rpc-types-eth", + "alloy-serde 0.7.3", + "serde", +] + +[[package]] +name = "alloy-rpc-types-any" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d780adaa5d95b07ad92006b2feb68ecfa7e2015f7d5976ceaac4c906c73ebd07" +checksum = "200661999b6e235d9840be5d60a6e8ae2f0af9eb2a256dd378786744660e36ec" +dependencies = [ + "alloy-consensus-any", + "alloy-rpc-types-eth", + "alloy-serde 0.7.3", +] + +[[package]] +name = "alloy-rpc-types-debug" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0294b553785eb3fa7fff2e8aec45e82817258e7e6c9365c034a90cb6baeebc9" dependencies = [ "alloy-primitives", - "alloy-serde", "serde", ] [[package]] name = "alloy-rpc-types-eth" -version = "0.4.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413f4aa3ccf2c3e4234a047c5fa4727916d7daf25a89f9b765df0ba09784fd87" +checksum = "a0600b8b5e2dc0cab12cbf91b5a885c35871789fb7b3a57b434bd4fced5b7a8b" dependencies = [ "alloy-consensus", + "alloy-consensus-any", "alloy-eips", "alloy-network-primitives", "alloy-primitives", "alloy-rlp", - "alloy-serde", + "alloy-serde 0.7.3", "alloy-sol-types", "derive_more 1.0.0", "itertools 0.13.0", @@ -378,16 +457,16 @@ dependencies = [ [[package]] name = "alloy-rpc-types-trace" -version = "0.4.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "017cad3e5793c5613588c1f9732bcbad77e820ba7d0feaba3527749f856fdbc5" +checksum = "4e073ab0e67429c60be281e181731132fd07d82e091c10c29ace6935101034bb" dependencies = [ "alloy-primitives", "alloy-rpc-types-eth", - "alloy-serde", + "alloy-serde 0.7.3", "serde", "serde_json", - "thiserror", + "thiserror 2.0.6", ] [[package]] @@ -401,25 +480,36 @@ dependencies = [ "serde_json", ] +[[package]] +name = "alloy-serde" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9afa753a97002a33b2ccb707d9f15f31c81b8c1b786c95b73cc62bb1d1fd0c3f" +dependencies = [ + "alloy-primitives", + "serde", + "serde_json", +] + [[package]] name = "alloy-signer" -version = "0.4.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd4e0ad79c81a27ca659be5d176ca12399141659fef2bcbfdc848da478f4504" +checksum = "9b2cbff01a673936c2efd7e00d4c0e9a4dbbd6d600e2ce298078d33efbb19cd7" dependencies = [ "alloy-primitives", "async-trait", "auto_impl", "elliptic-curve", "k256", - "thiserror", + "thiserror 2.0.6", ] [[package]] name = "alloy-signer-aws" -version = "0.4.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "417e19d9844350d11f7426d4920a5df777f8c2abbb7a70d9de6f1faf284db15b" +checksum = "71ce77227fdb9059fd7a3b38a8679c0dae95d81886ee8c13ef8ad99d74866bbd" dependencies = [ "alloy-consensus", "alloy-network", @@ -429,15 +519,15 @@ dependencies = [ "aws-sdk-kms", "k256", "spki", - "thiserror", + "thiserror 2.0.6", "tracing", ] [[package]] name = "alloy-signer-local" -version = "0.4.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "494e0a256f3e99f2426f994bcd1be312c02cb8f88260088dacb33a8b8936475f" +checksum = "bd6d988cb6cd7d2f428a74476515b1a6e901e08c796767f9f93311ab74005c8b" dependencies = [ "alloy-consensus", "alloy-network", @@ -446,28 +536,28 @@ dependencies = [ "async-trait", "k256", "rand", - "thiserror", + "thiserror 2.0.6", ] [[package]] name = "alloy-sol-macro" -version = "0.8.5" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68e7f6e8fe5b443f82b3f1e15abfa191128f71569148428e49449d01f6f49e8b" +checksum = "d9d64f851d95619233f74b310f12bcf16e0cbc27ee3762b6115c14a84809280a" dependencies = [ "alloy-sol-macro-expander", "alloy-sol-macro-input", "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] name = "alloy-sol-macro-expander" -version = "0.8.5" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b96ce28d2fde09abb6135f410c41fad670a3a770b6776869bd852f1df102e6f" +checksum = "6bf7ed1574b699f48bf17caab4e6e54c6d12bc3c006ab33d58b1e227c1c3559f" dependencies = [ "alloy-json-abi", "alloy-sol-macro-input", @@ -477,16 +567,16 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", "syn-solidity", "tiny-keccak", ] [[package]] name = "alloy-sol-macro-input" -version = "0.8.5" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "906746396a8296537745711630d9185746c0b50c033d5e9d18b0a6eba3d53f90" +checksum = "8c02997ccef5f34f9c099277d4145f183b422938ed5322dc57a089fe9b9ad9ee" dependencies = [ "alloy-json-abi", "const-hex", @@ -495,15 +585,15 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.77", + "syn 2.0.90", "syn-solidity", ] [[package]] name = "alloy-sol-type-parser" -version = "0.8.5" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc85178909a49c8827ffccfc9103a7ce1767ae66a801b69bdc326913870bf8e6" +checksum = "ce13ff37285b0870d0a0746992a4ae48efaf34b766ae4c2640fa15e5305f8e73" dependencies = [ "serde", "winnow", @@ -511,9 +601,9 @@ dependencies = [ [[package]] name = "alloy-sol-types" -version = "0.8.5" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d86a533ce22525969661b25dfe296c112d35eb6861f188fd284f8bd4bb3842ae" +checksum = "1174cafd6c6d810711b4e00383037bdb458efc4fe3dbafafa16567e0320c54d8" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -524,9 +614,9 @@ dependencies = [ [[package]] name = "alloy-transport" -version = "0.4.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ac3e97dad3d31770db0fc89bd6a63b789fbae78963086733f960cf32c483904" +checksum = "d69d36982b9e46075ae6b792b0f84208c6c2c15ad49f6c500304616ef67b70e0" dependencies = [ "alloy-json-rpc", "base64 0.22.1", @@ -534,18 +624,19 @@ dependencies = [ "futures-utils-wasm", "serde", "serde_json", - "thiserror", + "thiserror 2.0.6", "tokio", "tower 0.5.1", "tracing", "url", + "wasmtimer", ] [[package]] name = "alloy-transport-http" -version = "0.4.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b367dcccada5b28987c2296717ee04b9a5637aacd78eacb1726ef211678b5212" +checksum = "2e02ffd5d93ffc51d72786e607c97de3b60736ca3e636ead0ec1f7dce68ea3fd" dependencies = [ "alloy-json-rpc", "alloy-transport", @@ -556,6 +647,22 @@ dependencies = [ "url", ] +[[package]] +name = "alloy-trie" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a5fd8fea044cc9a8c8a50bb6f28e31f0385d820f116c5b98f6f4e55d6e5590b" +dependencies = [ + "alloy-primitives", + "alloy-rlp", + "arrayvec", + "derive_more 1.0.0", + "nybbles", + "serde", + "smallvec", + "tracing", +] + [[package]] name = "android-tzdata" version = "0.1.1" @@ -755,6 +862,9 @@ name = "arrayvec" version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" +dependencies = [ + "serde", +] [[package]] name = "async-channel" @@ -911,7 +1021,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -928,7 +1038,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -945,7 +1055,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -1436,7 +1546,7 @@ dependencies = [ "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.77", + "syn 2.0.90", "which", ] @@ -1457,7 +1567,7 @@ dependencies = [ "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -1683,7 +1793,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -1752,9 +1862,9 @@ dependencies = [ [[package]] name = "const-hex" -version = "1.12.0" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94fb8a24a26d37e1ffd45343323dc9fe6654ceea44c12f2fcb3d7ac29e610bc6" +checksum = "4b0485bab839b018a8f1723fc5391819fea5f8f0f32288ef8a735fd096b6160c" dependencies = [ "cfg-if", "cpufeatures", @@ -1956,7 +2066,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -1967,7 +2077,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -2025,7 +2135,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version 0.4.1", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -2045,7 +2155,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", "unicode-xid", ] @@ -2157,7 +2267,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -2263,6 +2373,12 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foldhash" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" + [[package]] name = "form_urlencoded" version = "1.2.1" @@ -2374,7 +2490,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -2472,7 +2588,7 @@ dependencies = [ "pin-project", "serde", "serde_json", - "thiserror", + "thiserror 1.0.64", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", @@ -2578,6 +2694,15 @@ checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", "allocator-api2", +] + +[[package]] +name = "hashbrown" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +dependencies = [ + "foldhash", "serde", ] @@ -2717,7 +2842,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.10", + "socket2 0.5.7", "tokio", "tower-service", "tracing", @@ -2960,7 +3085,7 @@ dependencies = [ "combine", "jni-sys", "log", - "thiserror", + "thiserror 1.0.64", "walkdir", ] @@ -3034,7 +3159,7 @@ dependencies = [ "rustls-pki-types", "rustls-platform-verifier", "soketto", - "thiserror", + "thiserror 1.0.64", "tokio", "tokio-rustls 0.26.0", "tokio-util", @@ -3062,7 +3187,7 @@ dependencies = [ "rustc-hash 2.0.0", "serde", "serde_json", - "thiserror", + "thiserror 1.0.64", "tokio", "tokio-stream", "tracing", @@ -3087,7 +3212,7 @@ dependencies = [ "rustls-platform-verifier", "serde", "serde_json", - "thiserror", + "thiserror 1.0.64", "tokio", "tower 0.4.13", "tracing", @@ -3104,7 +3229,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -3126,7 +3251,7 @@ dependencies = [ "serde", "serde_json", "soketto", - "thiserror", + "thiserror 1.0.64", "tokio", "tokio-stream", "tokio-util", @@ -3143,7 +3268,7 @@ dependencies = [ "http 1.1.0", "serde", "serde_json", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -3236,7 +3361,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" dependencies = [ "cfg-if", - "windows-targets 0.48.5", + "windows-targets 0.52.6", ] [[package]] @@ -3361,7 +3486,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -3379,7 +3504,7 @@ dependencies = [ "metrics", "metrics-util", "quanta", - "thiserror", + "thiserror 1.0.64", "tokio", "tracing", ] @@ -3480,7 +3605,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -3581,7 +3706,18 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", +] + +[[package]] +name = "nybbles" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95f06be0417d97f81fe4e5c86d7d01b392655a9cac9c19a848aa033e18937b23" +dependencies = [ + "const-hex", + "serde", + "smallvec", ] [[package]] @@ -3713,7 +3849,7 @@ dependencies = [ "regex", "regex-syntax 0.8.4", "structmeta", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -3741,7 +3877,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd53dff83f26735fdc1ca837098ccf133605d794cdae66acfc2bfac3ec809d95" dependencies = [ "memchr", - "thiserror", + "thiserror 1.0.64", "ucd-trie", ] @@ -3765,7 +3901,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -3806,7 +3942,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -3927,7 +4063,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" dependencies = [ "proc-macro2", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -3969,14 +4105,14 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] @@ -4051,7 +4187,7 @@ dependencies = [ "prost", "prost-types", "regex", - "syn 2.0.77", + "syn 2.0.90", "tempfile", ] @@ -4065,7 +4201,7 @@ dependencies = [ "itertools 0.13.0", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -4111,7 +4247,7 @@ dependencies = [ "rustc-hash 2.0.0", "rustls 0.23.12", "socket2 0.5.7", - "thiserror", + "thiserror 1.0.64", "tokio", "tracing", ] @@ -4128,7 +4264,7 @@ dependencies = [ "rustc-hash 2.0.0", "rustls 0.23.12", "slab", - "thiserror", + "thiserror 1.0.64", "tinyvec", "tracing", ] @@ -4380,7 +4516,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -4395,7 +4531,7 @@ dependencies = [ "pin-project", "rayon", "reth-metrics", - "thiserror", + "thiserror 1.0.64", "tokio", "tracing", "tracing-futures", @@ -4472,7 +4608,7 @@ dependencies = [ "futures", "rand", "redis", - "thiserror", + "thiserror 1.0.64", "tokio", ] @@ -4593,7 +4729,7 @@ dependencies = [ "serde", "serde_json", "strum", - "thiserror", + "thiserror 1.0.64", "tokio", "tokio-util", "tonic", @@ -4619,6 +4755,7 @@ dependencies = [ name = "rundler-pool" version = "0.4.0" dependencies = [ + "alloy-consensus", "alloy-primitives", "alloy-sol-types", "anyhow", @@ -4641,7 +4778,7 @@ dependencies = [ "rundler-utils", "serde", "strum", - "thiserror", + "thiserror 1.0.64", "tokio", "tokio-stream", "tokio-util", @@ -4660,7 +4797,7 @@ dependencies = [ "alloy-consensus", "alloy-contract", "alloy-json-rpc", - "alloy-node-bindings", + "alloy-node-bindings 0.4.2", "alloy-primitives", "alloy-provider", "alloy-rlp", @@ -4684,7 +4821,7 @@ dependencies = [ "rundler-provider", "rundler-types", "rundler-utils", - "thiserror", + "thiserror 1.0.64", "tokio", "tower 0.4.13", "tracing", @@ -4698,6 +4835,7 @@ dependencies = [ "alloy-consensus", "alloy-contract", "alloy-json-rpc", + "alloy-network", "alloy-primitives", "alloy-sol-types", "anyhow", @@ -4716,7 +4854,7 @@ dependencies = [ "rundler-utils", "serde", "strum", - "thiserror", + "thiserror 1.0.64", "tokio", "tokio-util", "tonic", @@ -4750,7 +4888,7 @@ dependencies = [ "serde_json", "serde_with", "strum", - "thiserror", + "thiserror 1.0.64", "tokio", "tracing", "url", @@ -4770,7 +4908,7 @@ dependencies = [ "rundler-provider", "rundler-types", "rundler-utils", - "thiserror", + "thiserror 1.0.64", "tokio", "tokio-util", "tonic", @@ -4803,7 +4941,7 @@ dependencies = [ "serde", "serde_json", "strum", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -5186,7 +5324,7 @@ checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -5249,7 +5387,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -5354,6 +5492,9 @@ name = "smallvec" version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +dependencies = [ + "serde", +] [[package]] name = "socket2" @@ -5430,7 +5571,7 @@ dependencies = [ "quote", "regex-syntax 0.6.29", "strsim 0.10.0", - "syn 2.0.77", + "syn 2.0.90", "unicode-width", ] @@ -5461,7 +5602,7 @@ dependencies = [ "proc-macro2", "quote", "structmeta-derive", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -5472,7 +5613,7 @@ checksum = "152a0b65a590ff6c3da95cabe2353ee04e6167c896b28e3b14478c2636c922fc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -5494,7 +5635,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -5516,9 +5657,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.77" +version = "2.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" +checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" dependencies = [ "proc-macro2", "quote", @@ -5527,14 +5668,14 @@ dependencies = [ [[package]] name = "syn-solidity" -version = "0.8.5" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab661c8148c2261222a4d641ad5477fd4bea79406a99056096a0b41b35617a5" +checksum = "219389c1ebe89f8333df8bdfb871f6631c552ff399c23cac02480b6088aad8f0" dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -5583,7 +5724,16 @@ version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.64", +] + +[[package]] +name = "thiserror" +version = "2.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fec2a1820ebd077e2b90c4df007bebf344cd394098a13c563957d0afc83ea47" +dependencies = [ + "thiserror-impl 2.0.6", ] [[package]] @@ -5594,7 +5744,18 @@ checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d65750cab40f4ff1929fb1ba509e9914eb756131cef4210da8d5d700d26f6312" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", ] [[package]] @@ -5696,7 +5857,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -5833,7 +5994,7 @@ dependencies = [ "prost-build", "prost-types", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -5927,7 +6088,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3566e8ce28cc0a3fe42519fc80e6b4c943cc4c8cef275620eb8dac2d3d4e06cf" dependencies = [ "crossbeam-channel", - "thiserror", + "thiserror 1.0.64", "time", "tracing-subscriber", ] @@ -5940,7 +6101,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -6201,7 +6362,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", "wasm-bindgen-shared", ] @@ -6235,7 +6396,7 @@ checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -6246,6 +6407,20 @@ version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" +[[package]] +name = "wasmtimer" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0048ad49a55b9deb3953841fa1fc5858f0efbcb7a18868c899a360269fac1b23" +dependencies = [ + "futures", + "js-sys", + "parking_lot", + "pin-utils", + "slab", + "wasm-bindgen", +] + [[package]] name = "web-sys" version = "0.3.70" @@ -6347,7 +6522,7 @@ checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -6358,7 +6533,7 @@ checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -6599,7 +6774,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -6619,5 +6794,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] diff --git a/Cargo.toml b/Cargo.toml index e44885b73..862c4fac8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,25 +33,25 @@ rundler-utils = { path = "crates/utils" } rundler-bindings-fastlz = { path = "crates/bindings/fastlz" } # alloy core -alloy-primitives = "0.8.5" -alloy-sol-macro = "0.8.5" -alloy-sol-types = "0.8.5" +alloy-primitives = "0.8.15" +alloy-sol-macro = "0.8.15" +alloy-sol-types = "0.8.15" # alloy -alloy-consensus = "0.4.1" -alloy-contract = "0.4.1" -alloy-eips = "0.4.1" -alloy-json-rpc = "0.4.1" -alloy-provider = { version = "0.4.1", default-features = false, features = ["reqwest", "reqwest-rustls-tls"] } -alloy-rpc-client = "0.4.1" -alloy-rpc-types-eth = "0.4.1" -alloy-rpc-types-trace = "0.4.1" -alloy-signer = "0.4.1" -alloy-signer-aws = "0.4.1" -alloy-signer-local = "0.4.1" -alloy-transport = "0.4.1" -alloy-transport-http = { version = "0.4.1", default-features = false, features = ["reqwest", "reqwest-rustls-tls"] } - +alloy-consensus = "0.7.3" +alloy-contract = "0.7.3" +alloy-eips = "0.7.3" +alloy-json-rpc = "0.7.3" +alloy-provider = { version = "0.7.3", default-features = false, features = ["reqwest", "reqwest-rustls-tls"] } +alloy-rpc-client = "0.7.3" +alloy-rpc-types-eth = "0.7.3" +alloy-rpc-types-trace = "0.7.3" +alloy-signer = "0.7.3" +alloy-signer-aws = "0.7.3" +alloy-signer-local = "0.7.3" +alloy-transport = "0.7.3" +alloy-transport-http = { version = "0.7.3", default-features = false, features = ["reqwest", "reqwest-rustls-tls"] } +alloy-network = { version = "0.7.3" } # alloy other alloy-rlp = "0.3.8" diff --git a/Makefile b/Makefile index bb08aa7cf..86c34af6b 100644 --- a/Makefile +++ b/Makefile @@ -63,6 +63,10 @@ build-%: fmt: ## format code with nightly rust cargo +nightly fmt +.PHONY: lint +lint: ## lint and improve code quality + cargo clippy --all --all-features --tests -- -D warnings + # Note: This requires a buildx builder with emulation support. For example: # # `docker run --privileged --rm tonistiigi/binfmt --install amd64,arm64` diff --git a/crates/builder/src/transaction_tracker.rs b/crates/builder/src/transaction_tracker.rs index 65430ba07..25377c077 100644 --- a/crates/builder/src/transaction_tracker.rs +++ b/crates/builder/src/transaction_tracker.rs @@ -11,6 +11,7 @@ // You should have received a copy of the GNU General Public License along with Rundler. // If not, see https://www.gnu.org/licenses/. +use alloy_consensus::Transaction; use alloy_primitives::{Address, B256}; use anyhow::{bail, Context}; use async_trait::async_trait; @@ -244,7 +245,7 @@ where self.provider.get_transaction_by_hash(tx_hash), self.provider.get_transaction_receipt(tx_hash), )?; - let gas_limit = tx.map(|t| t.gas).or_else(|| { + let gas_limit = tx.map(|t| t.inner.gas_limit()).or_else(|| { warn!("failed to fetch transaction data for tx: {}", tx_hash); None }); @@ -542,7 +543,11 @@ struct TransactionTrackerMetrics { #[cfg(test)] mod tests { - use alloy_primitives::Address; + use alloy_consensus::{ + Signed, TxEip1559, + TxEnvelope::{self, Eip1559}, + }; + use alloy_primitives::{Address, PrimitiveSignature}; use mockall::Sequence; use rundler_provider::{ MockEvmProvider, Transaction, TransactionReceipt, TransactionReceiptEnvelope, @@ -758,6 +763,25 @@ mod tests { )); } + fn sign_transaction(hash: B256) -> Transaction { + let txn = TxEip1559 { + gas_limit: 0, + ..Default::default() + }; + let inner = Eip1559(Signed::new_unchecked( + txn, + PrimitiveSignature::test_signature(), + hash, + )); + Transaction:: { + inner, + block_hash: None, + block_number: None, + transaction_index: None, + effective_gas_price: None, + from: Address::default(), + } + } #[tokio::test] async fn test_check_for_update_mined() { let (mut sender, mut provider) = create_base_config(); @@ -781,12 +805,7 @@ mod tests { provider .expect_get_transaction_by_hash() - .returning(|_: B256| { - Ok(Some(Transaction { - gas: 0, - ..Default::default() - })) - }); + .returning(|hash: B256| Ok(Some(sign_transaction(hash)))); provider .expect_get_transaction_receipt() @@ -806,7 +825,6 @@ mod tests { from: Address::ZERO, to: None, contract_address: None, - state_root: None, authorization_list: None, })) }); diff --git a/crates/pool/Cargo.toml b/crates/pool/Cargo.toml index 72d8d9ba0..8aae74c7a 100644 --- a/crates/pool/Cargo.toml +++ b/crates/pool/Cargo.toml @@ -8,6 +8,7 @@ repository.workspace = true publish = false [dependencies] +alloy-consensus.workspace = true rundler-contracts.workspace = true rundler-provider.workspace = true rundler-sim.workspace = true diff --git a/crates/pool/src/chain.rs b/crates/pool/src/chain.rs index ef6635c45..5a0a9de3d 100644 --- a/crates/pool/src/chain.rs +++ b/crates/pool/src/chain.rs @@ -848,8 +848,11 @@ mod tests { Some(Block { header: BlockHeader { hash, - parent_hash, - number: number as u64, + inner: alloy_consensus::Header { + parent_hash, + number: number as u64, + ..Default::default() + }, ..Default::default() }, ..Default::default() diff --git a/crates/provider/src/alloy/entry_point/mod.rs b/crates/provider/src/alloy/entry_point/mod.rs index 19f9c8c9a..16648eab0 100644 --- a/crates/provider/src/alloy/entry_point/mod.rs +++ b/crates/provider/src/alloy/entry_point/mod.rs @@ -12,7 +12,7 @@ // If not, see https://www.gnu.org/licenses/. use alloy_consensus::{transaction::SignableTransaction, TxEnvelope, TypedTransaction}; -use alloy_primitives::{address, Address, Bytes, Parity, Signature, U256}; +use alloy_primitives::{address, Address, Bytes, PrimitiveSignature, U256}; use alloy_rlp::Encodable; use alloy_rpc_types_eth::TransactionRequest; @@ -49,11 +49,7 @@ fn max_bundle_transaction_data(to_address: Address, data: Bytes, gas_price: u128 // use a max signature let tx_envelope: TxEnvelope = tx_1559 - .into_signed(Signature::new( - U256::MAX, - U256::MAX, - Parity::Eip155(u64::MAX), - )) + .into_signed(PrimitiveSignature::new(U256::MAX, U256::MAX, false)) .into(); let mut encoded = vec![]; tx_envelope.encode(&mut encoded); diff --git a/crates/rpc/Cargo.toml b/crates/rpc/Cargo.toml index b19ea50fa..39501928d 100644 --- a/crates/rpc/Cargo.toml +++ b/crates/rpc/Cargo.toml @@ -8,6 +8,7 @@ repository.workspace = true publish = false [dependencies] +alloy-consensus.workspace = true rundler-contracts.workspace = true rundler-provider.workspace = true rundler-sim.workspace = true @@ -39,6 +40,7 @@ url.workspace = true [dev-dependencies] alloy-consensus.workspace = true +alloy-network.workspace = true mockall.workspace = true rundler-provider = { workspace = true, features = ["test-utils"] } rundler-sim = { workspace = true, features = ["test-utils"] } diff --git a/crates/rpc/src/eth/api.rs b/crates/rpc/src/eth/api.rs index ec442c431..bd3b88321 100644 --- a/crates/rpc/src/eth/api.rs +++ b/crates/rpc/src/eth/api.rs @@ -183,7 +183,8 @@ where mod tests { use std::sync::Arc; - use alloy_primitives::{Log as PrimitiveLog, LogData, U256}; + use alloy_consensus::{Signed, TxEip1559, TxEnvelope::Eip1559}; + use alloy_primitives::{Log as PrimitiveLog, LogData, PrimitiveSignature, TxKind, U256}; use alloy_sol_types::SolInterface; use mockall::predicate::eq; use rundler_contracts::v0_6::IEntryPoint::{handleOpsCall, IEntryPointCalls}; @@ -270,20 +271,33 @@ mod tests { }) .abi_encode(); - let tx = Transaction { - to: Some(ep), + let inner_txn = TxEip1559 { + to: TxKind::Call(ep), input: tx_data.into(), - block_number: Some(block_number), - block_hash: Some(block_hash), ..Default::default() }; - let tx_hash = tx.hash; + + let inner = Eip1559(Signed::new_unchecked( + inner_txn, + PrimitiveSignature::test_signature(), + hash, + )); + let tx = Transaction { + inner, + block_hash: Some(block_hash), + block_number: Some(block_number), + transaction_index: None, + effective_gas_price: None, + from: Address::default(), + }; + + let tx_hash = *tx.inner.tx_hash(); let log = Log { inner: PrimitiveLog { address: ep, data: LogData::default(), }, - transaction_hash: Some(tx.hash), + transaction_hash: Some(tx_hash), ..Default::default() }; diff --git a/crates/rpc/src/eth/events/common.rs b/crates/rpc/src/eth/events/common.rs index c5a15a41f..bcf54175f 100644 --- a/crates/rpc/src/eth/events/common.rs +++ b/crates/rpc/src/eth/events/common.rs @@ -13,6 +13,7 @@ use std::{collections::VecDeque, marker::PhantomData}; +use alloy_consensus::Transaction; use alloy_primitives::{Address, Bytes, B256, U256}; use alloy_sol_types::SolEvent; use anyhow::Context; @@ -87,12 +88,14 @@ where return Ok(None); } let to = tx - .to - .context("tx.to should be present on transaction containing user operation event")?; + .inner + .to() + .expect("tx.to should be present on transaction containing user operation event"); + + let input = tx.input(); - // Find first op matching the hash let user_operation = if E::address(&self.chain_spec) == to { - E::get_user_operations_from_tx_data(tx.input, &self.chain_spec) + E::get_user_operations_from_tx_data(input.clone(), &self.chain_spec) .into_iter() .find(|op| op.hash(to, self.chain_spec.id) == hash) .context("matching user operation should be found in tx data")? diff --git a/crates/rpc/src/eth/events/mod.rs b/crates/rpc/src/eth/events/mod.rs index 0355992cd..ad7549554 100644 --- a/crates/rpc/src/eth/events/mod.rs +++ b/crates/rpc/src/eth/events/mod.rs @@ -246,7 +246,6 @@ mod tests { from: Address::ZERO, to: None, contract_address: None, - state_root: None, authorization_list: None, } }