From bd9b30e58d623d908b6ecd9d1c5ec909425c4d73 Mon Sep 17 00:00:00 2001 From: greged93 <82421016+greged93@users.noreply.github.com> Date: Thu, 15 Feb 2024 14:01:13 +0100 Subject: [PATCH] dev: bump reth and ef-tests (#776) * bump reth and ef-tests * push dockerfile * fix CI * revert CI changes --- .trunk/trunk.yaml | 2 +- Cargo.lock | 516 +++++++++++----------- Cargo.toml | 12 +- src/eth_provider/contracts/erc20.rs | 9 +- src/eth_provider/provider.rs | 38 +- src/eth_provider/starknet/kakarot_core.rs | 4 +- src/eth_rpc/api/eth_api.rs | 12 +- src/eth_rpc/servers/eth_rpc.rs | 12 +- src/test_utils/tx_waiter.rs | 3 - tests/eth_provider.rs | 7 +- 10 files changed, 310 insertions(+), 305 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index a7baed0fa..63371c266 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -31,7 +31,7 @@ lint: - taplo@0.8.1 - terrascan@1.18.11 - trivy@0.49.1 - - trufflehog@3.67.5 + - trufflehog@3.67.6 - yamllint@1.34.0 ignore: - linters: [ALL] diff --git a/Cargo.lock b/Cargo.lock index 569c621df..7f659d1f9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -142,10 +142,20 @@ dependencies = [ "strum 0.25.0", ] +[[package]] +name = "alloy-eips" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy?rev=a4453d4#a4453d42ffb755a46bace2ceca3baa454e0cd807" +dependencies = [ + "alloy-primitives 0.6.2", + "alloy-rlp", + "thiserror", +] + [[package]] name = "alloy-genesis" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy#2d23d57d78844e04c9ea09cf9e5aea2dccc1c639" +source = "git+https://github.com/alloy-rs/alloy?rev=a4453d4#a4453d42ffb755a46bace2ceca3baa454e0cd807" dependencies = [ "alloy-primitives 0.6.2", "alloy-rpc-types", @@ -233,7 +243,7 @@ dependencies = [ [[package]] name = "alloy-rpc-engine-types" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy#2d23d57d78844e04c9ea09cf9e5aea2dccc1c639" +source = "git+https://github.com/alloy-rs/alloy?rev=a4453d4#a4453d42ffb755a46bace2ceca3baa454e0cd807" dependencies = [ "alloy-primitives 0.6.2", "alloy-rlp", @@ -246,7 +256,7 @@ dependencies = [ [[package]] name = "alloy-rpc-trace-types" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy#2d23d57d78844e04c9ea09cf9e5aea2dccc1c639" +source = "git+https://github.com/alloy-rs/alloy?rev=a4453d4#a4453d42ffb755a46bace2ceca3baa454e0cd807" dependencies = [ "alloy-primitives 0.6.2", "alloy-rpc-types", @@ -257,7 +267,7 @@ dependencies = [ [[package]] name = "alloy-rpc-types" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy#2d23d57d78844e04c9ea09cf9e5aea2dccc1c639" +source = "git+https://github.com/alloy-rs/alloy?rev=a4453d4#a4453d42ffb755a46bace2ceca3baa454e0cd807" dependencies = [ "alloy-primitives 0.6.2", "alloy-rlp", @@ -699,25 +709,15 @@ dependencies = [ "bytemuck", ] -[[package]] -name = "atomic-polyfill" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4" -dependencies = [ - "critical-section", -] - [[package]] name = "attohttpc" -version = "0.16.3" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdb8867f378f33f78a811a8eb9bf108ad99430d7aad43315dd9319c827ef6247" +checksum = "8d9a9bf8b79a749ee0b911b91b671cc2b6c670bdbc7e3dfd537576ddc94bb2a2" dependencies = [ "http", "log", "url", - "wildmatch", ] [[package]] @@ -873,29 +873,6 @@ dependencies = [ "serde", ] -[[package]] -name = "bindgen" -version = "0.66.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b84e06fc203107bfbad243f4aba2af864eb7db3b1cf46ea0a023b0b433d2a7" -dependencies = [ - "bitflags 2.4.2", - "cexpr", - "clang-sys", - "lazy_static", - "lazycell", - "log", - "peeking_take_while", - "prettyplease", - "proc-macro2", - "quote", - "regex", - "rustc-hash", - "shlex", - "syn 2.0.48", - "which 4.4.2", -] - [[package]] name = "bindgen" version = "0.68.1" @@ -1237,7 +1214,7 @@ dependencies = [ [[package]] name = "build-utils" version = "0.1.0" -source = "git+https://github.com/kkrt-labs/ef-tests.git?rev=c1723e#c1723e820905c06ad5b5b096f6ec6426c1bf5b63" +source = "git+https://github.com/kkrt-labs/ef-tests.git?rev=e7d0f3e#e7d0f3ef02640bdf502434a420d430108a122270" dependencies = [ "eyre", "lazy_static", @@ -1323,11 +1300,10 @@ dependencies = [ [[package]] name = "c-kzg" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32700dc7904064bb64e857d38a1766607372928e2466ee5f02a869829b3297d7" +checksum = "b9d8c306be83ec04bf5f73710badd8edf56dea23f2f0d8b7f9fe4644d371c758" dependencies = [ - "bindgen 0.66.1", "blst", "cc", "glob", @@ -2661,8 +2637,8 @@ checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" [[package]] name = "codecs-derive" -version = "0.1.0-alpha.16" -source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.16#d8a9b581da3bf82d03a9b7cb36f0d81765e08523" +version = "0.1.0-alpha.18" +source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.18#11dbd0867ed020dad1c6b0763368ecd20d094056" dependencies = [ "convert_case 0.6.0", "parity-scale-codec", @@ -2936,12 +2912,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "critical-section" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7059fff8937831a9ae6f0fe4d658ffabf58f2ca96aa9dec1c889f936f705f216" - [[package]] name = "crossbeam" version = "0.8.4" @@ -3785,7 +3755,7 @@ dependencies = [ [[package]] name = "ef-testing" version = "0.1.0" -source = "git+https://github.com/kkrt-labs/ef-tests.git?rev=c1723e#c1723e820905c06ad5b5b096f6ec6426c1bf5b63" +source = "git+https://github.com/kkrt-labs/ef-tests.git?rev=e7d0f3e#e7d0f3ef02640bdf502434a420d430108a122270" dependencies = [ "alloy-rlp", "async-trait", @@ -3809,7 +3779,7 @@ dependencies = [ "regex", "reth-primitives", "ruint", - "sequencer 0.1.0 (git+https://github.com/kkrt-labs/ef-tests.git?rev=c1723e)", + "sequencer", "serde", "serde_json", "serde_yaml", @@ -3825,12 +3795,13 @@ dependencies = [ [[package]] name = "ef-tests" -version = "0.1.0-alpha.16" -source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.16#d8a9b581da3bf82d03a9b7cb36f0d81765e08523" +version = "0.1.0-alpha.18" +source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.18#11dbd0867ed020dad1c6b0763368ecd20d094056" dependencies = [ "alloy-rlp", "reth-db", "reth-interfaces", + "reth-node-ethereum", "reth-primitives", "reth-provider", "reth-revm", @@ -4668,7 +4639,7 @@ dependencies = [ "path-slash", "regex", "reqwest", - "revm-primitives 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "revm-primitives 1.3.0", "semver 1.0.21", "serde", "serde_json", @@ -4914,19 +4885,6 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" -[[package]] -name = "git2" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf97ba92db08df386e10c8ede66a2a0369bd277090afd8710e19e38de9ec0cd" -dependencies = [ - "bitflags 2.4.2", - "libc", - "libgit2-sys", - "log", - "url", -] - [[package]] name = "gix" version = "0.58.0" @@ -5806,15 +5764,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "hash32" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" -dependencies = [ - "byteorder", -] - [[package]] name = "hashbrown" version = "0.12.3" @@ -5872,20 +5821,6 @@ dependencies = [ "num-traits 0.2.17", ] -[[package]] -name = "heapless" -version = "0.7.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f" -dependencies = [ - "atomic-polyfill", - "hash32", - "rustc_version 0.4.0", - "serde", - "spin 0.9.8", - "stable_deref_trait", -] - [[package]] name = "heck" version = "0.3.3" @@ -6029,7 +5964,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.10", + "socket2 0.5.5", "tokio", "tower-service", "tracing", @@ -6134,10 +6069,12 @@ dependencies = [ ] [[package]] -name = "igd" -version = "0.12.0" -source = "git+https://github.com/stevefan1999-personal/rust-igd?rev=c2d1f83eb1612a462962453cb0703bc93258b173#c2d1f83eb1612a462962453cb0703bc93258b173" +name = "igd-next" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "064d90fec10d541084e7b39ead8875a5a80d9114a2b18791565253bae25f49e4" dependencies = [ + "async-trait", "attohttpc", "bytes", "futures", @@ -6689,7 +6626,7 @@ dependencies = [ "reth-rpc-types", "rstest", "ruint", - "sequencer 0.1.0 (git+https://github.com/kkrt-labs/ef-tests.git?rev=97f50f1)", + "sequencer", "serde", "serde_json", "serde_with 2.3.3", @@ -7007,18 +6944,6 @@ dependencies = [ "cc", ] -[[package]] -name = "libgit2-sys" -version = "0.16.1+1.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2a2bb3680b094add03bb3732ec520ece34da31a8cd2d633d1389d0f0fb60d0c" -dependencies = [ - "cc", - "libc", - "libz-sys", - "pkg-config", -] - [[package]] name = "libloading" version = "0.8.1" @@ -7056,18 +6981,6 @@ dependencies = [ "redox_syscall 0.4.1", ] -[[package]] -name = "libz-sys" -version = "1.1.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "037731f5d3aaa87a5675e895b63ddff1a87624bc29f77004ea829809654e48f6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "linked-hash-map" version = "0.5.6" @@ -8156,7 +8069,6 @@ checksum = "a55c51ee6c0db07e68448e336cf8ea4131a620edefebf9893e759b2d793420f8" dependencies = [ "cobs", "embedded-io", - "heapless", "serde", ] @@ -8672,8 +8584,8 @@ dependencies = [ [[package]] name = "reth-codecs" -version = "0.1.0-alpha.16" -source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.16#d8a9b581da3bf82d03a9b7cb36f0d81765e08523" +version = "0.1.0-alpha.18" +source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.18#11dbd0867ed020dad1c6b0763368ecd20d094056" dependencies = [ "alloy-primitives 0.6.2", "bytes", @@ -8682,8 +8594,8 @@ dependencies = [ [[package]] name = "reth-consensus-common" -version = "0.1.0-alpha.16" -source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.16#d8a9b581da3bf82d03a9b7cb36f0d81765e08523" +version = "0.1.0-alpha.18" +source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.18#11dbd0867ed020dad1c6b0763368ecd20d094056" dependencies = [ "alloy-chains", "cfg-if", @@ -8694,16 +8606,13 @@ dependencies = [ [[package]] name = "reth-db" -version = "0.1.0-alpha.16" -source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.16#d8a9b581da3bf82d03a9b7cb36f0d81765e08523" +version = "0.1.0-alpha.18" +source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.18#11dbd0867ed020dad1c6b0763368ecd20d094056" dependencies = [ "arbitrary", "bytes", "derive_more", "eyre", - "futures", - "heapless", - "itertools 0.12.1", "metrics", "modular-bitfield", "once_cell", @@ -8711,29 +8620,26 @@ dependencies = [ "parity-scale-codec", "parking_lot 0.12.1", "paste", - "postcard", "proptest", "proptest-derive", - "rand 0.8.5", - "rayon", "reth-codecs", "reth-interfaces", - "reth-libmdbx 0.1.0-alpha.16", + "reth-libmdbx 0.1.0-alpha.18", "reth-metrics", "reth-nippy-jar", "reth-primitives", "reth-tracing", + "rustc-hash", "serde", + "strum 0.26.1", "tempfile", "thiserror", - "tokio-stream", - "vergen", ] [[package]] name = "reth-discv4" -version = "0.1.0-alpha.16" -source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.16#d8a9b581da3bf82d03a9b7cb36f0d81765e08523" +version = "0.1.0-alpha.18" +source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.18#11dbd0867ed020dad1c6b0763368ecd20d094056" dependencies = [ "alloy-rlp", "discv5", @@ -8754,8 +8660,8 @@ dependencies = [ [[package]] name = "reth-ecies" -version = "0.1.0-alpha.16" -source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.16#d8a9b581da3bf82d03a9b7cb36f0d81765e08523" +version = "0.1.0-alpha.18" +source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.18#11dbd0867ed020dad1c6b0763368ecd20d094056" dependencies = [ "aes 0.8.3", "alloy-rlp", @@ -8785,8 +8691,8 @@ dependencies = [ [[package]] name = "reth-eth-wire" -version = "0.1.0-alpha.16" -source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.16#d8a9b581da3bf82d03a9b7cb36f0d81765e08523" +version = "0.1.0-alpha.18" +source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.18#11dbd0867ed020dad1c6b0763368ecd20d094056" dependencies = [ "alloy-chains", "alloy-rlp", @@ -8812,8 +8718,8 @@ dependencies = [ [[package]] name = "reth-ethereum-forks" -version = "0.1.0-alpha.16" -source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.16#d8a9b581da3bf82d03a9b7cb36f0d81765e08523" +version = "0.1.0-alpha.18" +source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.18#11dbd0867ed020dad1c6b0763368ecd20d094056" dependencies = [ "alloy-chains", "alloy-primitives 0.6.2", @@ -8828,8 +8734,8 @@ dependencies = [ [[package]] name = "reth-interfaces" -version = "0.1.0-alpha.16" -source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.16#d8a9b581da3bf82d03a9b7cb36f0d81765e08523" +version = "0.1.0-alpha.18" +source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.18#11dbd0867ed020dad1c6b0763368ecd20d094056" dependencies = [ "auto_impl", "futures", @@ -8860,8 +8766,8 @@ dependencies = [ [[package]] name = "reth-libmdbx" -version = "0.1.0-alpha.16" -source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.16#d8a9b581da3bf82d03a9b7cb36f0d81765e08523" +version = "0.1.0-alpha.18" +source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.18#11dbd0867ed020dad1c6b0763368ecd20d094056" dependencies = [ "bitflags 2.4.2", "byteorder", @@ -8871,7 +8777,7 @@ dependencies = [ "libc", "libffi", "parking_lot 0.12.1", - "reth-mdbx-sys 0.1.0-alpha.16", + "reth-mdbx-sys 0.1.0-alpha.18", "thiserror", "tracing", ] @@ -8888,8 +8794,8 @@ dependencies = [ [[package]] name = "reth-mdbx-sys" -version = "0.1.0-alpha.16" -source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.16#d8a9b581da3bf82d03a9b7cb36f0d81765e08523" +version = "0.1.0-alpha.18" +source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.18#11dbd0867ed020dad1c6b0763368ecd20d094056" dependencies = [ "bindgen 0.69.4", "cc", @@ -8898,8 +8804,8 @@ dependencies = [ [[package]] name = "reth-metrics" -version = "0.1.0-alpha.16" -source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.16#d8a9b581da3bf82d03a9b7cb36f0d81765e08523" +version = "0.1.0-alpha.18" +source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.18#11dbd0867ed020dad1c6b0763368ecd20d094056" dependencies = [ "metrics", "reth-metrics-derive", @@ -8907,8 +8813,8 @@ dependencies = [ [[package]] name = "reth-metrics-derive" -version = "0.1.0-alpha.16" -source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.16#d8a9b581da3bf82d03a9b7cb36f0d81765e08523" +version = "0.1.0-alpha.18" +source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.18#11dbd0867ed020dad1c6b0763368ecd20d094056" dependencies = [ "once_cell", "proc-macro2", @@ -8919,8 +8825,8 @@ dependencies = [ [[package]] name = "reth-net-common" -version = "0.1.0-alpha.16" -source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.16#d8a9b581da3bf82d03a9b7cb36f0d81765e08523" +version = "0.1.0-alpha.18" +source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.18#11dbd0867ed020dad1c6b0763368ecd20d094056" dependencies = [ "pin-project", "reth-primitives", @@ -8929,10 +8835,10 @@ dependencies = [ [[package]] name = "reth-net-nat" -version = "0.1.0-alpha.16" -source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.16#d8a9b581da3bf82d03a9b7cb36f0d81765e08523" +version = "0.1.0-alpha.18" +source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.18#11dbd0867ed020dad1c6b0763368ecd20d094056" dependencies = [ - "igd", + "igd-next", "pin-project-lite", "public-ip", "serde_with 3.6.0", @@ -8943,8 +8849,8 @@ dependencies = [ [[package]] name = "reth-network-api" -version = "0.1.0-alpha.16" -source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.16#d8a9b581da3bf82d03a9b7cb36f0d81765e08523" +version = "0.1.0-alpha.18" +source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.18#11dbd0867ed020dad1c6b0763368ecd20d094056" dependencies = [ "alloy-chains", "async-trait", @@ -8959,8 +8865,8 @@ dependencies = [ [[package]] name = "reth-nippy-jar" -version = "0.1.0-alpha.16" -source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.16#d8a9b581da3bf82d03a9b7cb36f0d81765e08523" +version = "0.1.0-alpha.18" +source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.18#11dbd0867ed020dad1c6b0763368ecd20d094056" dependencies = [ "anyhow", "bincode 1.3.3", @@ -8976,13 +8882,64 @@ dependencies = [ "zstd 0.12.4", ] +[[package]] +name = "reth-node-api" +version = "0.1.0-alpha.18" +source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.18#11dbd0867ed020dad1c6b0763368ecd20d094056" +dependencies = [ + "reth-primitives", + "reth-rpc-types", + "revm-primitives 2.0.0", + "serde", + "thiserror", +] + +[[package]] +name = "reth-node-ethereum" +version = "0.1.0-alpha.18" +source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.18#11dbd0867ed020dad1c6b0763368ecd20d094056" +dependencies = [ + "reth-node-api", + "reth-payload-builder", + "reth-primitives", + "reth-rpc-types", + "serde", +] + +[[package]] +name = "reth-payload-builder" +version = "0.1.0-alpha.18" +source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.18#11dbd0867ed020dad1c6b0763368ecd20d094056" +dependencies = [ + "alloy-rlp", + "async-trait", + "futures-util", + "metrics", + "reth-interfaces", + "reth-metrics", + "reth-node-api", + "reth-primitives", + "reth-provider", + "reth-rpc-types", + "reth-rpc-types-compat", + "reth-tasks", + "reth-transaction-pool", + "revm-primitives 2.0.0", + "serde", + "sha2 0.10.8", + "thiserror", + "tokio", + "tokio-stream", + "tracing", +] + [[package]] name = "reth-primitives" -version = "0.1.0-alpha.16" -source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.16#d8a9b581da3bf82d03a9b7cb36f0d81765e08523" +version = "0.1.0-alpha.18" +source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.18#11dbd0867ed020dad1c6b0763368ecd20d094056" dependencies = [ - "ahash 0.8.7", "alloy-chains", + "alloy-eips", "alloy-genesis", "alloy-primitives 0.6.2", "alloy-rlp", @@ -8991,8 +8948,9 @@ dependencies = [ "byteorder", "bytes", "c-kzg", + "cfg-if", "derive_more", - "itertools 0.11.0", + "itertools 0.12.1", "modular-bitfield", "num_enum 0.7.2", "nybbles", @@ -9004,13 +8962,13 @@ dependencies = [ "reth-ethereum-forks", "reth-rpc-types", "revm", - "revm-primitives 1.3.0 (git+https://github.com/bluealloy/revm?branch=reth_freeze)", + "revm-primitives 2.0.0", "secp256k1 0.27.0", "serde", "serde_json", "sha2 0.10.8", "smallvec", - "strum 0.25.0", + "strum 0.26.1", "sucds 0.6.0", "tempfile", "thiserror", @@ -9020,10 +8978,9 @@ dependencies = [ [[package]] name = "reth-provider" -version = "0.1.0-alpha.16" -source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.16#d8a9b581da3bf82d03a9b7cb36f0d81765e08523" +version = "0.1.0-alpha.18" +source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.18#11dbd0867ed020dad1c6b0763368ecd20d094056" dependencies = [ - "ahash 0.8.7", "auto_impl", "dashmap", "itertools 0.12.1", @@ -9035,10 +8992,11 @@ dependencies = [ "reth-interfaces", "reth-metrics", "reth-nippy-jar", + "reth-node-api", "reth-primitives", "reth-trie", "revm", - "strum 0.25.0", + "strum 0.26.1", "tokio", "tokio-stream", "tracing", @@ -9046,11 +9004,12 @@ dependencies = [ [[package]] name = "reth-revm" -version = "0.1.0-alpha.16" -source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.16#d8a9b581da3bf82d03a9b7cb36f0d81765e08523" +version = "0.1.0-alpha.18" +source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.18#11dbd0867ed020dad1c6b0763368ecd20d094056" dependencies = [ "reth-consensus-common", "reth-interfaces", + "reth-node-api", "reth-primitives", "reth-provider", "revm", @@ -9060,8 +9019,8 @@ dependencies = [ [[package]] name = "reth-rpc-types" -version = "0.1.0-alpha.16" -source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.16#d8a9b581da3bf82d03a9b7cb36f0d81765e08523" +version = "0.1.0-alpha.18" +source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.18#11dbd0867ed020dad1c6b0763368ecd20d094056" dependencies = [ "alloy-primitives 0.6.2", "alloy-rlp", @@ -9082,10 +9041,22 @@ dependencies = [ "url", ] +[[package]] +name = "reth-rpc-types-compat" +version = "0.1.0-alpha.18" +source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.18#11dbd0867ed020dad1c6b0763368ecd20d094056" +dependencies = [ + "alloy-rlp", + "alloy-rpc-types", + "reth-primitives", + "reth-rpc-types", + "serde_json", +] + [[package]] name = "reth-stages" -version = "0.1.0-alpha.16" -source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.16#d8a9b581da3bf82d03a9b7cb36f0d81765e08523" +version = "0.1.0-alpha.18" +source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.18#11dbd0867ed020dad1c6b0763368ecd20d094056" dependencies = [ "aquamarine", "async-trait", @@ -9112,10 +9083,25 @@ dependencies = [ "tracing", ] +[[package]] +name = "reth-tasks" +version = "0.1.0-alpha.18" +source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.18#11dbd0867ed020dad1c6b0763368ecd20d094056" +dependencies = [ + "dyn-clone", + "futures-util", + "metrics", + "reth-metrics", + "thiserror", + "tokio", + "tracing", + "tracing-futures", +] + [[package]] name = "reth-tokio-util" -version = "0.1.0-alpha.16" -source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.16#d8a9b581da3bf82d03a9b7cb36f0d81765e08523" +version = "0.1.0-alpha.18" +source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.18#11dbd0867ed020dad1c6b0763368ecd20d094056" dependencies = [ "tokio", "tokio-stream", @@ -9123,8 +9109,8 @@ dependencies = [ [[package]] name = "reth-tracing" -version = "0.1.0-alpha.16" -source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.16#d8a9b581da3bf82d03a9b7cb36f0d81765e08523" +version = "0.1.0-alpha.18" +source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.18#11dbd0867ed020dad1c6b0763368ecd20d094056" dependencies = [ "clap", "eyre", @@ -9136,12 +9122,40 @@ dependencies = [ "tracing-subscriber", ] +[[package]] +name = "reth-transaction-pool" +version = "0.1.0-alpha.18" +source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.18#11dbd0867ed020dad1c6b0763368ecd20d094056" +dependencies = [ + "alloy-rlp", + "aquamarine", + "async-trait", + "auto_impl", + "bitflags 2.4.2", + "fnv", + "futures-util", + "metrics", + "parking_lot 0.12.1", + "reth-eth-wire", + "reth-interfaces", + "reth-metrics", + "reth-primitives", + "reth-provider", + "reth-tasks", + "revm", + "schnellru", + "serde", + "thiserror", + "tokio", + "tokio-stream", + "tracing", +] + [[package]] name = "reth-trie" -version = "0.1.0-alpha.16" -source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.16#d8a9b581da3bf82d03a9b7cb36f0d81765e08523" +version = "0.1.0-alpha.18" +source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.18#11dbd0867ed020dad1c6b0763368ecd20d094056" dependencies = [ - "ahash 0.8.7", "alloy-chains", "alloy-rlp", "auto_impl", @@ -9156,18 +9170,22 @@ dependencies = [ [[package]] name = "revm" -version = "3.5.0" -source = "git+https://github.com/bluealloy/revm?branch=reth_freeze#ba28a42393604beeb2da5a339ac47d3d5d3f2271" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "266f86bdefa6dac07d92e2f5c37d7d183f2575b2f9e0ee9cba9402dfde912524" dependencies = [ "auto_impl", + "cfg-if", "revm-interpreter", "revm-precompile", + "serde", + "serde_json", ] [[package]] name = "revm-inspectors" version = "0.1.0" -source = "git+https://github.com/paradigmxyz/evm-inspectors#e90052361276aebcdc67cb24d8e2c4d907b6d299" +source = "git+https://github.com/paradigmxyz/evm-inspectors?rev=b63ec73#b63ec734f89424dc4872a7cc18173c035889df80" dependencies = [ "alloy-primitives 0.6.2", "alloy-rpc-trace-types", @@ -9179,22 +9197,26 @@ dependencies = [ [[package]] name = "revm-interpreter" -version = "1.3.0" -source = "git+https://github.com/bluealloy/revm?branch=reth_freeze#ba28a42393604beeb2da5a339ac47d3d5d3f2271" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a80b516cc706630e604e2fd47c281501d2fb222712be4328921361388b7d2df" dependencies = [ - "revm-primitives 1.3.0 (git+https://github.com/bluealloy/revm?branch=reth_freeze)", + "revm-primitives 2.0.0", + "serde", ] [[package]] name = "revm-precompile" -version = "2.2.0" -source = "git+https://github.com/bluealloy/revm?branch=reth_freeze#ba28a42393604beeb2da5a339ac47d3d5d3f2271" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6912fafe7f70a264ec5895875ce2f2d0621a39263844280c9ee7f85e35bbb9e" dependencies = [ "aurora-engine-modexp", + "blst", "c-kzg", "k256 0.13.3", "once_cell", - "revm-primitives 1.3.0 (git+https://github.com/bluealloy/revm?branch=reth_freeze)", + "revm-primitives 2.0.0", "ripemd", "secp256k1 0.28.2", "sha2 0.10.8", @@ -9219,14 +9241,15 @@ dependencies = [ [[package]] name = "revm-primitives" -version = "1.3.0" -source = "git+https://github.com/bluealloy/revm?branch=reth_freeze#ba28a42393604beeb2da5a339ac47d3d5d3f2271" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b3683a40f1e94e7389c8e81e5f26bb5d30875ed0b48ab07985ec32eb6d6c712" dependencies = [ "alloy-primitives 0.6.2", - "alloy-rlp", "auto_impl", "bitflags 2.4.2", "bitvec 1.0.1", + "blst", "c-kzg", "cfg-if", "derive_more", @@ -9660,7 +9683,7 @@ dependencies = [ "typed-builder 0.18.1", "url", "walkdir", - "which 5.0.0", + "which", "windows-sys 0.48.0", "xxhash-rust", "zip", @@ -9737,6 +9760,17 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "schnellru" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "772575a524feeb803e5b0fcbc6dd9f367e579488197c94c6e4023aad2305774d" +dependencies = [ + "ahash 0.8.7", + "cfg-if", + "hashbrown 0.13.2", +] + [[package]] name = "scopeguard" version = "1.2.0" @@ -9911,23 +9945,7 @@ checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "sequencer" version = "0.1.0" -source = "git+https://github.com/kkrt-labs/ef-tests.git?rev=97f50f1#97f50f18e048834be8b785aadc68d3a98bdcebd3" -dependencies = [ - "blockifier 0.4.0-rc6", - "eyre", - "rustc-hash", - "serde", - "serde_json", - "starknet 0.6.0", - "starknet_api", - "thiserror", - "tracing", -] - -[[package]] -name = "sequencer" -version = "0.1.0" -source = "git+https://github.com/kkrt-labs/ef-tests.git?rev=c1723e#c1723e820905c06ad5b5b096f6ec6426c1bf5b63" +source = "git+https://github.com/kkrt-labs/ef-tests.git?rev=e7d0f3e#e7d0f3ef02640bdf502434a420d430108a122270" dependencies = [ "blockifier 0.4.0-rc6", "eyre", @@ -10424,9 +10442,6 @@ name = "spin" version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" -dependencies = [ - "lock_api", -] [[package]] name = "spki" @@ -10459,12 +10474,6 @@ dependencies = [ "num-traits 0.1.43", ] -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - [[package]] name = "starknet" version = "0.6.0" @@ -10855,6 +10864,15 @@ dependencies = [ "strum_macros 0.25.3", ] +[[package]] +name = "strum" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "723b93e8addf9aa965ebe2d11da6d7540fa2283fcea14b3371ff055f7ba13f5f" +dependencies = [ + "strum_macros 0.26.1", +] + [[package]] name = "strum_macros" version = "0.24.3" @@ -10881,6 +10899,19 @@ dependencies = [ "syn 2.0.48", ] +[[package]] +name = "strum_macros" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a3417fc93d76740d974a01654a09777cb500428cc874ca9f45edfe0c4d4cd18" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.48", +] + [[package]] name = "substrate-bn" version = "0.6.0" @@ -11900,19 +11931,6 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" -[[package]] -name = "vergen" -version = "8.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e27d6bdd219887a9eadd19e1c34f32e47fa332301184935c6d9bca26f3cca525" -dependencies = [ - "anyhow", - "cfg-if", - "git2", - "rustversion", - "time", -] - [[package]] name = "version_check" version = "0.9.4" @@ -12054,18 +12072,6 @@ version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" -[[package]] -name = "which" -version = "4.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" -dependencies = [ - "either", - "home", - "once_cell", - "rustix", -] - [[package]] name = "which" version = "5.0.0" @@ -12085,12 +12091,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "653f141f39ec16bba3c5abe400a0c60da7468261cc2cbf36805022876bc721a8" -[[package]] -name = "wildmatch" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f44b95f62d34113cf558c93511ac93027e03e9c29a60dd0fd70e6e025c7270a" - [[package]] name = "winapi" version = "0.3.9" diff --git a/Cargo.toml b/Cargo.toml index 7d099f2f6..fdd82868a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,10 +23,10 @@ cainome = { git = "https://github.com/cartridge-gg/cainome.git", tag = "v0.2.5-l "abigen-rs", ] } cairo-lang-starknet = { version = "2.4.0", default-features = false } -ef-testing = { git = "https://github.com/kkrt-labs/ef-tests.git", rev = "c1723e", default-features = false, features = [ +ef-testing = { git = "https://github.com/kkrt-labs/ef-tests.git", rev = "e7d0f3e", default-features = false, features = [ "v0", -] } -sequencer = { git = "https://github.com/kkrt-labs/ef-tests.git", rev = "97f50f1", default-features = false } +], optional = true } +sequencer = { git = "https://github.com/kkrt-labs/ef-tests.git", rev = "e7d0f3e", default-features = false, optional = true } starknet = { version = "0.8.0", default-features = false } starknet-crypto = { version = "0.6.1", default-features = false } starknet_api = { version = "0.6.0-rc3", default-features = false } @@ -36,8 +36,8 @@ alloy-rlp = { version = "0.3", default-features = false } ethers = { version = "2.0.9", default-features = false } ethers-solc = { version = "2.0.9", default-features = false } jsonrpsee = { version = "0.21.0", features = ["macros", "server"] } -reth-rpc-types = { git = "https://github.com/paradigmxyz/reth.git", tag = "v0.1.0-alpha.16", default-features = false } -reth-primitives = { git = "https://github.com/paradigmxyz/reth.git", tag = "v0.1.0-alpha.16", default-features = false } +reth-rpc-types = { git = "https://github.com/paradigmxyz/reth.git", tag = "v0.1.0-alpha.18", default-features = false } +reth-primitives = { git = "https://github.com/paradigmxyz/reth.git", tag = "v0.1.0-alpha.18", default-features = false } # Serde serde = { version = "1.0.188", default-features = false, features = ["derive"] } @@ -102,7 +102,7 @@ rstest = { version = "0.18.1", default-features = false } toml = { version = "0.7.5", default-features = false } [features] -testing = ["testcontainers", "rayon"] +testing = ["testcontainers", "rayon", "sequencer", "ef-testing"] [[bin]] name = "katana_genesis" diff --git a/src/eth_provider/contracts/erc20.rs b/src/eth_provider/contracts/erc20.rs index 1a38cb206..8a1903c95 100644 --- a/src/eth_provider/contracts/erc20.rs +++ b/src/eth_provider/contracts/erc20.rs @@ -4,7 +4,8 @@ use ethers::prelude::abigen; use reth_primitives::Address; use reth_primitives::{BlockId, U256}; -use reth_rpc_types::{CallInput, CallRequest}; +use reth_rpc_types::request::TransactionInput; +use reth_rpc_types::TransactionRequest; use crate::eth_provider::provider::EthProviderResult; use crate::eth_provider::provider::EthereumProvider; @@ -36,17 +37,17 @@ impl EthereumErc20

{ let address = EthersAddress::from_slice(evm_address.as_slice()); let calldata = IERC20Calls::BalanceOf(BalanceOfCall { account: address }).encode(); - let call = CallRequest { + let request = TransactionRequest { from: Some(Address::default()), to: Some(self.address), gas_price: Some(U256::from(1)), gas: Some(U256::from(1_000_000)), value: Some(U256::ZERO), - input: CallInput { input: Some(calldata.into()), data: None }, + input: TransactionInput { input: Some(calldata.into()), data: None }, ..Default::default() }; - let ret = self.provider.call(call, Some(block_id)).await?; + let ret = self.provider.call(request, Some(block_id)).await?; let balance = U256::try_from_be_slice(&ret) .ok_or_else(|| ConversionError::UintConversionError("Failed to convert call return to U256".to_string()))?; diff --git a/src/eth_provider/provider.rs b/src/eth_provider/provider.rs index 574b8a58a..8bc880590 100644 --- a/src/eth_provider/provider.rs +++ b/src/eth_provider/provider.rs @@ -11,13 +11,13 @@ use reth_primitives::Bytes; use reth_primitives::TransactionSigned; use reth_primitives::{BlockNumberOrTag, B256, U256, U64}; use reth_rpc_types::other::OtherFields; -use reth_rpc_types::CallRequest; use reth_rpc_types::FeeHistory; use reth_rpc_types::Filter; use reth_rpc_types::FilterChanges; use reth_rpc_types::Index; use reth_rpc_types::Transaction as RpcTransaction; use reth_rpc_types::TransactionReceipt; +use reth_rpc_types::TransactionRequest; use reth_rpc_types::ValueOrArray; use reth_rpc_types::{Block, BlockTransactions, RichBlock}; use reth_rpc_types::{SyncInfo, SyncStatus}; @@ -107,9 +107,9 @@ pub trait EthereumProvider { /// Returns the logs for the given filter. async fn get_logs(&self, filter: Filter) -> EthProviderResult; /// Returns the result of a call. - async fn call(&self, call: CallRequest, block_id: Option) -> EthProviderResult; + async fn call(&self, request: TransactionRequest, block_id: Option) -> EthProviderResult; /// Returns the result of a estimate gas. - async fn estimate_gas(&self, call: CallRequest, block_id: Option) -> EthProviderResult; + async fn estimate_gas(&self, call: TransactionRequest, block_id: Option) -> EthProviderResult; /// Returns the fee history given a block count and a newest block number. async fn fee_history( &self, @@ -374,16 +374,16 @@ where Ok(FilterChanges::Logs(logs.into_iter().map(Into::into).collect())) } - async fn call(&self, call: CallRequest, block_id: Option) -> EthProviderResult { - let (output, _) = self.call_helper(call, block_id).await?; + async fn call(&self, request: TransactionRequest, block_id: Option) -> EthProviderResult { + let (output, _) = self.call_helper(request, block_id).await?; Ok(Bytes::from(try_from_u8_iterator::<_, Vec<_>>(output.0.into_iter()))) } - async fn estimate_gas(&self, call: CallRequest, block_id: Option) -> EthProviderResult { + async fn estimate_gas(&self, request: TransactionRequest, block_id: Option) -> EthProviderResult { // Set a high gas limit to make sure the transaction will not fail due to gas. - let call = CallRequest { gas: Some(U256::from(*MAX_FEE)), ..call }; + let request = TransactionRequest { gas: Some(U256::from(*MAX_FEE)), ..request }; - let (_, gas_used) = self.call_helper(call, block_id).await?; + let (_, gas_used) = self.call_helper(request, block_id).await?; Ok(U256::from(gas_used)) } @@ -432,7 +432,13 @@ where }) .collect::>(); - Ok(FeeHistory { base_fee_per_gas, gas_used_ratio, oldest_block: start_block, reward: Some(vec![]) }) + Ok(FeeHistory { + base_fee_per_gas, + gas_used_ratio, + oldest_block: start_block, + reward: Some(vec![]), + ..Default::default() + }) } async fn send_raw_transaction(&self, transaction: Bytes) -> EthProviderResult { @@ -478,7 +484,7 @@ where async fn call_helper( &self, - call: CallRequest, + request: TransactionRequest, block_id: Option, ) -> EthProviderResult<(CairoArrayLegacy, u128)> { let eth_block_id = EthBlockId::new(block_id.unwrap_or(BlockId::Number(BlockNumberOrTag::Latest))); @@ -486,22 +492,22 @@ where // unwrap option let to: kakarot_core::core::Option = { - match call.to { + match request.to { Some(to) => kakarot_core::core::Option { is_some: FieldElement::ONE, value: into_via_wrapper!(to) }, None => kakarot_core::core::Option { is_some: FieldElement::ZERO, value: FieldElement::ZERO }, } }; // Here we check if CallRequest.origin is None, if so, we insert origin = address(0) - let from = into_via_wrapper!(call.from.unwrap_or_default()); + let from = into_via_wrapper!(request.from.unwrap_or_default()); - let data = call.input.into_input().unwrap_or_default(); + let data = request.input.into_input().unwrap_or_default(); let calldata: Vec<_> = data.into_iter().map(FieldElement::from).collect(); - let gas_limit = into_via_try_wrapper!(call.gas.unwrap_or_else(|| U256::from(u64::MAX))); - let gas_price = into_via_try_wrapper!(call.gas_price.unwrap_or_default()); + let gas_limit = into_via_try_wrapper!(request.gas.unwrap_or_else(|| U256::from(u64::MAX))); + let gas_price = into_via_try_wrapper!(request.gas_price.unwrap_or_default()); - let value = into_via_try_wrapper!(call.value.unwrap_or_default()); + let value = into_via_try_wrapper!(request.value.unwrap_or_default()); let kakarot_contract = KakarotCoreReader::new(*KAKAROT_ADDRESS, &self.starknet_provider); let call_output = kakarot_contract diff --git a/src/eth_provider/starknet/kakarot_core.rs b/src/eth_provider/starknet/kakarot_core.rs index 396a05b46..131f56176 100644 --- a/src/eth_provider/starknet/kakarot_core.rs +++ b/src/eth_provider/starknet/kakarot_core.rs @@ -1,6 +1,6 @@ use std::str::FromStr; -use crate::models::felt::Felt252Wrapper; +use crate::{eth_provider::constant::MAX_FEE, models::felt::Felt252Wrapper}; use cainome::rs::abigen_legacy; use dotenv::dotenv; use lazy_static::lazy_static; @@ -12,7 +12,7 @@ use starknet::{ use starknet_crypto::FieldElement; use crate::{ - eth_provider::{constant::MAX_FEE, provider::EthProviderResult, utils::split_u256}, + eth_provider::{provider::EthProviderResult, utils::split_u256}, into_via_wrapper, }; diff --git a/src/eth_rpc/api/eth_api.rs b/src/eth_rpc/api/eth_api.rs index 2a4d8ba8a..6c3e72f0e 100644 --- a/src/eth_rpc/api/eth_api.rs +++ b/src/eth_rpc/api/eth_api.rs @@ -2,8 +2,8 @@ use jsonrpsee::core::RpcResult as Result; use jsonrpsee::proc_macros::rpc; use reth_primitives::{Address, BlockId, BlockNumberOrTag, Bytes, B256, B64, U128, U256, U64}; use reth_rpc_types::{ - AccessListWithGasUsed, CallRequest, EIP1186AccountProofResponse, FeeHistory, Filter, FilterChanges, Index, - RichBlock, SyncStatus, Transaction as EthTransaction, TransactionReceipt, TransactionRequest, Work, + AccessListWithGasUsed, EIP1186AccountProofResponse, FeeHistory, Filter, FilterChanges, Index, RichBlock, + SyncStatus, Transaction as EthTransaction, TransactionReceipt, TransactionRequest, Work, }; #[rpc(server, namespace = "eth")] @@ -106,7 +106,7 @@ pub trait EthApi { /// Executes a new message call immediately without creating a transaction on the block chain. #[method(name = "call")] - async fn call(&self, request: CallRequest, block_id: Option) -> Result; + async fn call(&self, request: TransactionRequest, block_id: Option) -> Result; /// Generates an access list for a transaction. /// @@ -125,14 +125,14 @@ pub trait EthApi { #[method(name = "createAccessList")] async fn create_access_list( &self, - request: CallRequest, + request: TransactionRequest, block_id: Option, ) -> Result; /// Generates and returns an estimate of how much gas is necessary to allow the transaction to /// complete. #[method(name = "estimateGas")] - async fn estimate_gas(&self, request: CallRequest, block_id: Option) -> Result; + async fn estimate_gas(&self, request: TransactionRequest, block_id: Option) -> Result; /// Returns the current price per gas in wei. #[method(name = "gasPrice")] @@ -195,7 +195,7 @@ pub trait EthApi { /// Signs a transaction that can be submitted to the network at a later time using with /// `sendRawTransaction.` #[method(name = "signTransaction")] - async fn sign_transaction(&self, transaction: CallRequest) -> Result; + async fn sign_transaction(&self, transaction: TransactionRequest) -> Result; /// Signs data via [EIP-712](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md). #[method(name = "signTypedData")] diff --git a/src/eth_rpc/servers/eth_rpc.rs b/src/eth_rpc/servers/eth_rpc.rs index 261d90a77..abb987e12 100644 --- a/src/eth_rpc/servers/eth_rpc.rs +++ b/src/eth_rpc/servers/eth_rpc.rs @@ -4,8 +4,8 @@ use crate::eth_provider::provider::EthereumProvider; use jsonrpsee::core::{async_trait, RpcResult as Result}; use reth_primitives::{Address, BlockId, BlockNumberOrTag, Bytes, B256, B64, U128, U256, U64}; use reth_rpc_types::{ - AccessListWithGasUsed, CallRequest, EIP1186AccountProofResponse, FeeHistory, Filter, FilterChanges, Index, - RichBlock, SyncStatus, Transaction as EtherTransaction, TransactionReceipt, TransactionRequest, Work, + AccessListWithGasUsed, EIP1186AccountProofResponse, FeeHistory, Filter, FilterChanges, Index, RichBlock, + SyncStatus, Transaction as EtherTransaction, TransactionReceipt, TransactionRequest, Work, }; use serde_json::Value; @@ -155,20 +155,20 @@ where } #[tracing::instrument(skip_all, ret, err, fields(request = ?request, block_id = ?block_id))] - async fn call(&self, request: CallRequest, block_id: Option) -> Result { + async fn call(&self, request: TransactionRequest, block_id: Option) -> Result { Ok(self.eth_provider.call(request, block_id).await?) } async fn create_access_list( &self, - _request: CallRequest, + _request: TransactionRequest, _block_id: Option, ) -> Result { Err(EthProviderError::MethodNotSupported("eth_createAccessList".to_string()).into()) } #[tracing::instrument(skip_all, ret, fields(request = ?request, block_id = ?block_id))] - async fn estimate_gas(&self, request: CallRequest, block_id: Option) -> Result { + async fn estimate_gas(&self, request: TransactionRequest, block_id: Option) -> Result { Ok(self.eth_provider.estimate_gas(request, block_id).await?) } @@ -228,7 +228,7 @@ where Err(EthProviderError::MethodNotSupported("eth_sign".to_string()).into()) } - async fn sign_transaction(&self, _transaction: CallRequest) -> Result { + async fn sign_transaction(&self, _transaction: TransactionRequest) -> Result { Err(EthProviderError::MethodNotSupported("eth_signTransaction".to_string()).into()) } diff --git a/src/test_utils/tx_waiter.rs b/src/test_utils/tx_waiter.rs index 88ccab004..96675d528 100644 --- a/src/test_utils/tx_waiter.rs +++ b/src/test_utils/tx_waiter.rs @@ -40,9 +40,6 @@ where // Some nodes are still serving error code `25` for tx hash not found. This is // technically a bug on the node's side, but we maximize compatibility here by also // accepting it. - Err(ProviderError::StarknetError(StarknetError::InvalidTransactionHash)) => { - info!("Transaction not confirmed yet..."); - } Err(err) => return Err(err.into()), } diff --git a/tests/eth_provider.rs b/tests/eth_provider.rs index 6bc6881e2..14227cc6b 100644 --- a/tests/eth_provider.rs +++ b/tests/eth_provider.rs @@ -9,7 +9,8 @@ use kakarot_rpc::test_utils::evm_contract::EvmContract; use kakarot_rpc::test_utils::fixtures::{counter, katana, setup}; use kakarot_rpc::test_utils::mongo::{BLOCK_HASH, BLOCK_NUMBER}; use kakarot_rpc::test_utils::{evm_contract::KakarotEvmContract, katana::Katana}; -use reth_rpc_types::{CallInput, CallRequest}; +use reth_rpc_types::request::TransactionInput; +use reth_rpc_types::TransactionRequest; use rstest::*; use reth_primitives::{Address, BlockNumberOrTag, Bytes, U256, U64}; @@ -223,10 +224,10 @@ async fn test_estimate_gas(#[future] counter: (Katana, KakarotEvmContract), _set let chain_id = eth_provider.chain_id().await.unwrap().unwrap_or_default(); let counter_address: Felt252Wrapper = counter.evm_address.into(); - let request = CallRequest { + let request = TransactionRequest { from: Some(eoa.evm_address().unwrap()), to: Some(counter_address.try_into().unwrap()), - input: CallInput { input: None, data: Some(Bytes::from_str("0x371303c0").unwrap()) }, // selector of "function inc()" + input: TransactionInput { input: None, data: Some(Bytes::from_str("0x371303c0").unwrap()) }, // selector of "function inc()" chain_id: Some(chain_id), ..Default::default() };