From d381499dc86622b0025765a1c159940c09b3c914 Mon Sep 17 00:00:00 2001 From: jotabulacios Date: Mon, 3 Aug 2026 16:31:47 -0300 Subject: [PATCH 01/12] Bump ethrex to 4f658c2b, regenerate fixtures --- Makefile | 2 +- crypto/ethrex-crypto/Cargo.lock | 68 +------------- crypto/ethrex-crypto/Cargo.toml | 2 +- executor/programs/rust/ethrex/Cargo.lock | 46 ++++++---- executor/programs/rust/ethrex/Cargo.toml | 11 ++- executor/tests/README.md | 10 +-- executor/tests/ethrex_10_transfers.bin | Bin 14671 -> 13474 bytes executor/tests/ethrex_bench_4.bin | Bin 17371 -> 16174 bytes executor/tests/ethrex_empty_block.bin | Bin 9723 -> 8526 bytes executor/tests/ethrex_simple_tx.bin | Bin 12745 -> 11548 bytes tooling/ethrex-block-converter/Cargo.lock | 66 ++++++++------ tooling/ethrex-block-converter/Cargo.toml | 16 ++-- tooling/ethrex-block-converter/README.md | 41 +++++++-- tooling/ethrex-block-converter/src/main.rs | 32 +++++-- tooling/ethrex-fixtures/Cargo.lock | 100 +++++++++------------ tooling/ethrex-fixtures/Cargo.toml | 10 +-- tooling/ethrex-tests/Cargo.lock | 66 +++++--------- tooling/ethrex-tests/Cargo.toml | 2 +- tooling/ethrex-tests/tests/ethrex.rs | 10 ++- 19 files changed, 225 insertions(+), 257 deletions(-) diff --git a/Makefile b/Makefile index 25dce43de..098a04296 100644 --- a/Makefile +++ b/Makefile @@ -308,7 +308,7 @@ test-rust: compile-programs-rust ETHREX_REAL_BLOCK_NETWORK := mainnet ETHREX_REAL_BLOCK := 25368371 ETHREX_REAL_BLOCK_FIXTURE_URL := https://github.com/yetanotherco/lambda_vm/releases/download/bench-fixtures-v1/ethrex_mainnet_25368371.bin -ETHREX_REAL_BLOCK_FIXTURE_SHA256 := 61eba49b6b254f4a05def5a47b08a21ae3eee56f0d37bcd7b3a24b0cc1e4a300 +ETHREX_REAL_BLOCK_FIXTURE_SHA256 := 0a301731b84515260c2ad7779fef3e4ef8b2424fbcc055ee2f5a224bc88120ab # The block's source cache, hosted in the same release. Only `regen-real-block-fixture` # reads it — the converter's TESTS use a different, upstream-pinned cache (below). ETHREX_REAL_BLOCK_CACHE_URL := https://github.com/yetanotherco/lambda_vm/releases/download/bench-fixtures-v1/cache_mainnet_25368371.json diff --git a/crypto/ethrex-crypto/Cargo.lock b/crypto/ethrex-crypto/Cargo.lock index ec809fff9..8747b05a0 100644 --- a/crypto/ethrex-crypto/Cargo.lock +++ b/crypto/ethrex-crypto/Cargo.lock @@ -168,18 +168,6 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" -[[package]] -name = "bitvec" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddcec3d12c579d40898fe0a9a358a803c23e9c52ca3c425707f81c9436211837" -dependencies = [ - "funty", - "radium", - "tap", - "wyz", -] - [[package]] name = "block-buffer" version = "0.10.4" @@ -189,19 +177,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "bls12_381" -version = "0.8.0" -source = "git+https://github.com/lambdaclass/bls12_381?branch=expose-affine-constructors#78cad0378b17fc3157b83f514be192bf46edf9a1" -dependencies = [ - "digest", - "ff", - "group", - "pairing", - "rand_core 0.6.4", - "subtle", -] - [[package]] name = "byteorder" version = "1.5.0" @@ -391,15 +366,13 @@ dependencies = [ [[package]] name = "ethrex-crypto" -version = "13.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=156cb8d6a3974f411d71622eecd1b249ee37ff1c#156cb8d6a3974f411d71622eecd1b249ee37ff1c" +version = "22.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" dependencies = [ "ark-bn254", "ark-ec", "ark-ff", - "bls12_381", "ethereum-types", - "ff", "hex-literal", "k256", "num-bigint", @@ -416,7 +389,6 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" dependencies = [ - "bitvec", "rand_core 0.6.4", "subtle", ] @@ -438,12 +410,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "funty" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" - [[package]] name = "generic-array" version = "0.14.9" @@ -636,15 +602,6 @@ dependencies = [ "sha2", ] -[[package]] -name = "pairing" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fec4625e73cf41ef4bb6846cafa6d44736525f442ba45e407c4a000a13996f" -dependencies = [ - "group", -] - [[package]] name = "paste" version = "1.0.15" @@ -703,12 +660,6 @@ version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" -[[package]] -name = "radium" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" - [[package]] name = "rand" version = "0.8.6" @@ -919,12 +870,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "tap" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" - [[package]] name = "thiserror" version = "1.0.69" @@ -1031,15 +976,6 @@ version = "0.57.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" -[[package]] -name = "wyz" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" -dependencies = [ - "tap", -] - [[package]] name = "zerocopy" version = "0.8.52" diff --git a/crypto/ethrex-crypto/Cargo.toml b/crypto/ethrex-crypto/Cargo.toml index ea6c91074..5310c00b0 100644 --- a/crypto/ethrex-crypto/Cargo.toml +++ b/crypto/ethrex-crypto/Cargo.toml @@ -18,7 +18,7 @@ license = "MIT OR Apache-2.0" # Defines the `Crypto` trait, `CryptoError`, and `keccak::keccak_hash`. Same rev # + `default-features = false` as the guest's ethrex-crypto, so feature # unification adds nothing to the guest build (no C secp256k1 / malachite / kzg). -ethrex-crypto = { git = "https://github.com/lambdaclass/ethrex.git", rev = "156cb8d6a3974f411d71622eecd1b249ee37ff1c", package = "ethrex-crypto", default-features = false } +ethrex-crypto = { git = "https://github.com/lambdaclass/ethrex.git", rev = "4f658c2b3d10e3f21d35ce546870f55ca3f940fc", package = "ethrex-crypto", default-features = false } # Pinned to the exact 0.13.4 ethrex uses so the guest resolves a single k256 # (a version split would make `FieldElement`/`Scalar` incompatible types). # `expose-field` is required by the x-only reconstruction. diff --git a/executor/programs/rust/ethrex/Cargo.lock b/executor/programs/rust/ethrex/Cargo.lock index e1674f74f..df0a1bb6f 100644 --- a/executor/programs/rust/ethrex/Cargo.lock +++ b/executor/programs/rust/ethrex/Cargo.lock @@ -721,8 +721,8 @@ dependencies = [ [[package]] name = "ethrex-common" -version = "13.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=156cb8d6a3974f411d71622eecd1b249ee37ff1c#156cb8d6a3974f411d71622eecd1b249ee37ff1c" +version = "22.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" dependencies = [ "bytes", "crc32fast", @@ -749,17 +749,16 @@ dependencies = [ [[package]] name = "ethrex-crypto" -version = "13.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=156cb8d6a3974f411d71622eecd1b249ee37ff1c#156cb8d6a3974f411d71622eecd1b249ee37ff1c" +version = "22.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" dependencies = [ "ark-bn254", "ark-ec", "ark-ff", - "bls12_381", "ethereum-types", - "ff", "hex-literal", "k256", + "malachite", "num-bigint", "p256", "ripemd", @@ -770,9 +769,10 @@ dependencies = [ [[package]] name = "ethrex-guest-program" -version = "13.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=156cb8d6a3974f411d71622eecd1b249ee37ff1c#156cb8d6a3974f411d71622eecd1b249ee37ff1c" +version = "22.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" dependencies = [ + "bls12_381", "bytes", "ethereum-types", "ethrex-common", @@ -780,6 +780,7 @@ dependencies = [ "ethrex-l2-common", "ethrex-rlp", "ethrex-vm", + "ff", "hex", "k256", "lambda-vm-syscalls", @@ -791,8 +792,8 @@ dependencies = [ [[package]] name = "ethrex-l2-common" -version = "13.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=156cb8d6a3974f411d71622eecd1b249ee37ff1c#156cb8d6a3974f411d71622eecd1b249ee37ff1c" +version = "22.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" dependencies = [ "bytes", "ethereum-types", @@ -810,8 +811,8 @@ dependencies = [ [[package]] name = "ethrex-levm" -version = "13.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=156cb8d6a3974f411d71622eecd1b249ee37ff1c#156cb8d6a3974f411d71622eecd1b249ee37ff1c" +version = "22.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" dependencies = [ "bytes", "derive_more", @@ -827,8 +828,8 @@ dependencies = [ [[package]] name = "ethrex-rlp" -version = "13.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=156cb8d6a3974f411d71622eecd1b249ee37ff1c#156cb8d6a3974f411d71622eecd1b249ee37ff1c" +version = "22.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" dependencies = [ "bytes", "ethereum-types", @@ -837,8 +838,8 @@ dependencies = [ [[package]] name = "ethrex-trie" -version = "13.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=156cb8d6a3974f411d71622eecd1b249ee37ff1c#156cb8d6a3974f411d71622eecd1b249ee37ff1c" +version = "22.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" dependencies = [ "anyhow", "bytes", @@ -846,18 +847,19 @@ dependencies = [ "ethereum-types", "ethrex-crypto", "ethrex-rlp", - "lazy_static", + "hashbrown 0.15.5", "rayon", "rkyv", "rustc-hash", "serde", + "spin", "thiserror 2.0.18", ] [[package]] name = "ethrex-vm" -version = "13.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=156cb8d6a3974f411d71622eecd1b249ee37ff1c#156cb8d6a3974f411d71622eecd1b249ee37ff1c" +version = "22.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" dependencies = [ "bytes", "derive_more", @@ -2047,6 +2049,12 @@ version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" +[[package]] +name = "spin" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3763264f6b73151db08c50ff20d7d8a0b8796e021cdea7ceedad07b80155fa0e" + [[package]] name = "spki" version = "0.7.3" diff --git a/executor/programs/rust/ethrex/Cargo.toml b/executor/programs/rust/ethrex/Cargo.toml index 4922712dd..58d63cd5f 100644 --- a/executor/programs/rust/ethrex/Cargo.toml +++ b/executor/programs/rust/ethrex/Cargo.toml @@ -25,13 +25,16 @@ lambda-vm-ethrex-crypto = { path = "../../../../crypto/ethrex-crypto" } # crypto defaults); ethrex's own `LambdaVmCrypto` compiles unused — we inject our # own. KZG is NOT linked under this feature, so the point-evaluation precompile # (0x0a) is unsupported — see src/main.rs. -ethrex-guest-program = { git = "https://github.com/lambdaclass/ethrex.git", rev = "156cb8d6a3974f411d71622eecd1b249ee37ff1c", package = "ethrex-guest-program", default-features = false, features = ["lambdavm"] } +ethrex-guest-program = { git = "https://github.com/lambdaclass/ethrex.git", rev = "4f658c2b3d10e3f21d35ce546870f55ca3f940fc", package = "ethrex-guest-program", default-features = false, features = ["lambdavm"] } # Exact pin: must match the fixture writer (tooling/ethrex-fixtures) and the # executor test reader so the rkyv ProgramInput layout stays consistent. rkyv = { version = "=0.8.16", features = ["std", "unaligned"] } -# `ethrex-guest-program`'s `lambdavm` feature pins `lambda-vm-syscalls` to an -# older commit. Override it with our working-tree copy so the guest links our -# current syscalls (keccak_permute + the Print-ecall no-op fix). +# `ethrex-guest-program`'s `lambdavm` feature git-deps `lambda-vm-syscalls` at a +# pinned commit of THIS repo, which upstream bumps on its own schedule. Override it +# with the working-tree copy so the guest always links the same syscalls as the rest +# of the repo — including uncommitted local edits — rather than whatever commit +# ethrex last pinned. (At the current ethrex rev the two happen to coincide; this +# override is what keeps that coincidence from being load-bearing.) [patch."https://github.com/yetanotherco/lambda_vm.git"] lambda-vm-syscalls = { path = "../../../../syscalls" } diff --git a/executor/tests/README.md b/executor/tests/README.md index fdbf47bcb..ceee3c58d 100644 --- a/executor/tests/README.md +++ b/executor/tests/README.md @@ -15,7 +15,7 @@ merges to `main`): ```text https://github.com/lambdaclass/ethrex.git -156cb8d6a3974f411d71622eecd1b249ee37ff1c +4f658c2b3d10e3f21d35ce546870f55ca3f940fc ``` ### Generation @@ -41,15 +41,15 @@ Known fixtures: ```text ethrex_empty_block.bin - sha256: d3e594f07cc74e4ddc9db9e9db220a65a2d2e578b619fc3ce06e346007b3ca43 + sha256: ca7454142f13db5d04356366e3917d264cbea709ddd1b5e6526720dbaa12064d contents: stateless ethrex empty block ProgramInput (0 transactions) ethrex_simple_tx.bin - sha256: 15e3b3efa434186682537755d828ac8bbdde4be3fc7cbe34f26687b618a6c6ab + sha256: 29c1607297d21d88accb33767c8e03eb6536d746e6b2399930afdc9d67f1fe3f contents: stateless ethrex block with one plain ETH transfer transaction ethrex_10_transfers.bin - sha256: 38901ee4d40b99cf0aa7f642a92f0fc8db76d974bf43033a1673839020c3c28e + sha256: d04cfed35bd16c8248ab8ebf2f3ca2ff01c08269271b17e5d5db3b1f22ea03ad contents: stateless ethrex block with ten plain ETH transfer transactions ``` @@ -58,7 +58,7 @@ ethrex_10_transfers.bin The blocks above are synthetic (N plain ETH transfers over a small genesis). For a representative workload — real contract execution, real trie depth, real bytecode — `make ethrex-real-block-fixture` downloads -`ethrex_mainnet_25368371.bin` (1,110,156 B) from the `bench-fixtures-v1` release +`ethrex_mainnet_25368371.bin` (1,110,165 B) from the `bench-fixtures-v1` release and verifies it against `ETHREX_REAL_BLOCK_FIXTURE_SHA256` in the Makefile before moving it into place. It is gitignored rather than committed, so the checksum lives next to the URL in the Makefile rather than in the table above (the checksum diff --git a/executor/tests/ethrex_10_transfers.bin b/executor/tests/ethrex_10_transfers.bin index 8b6c89182dff52ad084c2a5fd0af30b9357ffd07..dd9303cfe4167942b6d264c42058a2ddc6c3c544 100644 GIT binary patch delta 160 zcmX?Kv?y~!x&bpo?~}^f4TGjKMRn~yT3WyoRM*|gC^JHx8@v^1uQrwXIiXb`u`hfiNRz8E)D=H C)J6vY delta 440 zcmZ3KdA?{vy1`@x4Hbn+->MnE9y~6Yy!V+#@?D{`TaBLCaGY9Jm$)>1x~SSzrp<=3 z0*sRb#5)xkp4|QUt)Q@CPvH@VEH1u$)#dhv(;4z7Eacd~BsWFl?f=Pw!b+3hidefa zGO&Bie0k1Zp4nD)XLm!F$Q7^Wfx*n&%WW|EXMGU9!!gcUxv;tU0fT!PR4T=U1|)Z#{ol zgs0H^)?`Hy6_-*rv*W^@vWxvqCaH3VEttRAea=Jn(z$wXTP=3Xzm)ozk>UEJdvCOp zl|-UW=SJn<{Nn%rj0_A6b~pb2X93bXZf#y@ c#K<_=fQw`DZZ6KrdyLmGar^=5Gyn+!0D^0|W&i*H diff --git a/executor/tests/ethrex_bench_4.bin b/executor/tests/ethrex_bench_4.bin index 45fe930380e9f02aedaa1aeb681926704d058346..6b716bfc9002715b7c010a4d17072122742f5b75 100644 GIT binary patch delta 176 zcmccJ&bY2_!)GgIhQC)PKh%()eA?cX>GUly)6hYgDfSVNslc@2Iap-6gDcaHH(-$+ z@4-~@XRw5$qcYQ+A0QFN50gI{DcCSFOf|p7{hP%+Y_iLMh%%ZEZf`i9A%DU`j{Qq=Q#9WGpX?~2G}%_t z#+iZLYv#*y_VUcOsyn+Ix=eP~?Gov4cZ_@}cO^AW^ps5^BZH$@&+O72Q~yRuKYt`8 zs(x40Iim5hNOs`f`0Rz!oty_j7Ar9_X#P{VzPeVrFGMN0E{7^$4XrbKg{U5eIuAFgR-t39P zf#7Q%_7cBVtn2<lvuq+cp>tsVErO9sB2+F2@VWn4>6(*Ge zld&1hlkgJFApqpv`Sx&ec)W4MKxzsOZzZQcF_!>ukf8{_q-|s#83~@`^ld%;f zM0Ex>#}kPiqfa!FB@0%dpR-4t;Rkh{F71UlxS!Hx;{gEIlHTkqV^1HsnCSQ`Sg782YHLi}QRTW?N!0 zna7iH3Ph6-6*~g}&+3zK86lH59YX@v?~`yDA(NdQLjv9OlW-X!lLH>h0bG;e9U_zQ z9v}k%&i#`>4nSt6{Rm_#Fj;&Di?r%>GQIo(X6oxJ zPiEp(o?NQ0V8h5T)%+IsZx-{g$u7?xR%=M+FSp^pa#j1uuGzcaZM^m8_?8EM|NmzI rg0olu|7Qf!U+(<>&jO_L?r*-R&&W7AftzdcWrICT|9?-OXlMZdNMt_< delta 437 zcmbOebuxLwLygG_{K|?9lfG3mem!_xGI{SajpVyRXSW(Xv*9?ktS)hB_;gXVsZ5gv z#a01TzE@;;a`)%Ag2IYDg-0B+xcKr_m)jdoXULzhkYoRn+!T$s|0gHP#XGTk&3t*z zUY^-jb!T@&m&wk$T_XMMj*$=LuB66^p0Y_~WN;MgnO(YL>fb2o=Z~aB)$fWrM>Jj* z$qw8bpS@7Jlk*_dLZH($|EXMGU9!!gcUxv;tU0fT!PR4T=U1|)Z#{olgs0H^*5r@e zDz2q$X2*p)Wf%LKOj6|zTQGmK`<#dDrE~S(wp#3%e<}4bBg6Gc_ugnHD~Uv%&Y8NK zvt2+YrbW)=v4pGHo`CwP(_(xXO#V$)l$2LuWRSbP|HIbDl{3!En>}$j5PZ$UUgFn^ zb={w96w{)U3}+sn%qZ$I*+I~T>H2+;j>*iLu1rgxf|;3`%1q{OflLLarcYpz^O~JZ z#$Uk9N-brkn4e(gUM(dihI5k(c@=;LaR`ZD{QsYkfq}v9#{d5;Kzhfm&C=S8jFUHL Ub57RN*}}x}2dK+va-TLE0MX2`#sB~S diff --git a/tooling/ethrex-block-converter/Cargo.lock b/tooling/ethrex-block-converter/Cargo.lock index a8268a857..ca8f6b2cc 100644 --- a/tooling/ethrex-block-converter/Cargo.lock +++ b/tooling/ethrex-block-converter/Cargo.lock @@ -883,6 +883,7 @@ version = "0.1.0" dependencies = [ "ethrex-common", "ethrex-config", + "ethrex-crypto", "ethrex-guest-program", "k256", "lambda-vm-ethrex-crypto", @@ -894,8 +895,8 @@ dependencies = [ [[package]] name = "ethrex-blockchain" -version = "13.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=156cb8d6a3974f411d71622eecd1b249ee37ff1c#156cb8d6a3974f411d71622eecd1b249ee37ff1c" +version = "22.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" dependencies = [ "bytes", "crossbeam", @@ -916,8 +917,8 @@ dependencies = [ [[package]] name = "ethrex-common" -version = "13.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=156cb8d6a3974f411d71622eecd1b249ee37ff1c#156cb8d6a3974f411d71622eecd1b249ee37ff1c" +version = "22.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" dependencies = [ "bytes", "crc32fast", @@ -944,8 +945,8 @@ dependencies = [ [[package]] name = "ethrex-config" -version = "13.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=156cb8d6a3974f411d71622eecd1b249ee37ff1c#156cb8d6a3974f411d71622eecd1b249ee37ff1c" +version = "22.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" dependencies = [ "ethrex-common", "ethrex-p2p", @@ -956,16 +957,14 @@ dependencies = [ [[package]] name = "ethrex-crypto" -version = "13.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=156cb8d6a3974f411d71622eecd1b249ee37ff1c#156cb8d6a3974f411d71622eecd1b249ee37ff1c" +version = "22.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" dependencies = [ "ark-bn254", "ark-ec", "ark-ff", - "bls12_381", "c-kzg", "ethereum-types", - "ff", "hex-literal", "k256", "malachite", @@ -979,9 +978,10 @@ dependencies = [ [[package]] name = "ethrex-guest-program" -version = "13.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=156cb8d6a3974f411d71622eecd1b249ee37ff1c#156cb8d6a3974f411d71622eecd1b249ee37ff1c" +version = "22.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" dependencies = [ + "bls12_381", "bytes", "ethereum-types", "ethrex-common", @@ -989,6 +989,7 @@ dependencies = [ "ethrex-l2-common", "ethrex-rlp", "ethrex-vm", + "ff", "hex", "k256", "lambda-vm-syscalls", @@ -1000,8 +1001,8 @@ dependencies = [ [[package]] name = "ethrex-l2-common" -version = "13.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=156cb8d6a3974f411d71622eecd1b249ee37ff1c#156cb8d6a3974f411d71622eecd1b249ee37ff1c" +version = "22.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" dependencies = [ "bytes", "ethereum-types", @@ -1019,8 +1020,8 @@ dependencies = [ [[package]] name = "ethrex-levm" -version = "13.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=156cb8d6a3974f411d71622eecd1b249ee37ff1c#156cb8d6a3974f411d71622eecd1b249ee37ff1c" +version = "22.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" dependencies = [ "bytes", "derive_more", @@ -1036,8 +1037,8 @@ dependencies = [ [[package]] name = "ethrex-metrics" -version = "13.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=156cb8d6a3974f411d71622eecd1b249ee37ff1c#156cb8d6a3974f411d71622eecd1b249ee37ff1c" +version = "22.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" dependencies = [ "ethrex-common", "serde", @@ -1048,8 +1049,8 @@ dependencies = [ [[package]] name = "ethrex-p2p" -version = "13.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=156cb8d6a3974f411d71622eecd1b249ee37ff1c#156cb8d6a3974f411d71622eecd1b249ee37ff1c" +version = "22.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" dependencies = [ "aes", "aes-gcm", @@ -1090,8 +1091,8 @@ dependencies = [ [[package]] name = "ethrex-rlp" -version = "13.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=156cb8d6a3974f411d71622eecd1b249ee37ff1c#156cb8d6a3974f411d71622eecd1b249ee37ff1c" +version = "22.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" dependencies = [ "bytes", "ethereum-types", @@ -1100,8 +1101,8 @@ dependencies = [ [[package]] name = "ethrex-storage" -version = "13.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=156cb8d6a3974f411d71622eecd1b249ee37ff1c#156cb8d6a3974f411d71622eecd1b249ee37ff1c" +version = "22.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" dependencies = [ "anyhow", "bytes", @@ -1122,8 +1123,8 @@ dependencies = [ [[package]] name = "ethrex-trie" -version = "13.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=156cb8d6a3974f411d71622eecd1b249ee37ff1c#156cb8d6a3974f411d71622eecd1b249ee37ff1c" +version = "22.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" dependencies = [ "anyhow", "bytes", @@ -1131,18 +1132,19 @@ dependencies = [ "ethereum-types", "ethrex-crypto", "ethrex-rlp", - "lazy_static", + "hashbrown 0.15.5", "rayon", "rkyv", "rustc-hash", "serde", + "spin", "thiserror 2.0.19", ] [[package]] name = "ethrex-vm" -version = "13.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=156cb8d6a3974f411d71622eecd1b249ee37ff1c#156cb8d6a3974f411d71622eecd1b249ee37ff1c" +version = "22.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" dependencies = [ "bytes", "derive_more", @@ -2725,6 +2727,12 @@ dependencies = [ "tracing-subscriber", ] +[[package]] +name = "spin" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3763264f6b73151db08c50ff20d7d8a0b8796e021cdea7ceedad07b80155fa0e" + [[package]] name = "spki" version = "0.7.3" diff --git a/tooling/ethrex-block-converter/Cargo.toml b/tooling/ethrex-block-converter/Cargo.toml index f61e68a68..87550cd8a 100644 --- a/tooling/ethrex-block-converter/Cargo.toml +++ b/tooling/ethrex-block-converter/Cargo.toml @@ -9,8 +9,13 @@ edition = "2024" [dependencies] # Pinned to the SAME ethrex rev as the guest (open LambdaVM-backend PR branch) # so the generated ProgramInput rkyv layout matches what the guest deserializes. -ethrex-common = { git = "https://github.com/lambdaclass/ethrex.git", rev = "156cb8d6a3974f411d71622eecd1b249ee37ff1c", package = "ethrex-common", default-features = false } -ethrex-config = { git = "https://github.com/lambdaclass/ethrex.git", rev = "156cb8d6a3974f411d71622eecd1b249ee37ff1c", package = "ethrex-config", default-features = false } +ethrex-common = { git = "https://github.com/lambdaclass/ethrex.git", rev = "4f658c2b3d10e3f21d35ce546870f55ca3f940fc", package = "ethrex-common", default-features = false } +ethrex-config = { git = "https://github.com/lambdaclass/ethrex.git", rev = "4f658c2b3d10e3f21d35ce546870f55ca3f940fc", package = "ethrex-config", default-features = false } +# Only for `NativeCrypto`, the host `Crypto` impl that `into_execution_witness` +# now takes. Nothing re-exports it, and this crate's own guest-crypto impl is a +# dev-dependency, so the bin build needs its own line. Already in the graph via +# `ethrex-config` → `ethrex-p2p`, so this adds no compilation. +ethrex-crypto = { git = "https://github.com/lambdaclass/ethrex.git", rev = "4f658c2b3d10e3f21d35ce546870f55ca3f940fc", package = "ethrex-crypto", default-features = false } # Matches the guest's own declaration (executor/programs/rust/ethrex/Cargo.toml). # # CAVEAT: this line alone does NOT reproduce the guest's precompile surface. The @@ -21,7 +26,7 @@ ethrex-config = { git = "https://github.com/lambdaclass/ethrex.git", rev = "156c # `ark-ff/asm` BN254) that the guest does not have; verify with # `cargo tree -e features -i ethrex-crypto`. Closing that gap means dropping # `ethrex-config` and sourcing `ChainConfig` another way — see the README. -ethrex-guest-program = { git = "https://github.com/lambdaclass/ethrex.git", rev = "156cb8d6a3974f411d71622eecd1b249ee37ff1c", package = "ethrex-guest-program", default-features = false, features = ["lambdavm"] } +ethrex-guest-program = { git = "https://github.com/lambdaclass/ethrex.git", rev = "4f658c2b3d10e3f21d35ce546870f55ca3f940fc", package = "ethrex-guest-program", default-features = false, features = ["lambdavm"] } # Exact pin: the fixture writer and the guest/executor readers must agree on the # rkyv layout. Keep this in sync with the guest @@ -55,7 +60,8 @@ lambda-vm-ethrex-crypto = { path = "../../crypto/ethrex-crypto" } # one can stay a dev-dependency without forcing the rebuild described above. sha2 = "0.10" -# `ethrex-guest-program`'s `lambdavm` feature pins `lambda-vm-syscalls` to an -# older commit; override it with our working-tree copy, as the guest does. +# `ethrex-guest-program`'s `lambdavm` feature git-deps `lambda-vm-syscalls` at a +# pinned commit of this repo; override it with the working-tree copy, as the guest +# does, so both resolve the same syscalls. [patch."https://github.com/yetanotherco/lambda_vm.git"] lambda-vm-syscalls = { path = "../../syscalls" } diff --git a/tooling/ethrex-block-converter/README.md b/tooling/ethrex-block-converter/README.md index 17cf8a2f8..268d6a0fb 100644 --- a/tooling/ethrex-block-converter/README.md +++ b/tooling/ethrex-block-converter/README.md @@ -88,11 +88,18 @@ Artifacts live in the **[`bench-fixtures-v1`][release]** release on | asset | sha256 | read by | |---|---|---| -| `ethrex_mainnet_25368371.bin` | `61eba49b…` | every benchmark (**current default**) | +| `ethrex_mainnet_25368371.bin` | `0a301731…` | every benchmark (**current default**) | | `cache_mainnet_25368371.json` | `7aa88a5f…` | `regen-real-block-fixture` | | `ethrex_mainnet_25453112.bin` | `0298663d…` | alternate candidate | | `cache_mainnet_25453112.json` | `20ffbbc1…` | alternate candidate | +> **Re-upload pending.** The `0a301731…` above is what the Makefile verifies against +> after the ethrex `4f658c2b` bump, which moved the rkyv layout and so changed the +> fixture bytes. The hosted asset still carries the pre-bump `61eba49b…` until it is +> replaced in the release, so `make ethrex-real-block-fixture` fails its checksum on a +> clean checkout in the meantime — loudly, which is the designed failure mode. Only the +> `.bin` is stale; the caches are inputs and are unaffected. + Each block has two assets: the fixture and the **cache** it was converted from (`make ethrex-real-block-cache`, ~2 MB, same verify-then-move contract). Only `regen-real-block-fixture` reads the cache. Note it is *not* the cache the @@ -130,12 +137,15 @@ cargo run --release -- Output is deterministic for a given cache file: ```text -wrote ../../executor/tests/ethrex_mainnet_25368371.bin (1110156 bytes): 1 block(s) \ +wrote ../../executor/tests/ethrex_mainnet_25368371.bin (1110165 bytes): 1 block(s) \ from mainnet starting at #25368371, 29 transaction(s), 2428684 gas ``` -Verified: regenerating from the hosted cache reproduces `61eba49b…` byte for byte, -which is what proves the hosted `.bin` and the hosted cache describe the same block. +Verified at the current ethrex rev: regenerating from the hosted cache reproduces +`0a301731…` byte for byte, and the result passes `test_ethrex_real_block_native` — +which is what proves the hosted cache and the fixture the Makefile expects describe +the same block. (Byte count and digest are both rev-dependent: the `4f658c2b` bump +moved them from 1,110,156 B / `61eba49b…`, the bytes still hosted in the release.) The converter's `conversion_is_reproducible` test enforces the same property, but against its own pinned block rather than this one — see [Validation](#validation). @@ -350,6 +360,15 @@ current default), so sizing a candidate from its gas mispredicts cost. **Current default — main-vintage (merge `fdb92f67`, main @ `9ccdaf2`):** +These figures were measured on the pre-bump fixture (`61eba49b…`, 1,110,156 B) and are +left as measured rather than restamped. The ethrex `4f658c2b` bump changed the fixture +bytes, so they are a baseline for a workload that no longer exists byte-for-byte. + +Post-bump CPU counterparts, measured ABBA on `vm-benchmarks-1` at the same epoch 2^22 +(see `ETHREX_BUMP_CYCLE_RESULTS.md`): **45,074,552 cycles** (−11.24%), **142.37 s** CPU +prove (−10.87%), **936.7 MB** proof (−12.22%), peak RSS flat at ~48 GB. The GPU column +has no post-bump counterpart yet. + | block | gas | cycles | GPU prove (RTX 5090) | CPU prove | proof | fixture | |---|---|---|---|---|---|---| | **mainnet 25368371** | 2.43M | **50,781,557** (clang 21)
50,713,534 (clang 18) | **59.87 s** @ epoch 2^22 | **158.8 s** @ epoch 2^22 (2.65x the GPU wall) | 1.15 GB CPU / 1.12 GB GPU | 1,110,156 B, `61eba49b…` | @@ -452,10 +471,16 @@ first run after a repoint reports one-sided numbers until main republishes. ## Why the JSON and not ethrex-replay's own `.bin` `ethrex-replay` can already emit a rkyv `ProgramInput`, but it tracks ethrex -`main`, where the type has diverged from the rev our guest pins -(`156cb8d6…`): `main` has an extra `fee_configs` field, moved the type from -`l1::` to `input::`, and uses rkyv 0.8.10 against our exact `=0.8.16`. Its -binary would not deserialize in our guest. +`main` while we pin a branch off it, and the type has diverged between the two +before: against the previously pinned rev (`156cb8d6…`) `main` carried an extra +`fee_configs` field and had moved the type from `l1::` to `input::`, so replay's +binary would not deserialize in our guest at all. + +At the currently pinned rev (`4f658c2b…`, rebased onto recent `main`) the +`ProgramInput` definition matches `main`'s again, and that gap has closed for +now. What has not closed: replay resolves rkyv itself from ethrex's `^0.8.10` +rather than our exact `=0.8.16`, `main` has no `lambdavm` feature to build the +guest side against, and the next bump can reopen the type gap without warning. The cache JSON carries only `blocks` + `witness` + `network` as plain serde, so it survives that drift. This tool re-reads it with **our** pinned ethrex types diff --git a/tooling/ethrex-block-converter/src/main.rs b/tooling/ethrex-block-converter/src/main.rs index f96b03f24..545c7cc6e 100644 --- a/tooling/ethrex-block-converter/src/main.rs +++ b/tooling/ethrex-block-converter/src/main.rs @@ -5,18 +5,23 @@ //! cargo run --release -- use ethrex_common::types::Block; -use ethrex_common::types::block_execution_witness::RpcExecutionWitness; +use ethrex_common::types::block_execution_witness::{RpcExecutionWitness, decode_witness_headers}; use ethrex_config::networks::Network; +use ethrex_crypto::NativeCrypto; use ethrex_guest_program::l1::ProgramInput; use serde::Deserialize; /// The subset of `ethrex-replay`'s on-disk cache that a `ProgramInput` needs. /// /// Deliberately deserialized with *our* pinned ethrex types rather than by -/// depending on `ethrex-replay`: it tracks ethrex `main`, where `ProgramInput` -/// has diverged (extra `fee_configs` field, different module path, rkyv 0.8.10 -/// vs our `=0.8.16`), so its own `.bin` output would not deserialize in our -/// guest. This JSON is the version-tolerant interface between the two. +/// depending on `ethrex-replay`: it tracks ethrex `main`, we pin a branch off it, +/// and `ProgramInput` has diverged between the two before (it once carried an +/// extra `fee_configs` field and lived at a different module path). At the +/// currently pinned rev the type happens to match `main`'s again, but replay +/// still resolves rkyv itself from ethrex's `^0.8.10` against our exact `=0.8.16`, +/// and nothing stops the type drifting apart on the next bump. This JSON carries +/// only `blocks` + `witness` + `network` as plain serde, so it is the +/// version-tolerant interface between the two regardless. /// /// Extra fields in the file (L2 blob data, custom `chain_config`) are ignored. #[derive(Deserialize)] @@ -70,10 +75,19 @@ fn program_input_from_cache( // `into_execution_witness` rebuilds the trie structures from the flat node // list and needs the parent header, which the cache carries inside `witness`. + // Those headers are now decoded by the caller rather than inside the call, and + // the `Crypto` argument is what recomputes the block hashes the parent lookup + // matches on. `NativeCrypto` is keccak-only here, so it produces the same bytes + // as the `LambdaVmEcsmCrypto` the guest injects (whose host path is also + // software keccak) — the fixture does not depend on which one converts it. let chain_config = cache.network.get_genesis()?.config; - let witness = cache - .witness - .into_execution_witness(chain_config, summary.first_block_number)?; + let decoded_headers = decode_witness_headers(&cache.witness.headers)?; + let witness = cache.witness.into_execution_witness( + chain_config, + summary.first_block_number, + &decoded_headers, + &NativeCrypto, + )?; Ok((ProgramInput::new(cache.blocks, witness), summary)) } @@ -216,7 +230,7 @@ mod tests { .map(|b| format!("{b:02x}")) .collect(); assert_eq!( - digest, "1f7d4c4cdf9bd52472d9ebafdb4038f57a88c3c92d65c96fd86d7e323db87142", + digest, "6ffc80b25ec9ed3c203c35bdb8a4a05aff08d98b1a9c71648447bc199a552dc9", "fixture bytes changed — regenerate it and update the README checksum", ); } diff --git a/tooling/ethrex-fixtures/Cargo.lock b/tooling/ethrex-fixtures/Cargo.lock index 8d671d94c..1702880a9 100644 --- a/tooling/ethrex-fixtures/Cargo.lock +++ b/tooling/ethrex-fixtures/Cargo.lock @@ -389,19 +389,6 @@ dependencies = [ "objc2", ] -[[package]] -name = "bls12_381" -version = "0.8.0" -source = "git+https://github.com/lambdaclass/bls12_381?branch=expose-affine-constructors#78cad0378b17fc3157b83f514be192bf46edf9a1" -dependencies = [ - "digest", - "ff", - "group", - "pairing", - "rand_core 0.6.4", - "subtle", -] - [[package]] name = "blst" version = "0.3.16" @@ -481,9 +468,9 @@ dependencies = [ [[package]] name = "c-kzg" -version = "2.1.7" +version = "2.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6648ed1e4ea8e8a1a4a2c78e1cda29a3fd500bc622899c340d8525ea9a76b24a" +checksum = "38d04308254695569fdb9bfe3bacc1c91837a670d0806605eb82d63748fbd3a6" dependencies = [ "blst", "cc", @@ -988,8 +975,8 @@ dependencies = [ [[package]] name = "ethrex-blockchain" -version = "13.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=156cb8d6a3974f411d71622eecd1b249ee37ff1c#156cb8d6a3974f411d71622eecd1b249ee37ff1c" +version = "22.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" dependencies = [ "bytes", "crossbeam", @@ -1010,8 +997,8 @@ dependencies = [ [[package]] name = "ethrex-common" -version = "13.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=156cb8d6a3974f411d71622eecd1b249ee37ff1c#156cb8d6a3974f411d71622eecd1b249ee37ff1c" +version = "22.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" dependencies = [ "bytes", "crc32fast", @@ -1040,16 +1027,14 @@ dependencies = [ [[package]] name = "ethrex-crypto" -version = "13.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=156cb8d6a3974f411d71622eecd1b249ee37ff1c#156cb8d6a3974f411d71622eecd1b249ee37ff1c" +version = "22.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" dependencies = [ "ark-bn254", "ark-ec", "ark-ff", - "bls12_381", "c-kzg", "ethereum-types", - "ff", "hex-literal", "k256", "malachite", @@ -1081,8 +1066,8 @@ dependencies = [ [[package]] name = "ethrex-guest-program" -version = "13.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=156cb8d6a3974f411d71622eecd1b249ee37ff1c#156cb8d6a3974f411d71622eecd1b249ee37ff1c" +version = "22.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" dependencies = [ "bytes", "ethereum-types", @@ -1100,8 +1085,8 @@ dependencies = [ [[package]] name = "ethrex-l2-common" -version = "13.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=156cb8d6a3974f411d71622eecd1b249ee37ff1c#156cb8d6a3974f411d71622eecd1b249ee37ff1c" +version = "22.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" dependencies = [ "bytes", "ethereum-types", @@ -1119,8 +1104,8 @@ dependencies = [ [[package]] name = "ethrex-l2-rpc" -version = "13.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=156cb8d6a3974f411d71622eecd1b249ee37ff1c#156cb8d6a3974f411d71622eecd1b249ee37ff1c" +version = "22.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" dependencies = [ "axum", "bytes", @@ -1142,6 +1127,7 @@ dependencies = [ "serde_json", "thiserror 2.0.18", "tokio", + "tokio-util", "tower-http", "tracing", "tracing-subscriber", @@ -1150,8 +1136,8 @@ dependencies = [ [[package]] name = "ethrex-levm" -version = "13.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=156cb8d6a3974f411d71622eecd1b249ee37ff1c#156cb8d6a3974f411d71622eecd1b249ee37ff1c" +version = "22.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" dependencies = [ "bytes", "derive_more", @@ -1168,8 +1154,8 @@ dependencies = [ [[package]] name = "ethrex-metrics" -version = "13.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=156cb8d6a3974f411d71622eecd1b249ee37ff1c#156cb8d6a3974f411d71622eecd1b249ee37ff1c" +version = "22.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" dependencies = [ "axum", "ethrex-common", @@ -1184,8 +1170,8 @@ dependencies = [ [[package]] name = "ethrex-p2p" -version = "13.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=156cb8d6a3974f411d71622eecd1b249ee37ff1c#156cb8d6a3974f411d71622eecd1b249ee37ff1c" +version = "22.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" dependencies = [ "aes", "aes-gcm", @@ -1228,8 +1214,8 @@ dependencies = [ [[package]] name = "ethrex-rlp" -version = "13.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=156cb8d6a3974f411d71622eecd1b249ee37ff1c#156cb8d6a3974f411d71622eecd1b249ee37ff1c" +version = "22.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" dependencies = [ "bytes", "ethereum-types", @@ -1238,8 +1224,8 @@ dependencies = [ [[package]] name = "ethrex-rpc" -version = "13.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=156cb8d6a3974f411d71622eecd1b249ee37ff1c#156cb8d6a3974f411d71622eecd1b249ee37ff1c" +version = "22.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" dependencies = [ "axum", "axum-extra", @@ -1259,6 +1245,7 @@ dependencies = [ "hex-literal", "jsonwebtoken", "rand 0.8.6", + "rayon", "reqwest", "secp256k1", "serde", @@ -1277,8 +1264,8 @@ dependencies = [ [[package]] name = "ethrex-storage" -version = "13.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=156cb8d6a3974f411d71622eecd1b249ee37ff1c#156cb8d6a3974f411d71622eecd1b249ee37ff1c" +version = "22.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" dependencies = [ "anyhow", "bytes", @@ -1299,8 +1286,8 @@ dependencies = [ [[package]] name = "ethrex-storage-rollup" -version = "13.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=156cb8d6a3974f411d71622eecd1b249ee37ff1c#156cb8d6a3974f411d71622eecd1b249ee37ff1c" +version = "22.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" dependencies = [ "async-trait", "bincode", @@ -1315,8 +1302,8 @@ dependencies = [ [[package]] name = "ethrex-trie" -version = "13.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=156cb8d6a3974f411d71622eecd1b249ee37ff1c#156cb8d6a3974f411d71622eecd1b249ee37ff1c" +version = "22.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" dependencies = [ "anyhow", "bytes", @@ -1324,18 +1311,19 @@ dependencies = [ "ethereum-types", "ethrex-crypto", "ethrex-rlp", - "lazy_static", + "hashbrown 0.15.5", "rayon", "rkyv", "rustc-hash", "serde", + "spin", "thiserror 2.0.18", ] [[package]] name = "ethrex-vm" -version = "13.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=156cb8d6a3974f411d71622eecd1b249ee37ff1c#156cb8d6a3974f411d71622eecd1b249ee37ff1c" +version = "22.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" dependencies = [ "bytes", "derive_more", @@ -1375,7 +1363,6 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" dependencies = [ - "bitvec", "rand_core 0.6.4", "subtle", ] @@ -2541,15 +2528,6 @@ dependencies = [ "sha2", ] -[[package]] -name = "pairing" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fec4625e73cf41ef4bb6846cafa6d44736525f442ba45e407c4a000a13996f" -dependencies = [ - "group", -] - [[package]] name = "parity-scale-codec" version = "3.7.5" @@ -3543,6 +3521,12 @@ dependencies = [ "tracing-subscriber", ] +[[package]] +name = "spin" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3763264f6b73151db08c50ff20d7d8a0b8796e021cdea7ceedad07b80155fa0e" + [[package]] name = "spki" version = "0.7.3" diff --git a/tooling/ethrex-fixtures/Cargo.toml b/tooling/ethrex-fixtures/Cargo.toml index 5e99f37d3..3320ba25b 100644 --- a/tooling/ethrex-fixtures/Cargo.toml +++ b/tooling/ethrex-fixtures/Cargo.toml @@ -9,11 +9,11 @@ edition = "2024" [dependencies] # Pinned to the SAME ethrex rev as the guest (open LambdaVM-backend PR branch) # so the generated ProgramInput rkyv layout matches what the guest deserializes. -ethrex-blockchain = { git = "https://github.com/lambdaclass/ethrex.git", rev = "156cb8d6a3974f411d71622eecd1b249ee37ff1c", package = "ethrex-blockchain" } -ethrex-storage = { git = "https://github.com/lambdaclass/ethrex.git", rev = "156cb8d6a3974f411d71622eecd1b249ee37ff1c", package = "ethrex-storage" } -ethrex-common = { git = "https://github.com/lambdaclass/ethrex.git", rev = "156cb8d6a3974f411d71622eecd1b249ee37ff1c", package = "ethrex-common" } -ethrex-guest-program = { git = "https://github.com/lambdaclass/ethrex.git", rev = "156cb8d6a3974f411d71622eecd1b249ee37ff1c", package = "ethrex-guest-program" } -ethrex-l2-rpc = { git = "https://github.com/lambdaclass/ethrex.git", rev = "156cb8d6a3974f411d71622eecd1b249ee37ff1c", package = "ethrex-l2-rpc" } +ethrex-blockchain = { git = "https://github.com/lambdaclass/ethrex.git", rev = "4f658c2b3d10e3f21d35ce546870f55ca3f940fc", package = "ethrex-blockchain" } +ethrex-storage = { git = "https://github.com/lambdaclass/ethrex.git", rev = "4f658c2b3d10e3f21d35ce546870f55ca3f940fc", package = "ethrex-storage" } +ethrex-common = { git = "https://github.com/lambdaclass/ethrex.git", rev = "4f658c2b3d10e3f21d35ce546870f55ca3f940fc", package = "ethrex-common" } +ethrex-guest-program = { git = "https://github.com/lambdaclass/ethrex.git", rev = "4f658c2b3d10e3f21d35ce546870f55ca3f940fc", package = "ethrex-guest-program" } +ethrex-l2-rpc = { git = "https://github.com/lambdaclass/ethrex.git", rev = "4f658c2b3d10e3f21d35ce546870f55ca3f940fc", package = "ethrex-l2-rpc" } tokio = { version = "1", features = ["rt-multi-thread", "macros"] } # Exact pin: the fixture writer and the guest/executor readers must agree on the diff --git a/tooling/ethrex-tests/Cargo.lock b/tooling/ethrex-tests/Cargo.lock index 250e2411f..eafb4bdff 100644 --- a/tooling/ethrex-tests/Cargo.lock +++ b/tooling/ethrex-tests/Cargo.lock @@ -247,19 +247,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "bls12_381" -version = "0.8.0" -source = "git+https://github.com/lambdaclass/bls12_381?branch=expose-affine-constructors#78cad0378b17fc3157b83f514be192bf46edf9a1" -dependencies = [ - "digest", - "ff", - "group", - "pairing", - "rand_core", - "subtle", -] - [[package]] name = "bs58" version = "0.5.1" @@ -706,8 +693,8 @@ dependencies = [ [[package]] name = "ethrex-common" -version = "13.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=156cb8d6a3974f411d71622eecd1b249ee37ff1c#156cb8d6a3974f411d71622eecd1b249ee37ff1c" +version = "22.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" dependencies = [ "bytes", "crc32fast", @@ -736,15 +723,13 @@ dependencies = [ [[package]] name = "ethrex-crypto" -version = "13.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=156cb8d6a3974f411d71622eecd1b249ee37ff1c#156cb8d6a3974f411d71622eecd1b249ee37ff1c" +version = "22.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" dependencies = [ "ark-bn254", "ark-ec", "ark-ff", - "bls12_381", "ethereum-types", - "ff", "hex-literal", "k256", "malachite", @@ -759,8 +744,8 @@ dependencies = [ [[package]] name = "ethrex-guest-program" -version = "13.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=156cb8d6a3974f411d71622eecd1b249ee37ff1c#156cb8d6a3974f411d71622eecd1b249ee37ff1c" +version = "22.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" dependencies = [ "bytes", "ethereum-types", @@ -778,8 +763,8 @@ dependencies = [ [[package]] name = "ethrex-l2-common" -version = "13.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=156cb8d6a3974f411d71622eecd1b249ee37ff1c#156cb8d6a3974f411d71622eecd1b249ee37ff1c" +version = "22.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" dependencies = [ "bytes", "ethereum-types", @@ -797,8 +782,8 @@ dependencies = [ [[package]] name = "ethrex-levm" -version = "13.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=156cb8d6a3974f411d71622eecd1b249ee37ff1c#156cb8d6a3974f411d71622eecd1b249ee37ff1c" +version = "22.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" dependencies = [ "bytes", "derive_more", @@ -815,8 +800,8 @@ dependencies = [ [[package]] name = "ethrex-rlp" -version = "13.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=156cb8d6a3974f411d71622eecd1b249ee37ff1c#156cb8d6a3974f411d71622eecd1b249ee37ff1c" +version = "22.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" dependencies = [ "bytes", "ethereum-types", @@ -834,8 +819,8 @@ dependencies = [ [[package]] name = "ethrex-trie" -version = "13.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=156cb8d6a3974f411d71622eecd1b249ee37ff1c#156cb8d6a3974f411d71622eecd1b249ee37ff1c" +version = "22.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" dependencies = [ "anyhow", "bytes", @@ -843,18 +828,19 @@ dependencies = [ "ethereum-types", "ethrex-crypto", "ethrex-rlp", - "lazy_static", + "hashbrown 0.15.5", "rayon", "rkyv", "rustc-hash", "serde", + "spin", "thiserror 2.0.18", ] [[package]] name = "ethrex-vm" -version = "13.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=156cb8d6a3974f411d71622eecd1b249ee37ff1c#156cb8d6a3974f411d71622eecd1b249ee37ff1c" +version = "22.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" dependencies = [ "bytes", "derive_more", @@ -885,7 +871,6 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" dependencies = [ - "bitvec", "rand_core", "subtle", ] @@ -1434,15 +1419,6 @@ dependencies = [ "sha2", ] -[[package]] -name = "pairing" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fec4625e73cf41ef4bb6846cafa6d44736525f442ba45e407c4a000a13996f" -dependencies = [ - "group", -] - [[package]] name = "parity-scale-codec" version = "3.7.5" @@ -1951,6 +1927,12 @@ version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" +[[package]] +name = "spin" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3763264f6b73151db08c50ff20d7d8a0b8796e021cdea7ceedad07b80155fa0e" + [[package]] name = "spki" version = "0.7.3" diff --git a/tooling/ethrex-tests/Cargo.toml b/tooling/ethrex-tests/Cargo.toml index f4774278d..5ff8ef39f 100644 --- a/tooling/ethrex-tests/Cargo.toml +++ b/tooling/ethrex-tests/Cargo.toml @@ -12,7 +12,7 @@ edition = "2024" executor = { path = "../../executor" } # Pinned to the SAME ethrex rev as the guest (open LambdaVM-backend PR branch) # so the native reference reads the same ProgramInput rkyv layout. -ethrex-guest-program = { git = "https://github.com/lambdaclass/ethrex.git", rev = "156cb8d6a3974f411d71622eecd1b249ee37ff1c", package = "ethrex-guest-program" } +ethrex-guest-program = { git = "https://github.com/lambdaclass/ethrex.git", rev = "4f658c2b3d10e3f21d35ce546870f55ca3f940fc", package = "ethrex-guest-program" } # Exact pin: the fixture writer and the guest/executor readers must agree on the # rkyv layout. Keep this in sync with tooling/ethrex-fixtures and # executor/programs/rust/ethrex/Cargo.toml. diff --git a/tooling/ethrex-tests/tests/ethrex.rs b/tooling/ethrex-tests/tests/ethrex.rs index 6374f2f43..9ad1ee786 100644 --- a/tooling/ethrex-tests/tests/ethrex.rs +++ b/tooling/ethrex-tests/tests/ethrex.rs @@ -127,11 +127,13 @@ fn test_ethrex_real_block_native() { /// backend too (invalid G1 encoding), and both paths surface as /// `CryptoError::Other`, so the variant can't tell them apart. The string comes /// from `ethrex-crypto`'s `KzgError::Unimplemented`; if upstream rewords it this -/// test goes red, which is the safe direction. +/// test goes red, which is the safe direction — and it has: the 4f658c2b rev bump +/// dropped `openvm-kzg` from the sentence, so the expected text moved with it. /// /// Worth knowing why this can regress: `ethrex-crypto`'s own default feature set -/// is `["std", "kzg-rs", "secp256k1"]`, so any future dependency pulling it in -/// with defaults on restores a backend and silently removes the screen. +/// is `["std", "kzg-rs", "secp256k1", "aws-lc-rs", "blst"]`, so any future +/// dependency pulling it in with defaults on restores a backend and silently +/// removes the screen. #[test] fn no_kzg_backend_linked() { use ethrex_guest_program::crypto::{Crypto, NativeCrypto}; @@ -141,7 +143,7 @@ fn no_kzg_backend_linked() { Err(err) => format!("{err:?}"), }; assert!( - message.contains("One of features c-kzg, openvm-kzg or kzg-rs should be active"), + message.contains("One of features c-kzg or kzg-rs should be active"), "a KZG backend is linked into ethrex-tests, so test_ethrex_real_block_native no \ longer screens precompile 0x0a: {message}" ); From 4657bbbce5a2515882b9dbe82df88d88cc89facf Mon Sep 17 00:00:00 2001 From: jotabulacios Date: Mon, 3 Aug 2026 16:33:18 -0300 Subject: [PATCH 02/12] Cover ethrex_bench_4.bin in the checksum gate --- Makefile | 3 ++- executor/tests/README.md | 12 ++++++++++++ tooling/ethrex-fixtures/update_readme_checksums.py | 4 ++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 098a04296..9fd34b10f 100644 --- a/Makefile +++ b/Makefile @@ -499,7 +499,8 @@ regen-ethrex-fixtures: cd tooling/ethrex-fixtures && \ cargo run --release -- 0 ../../executor/tests/ethrex_empty_block.bin && \ cargo run --release -- 1 ../../executor/tests/ethrex_simple_tx.bin && \ - cargo run --release -- 10 ../../executor/tests/ethrex_10_transfers.bin + cargo run --release -- 10 ../../executor/tests/ethrex_10_transfers.bin && \ + cargo run --release -- 4 ../../executor/tests/ethrex_bench_4.bin distinct $(MAKE) update-ethrex-fixture-checksums update-ethrex-fixture-checksums: diff --git a/executor/tests/README.md b/executor/tests/README.md index ceee3c58d..ae35e6135 100644 --- a/executor/tests/README.md +++ b/executor/tests/README.md @@ -30,8 +30,15 @@ cd tooling/ethrex-fixtures cargo run --release -- 0 ../../executor/tests/ethrex_empty_block.bin # empty block cargo run --release -- 1 ../../executor/tests/ethrex_simple_tx.bin # 1 transfer cargo run --release -- 10 ../../executor/tests/ethrex_10_transfers.bin # 10 transfers +cargo run --release -- 4 ../../executor/tests/ethrex_bench_4.bin distinct # recursion profile ``` +`ethrex_bench_4.bin` is the odd one out: `distinct` mode, and it is read by the +recursion profile target rather than the executor tests (see the Makefile's +`recursion-profile-block-input`). It is committed like the rest, so it is +regenerated and checksummed with them — a rev bump makes every one of these +undecodable, not just the three the executor reads. + To regenerate after an ethrex rev bump, update the `rev` in `tooling/ethrex-fixtures/Cargo.toml` (and the guest's), then run `make regen-ethrex-fixtures` from the repo root. The target rebuilds the @@ -51,6 +58,11 @@ ethrex_simple_tx.bin ethrex_10_transfers.bin sha256: d04cfed35bd16c8248ab8ebf2f3ca2ff01c08269271b17e5d5db3b1f22ea03ad contents: stateless ethrex block with ten plain ETH transfer transactions + +ethrex_bench_4.bin + sha256: bb26e6d6595f537c2fd57bfd59da6abe82241bd92690a21c2225da94d5cf507a + contents: stateless ethrex block with four plain ETH transfers, `distinct` mode + (N senders -> N recipients); read by the recursion profile target ``` ## Real-block fixtures diff --git a/tooling/ethrex-fixtures/update_readme_checksums.py b/tooling/ethrex-fixtures/update_readme_checksums.py index 76997dbe1..f9fbee7fb 100644 --- a/tooling/ethrex-fixtures/update_readme_checksums.py +++ b/tooling/ethrex-fixtures/update_readme_checksums.py @@ -12,6 +12,10 @@ "ethrex_empty_block.bin", "ethrex_simple_tx.bin", "ethrex_10_transfers.bin", + # Committed like the three above, but generated in `distinct` mode and read by + # the recursion profile target rather than the executor tests. Omitting it left + # a committed fixture that a rev bump silently staled with nothing to catch it. + "ethrex_bench_4.bin", ) From 03d3ffed5be8ecb6b1390914b343f1500cf83f8a Mon Sep 17 00:00:00 2001 From: jotabulacios Date: Mon, 3 Aug 2026 17:58:44 -0300 Subject: [PATCH 03/12] Point the real-block fixture at the post-bump asset MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The rkyv layout moved with the ethrex rev, so the block's fixture did too, and the release now carries both: the pre-bump bytes under the original name and the post-bump ones under a name carrying the rev. Uploading under a new name rather than replacing the asset keeps `main` working while this branch is open — its Makefile still pins the pre-bump sha256, and a replaced asset would fail that checksum on every push, taking the published benchmark baseline with it. --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9fd34b10f..5adc8a44f 100644 --- a/Makefile +++ b/Makefile @@ -307,7 +307,11 @@ test-rust: compile-programs-rust # measured cost. ETHREX_REAL_BLOCK_NETWORK := mainnet ETHREX_REAL_BLOCK := 25368371 -ETHREX_REAL_BLOCK_FIXTURE_URL := https://github.com/yetanotherco/lambda_vm/releases/download/bench-fixtures-v1/ethrex_mainnet_25368371.bin +# The asset name carries the ethrex rev because the bytes are a function of it: the +# archived ProgramInput layout moves with the pin, so one block has one fixture per rev. +# Uploading under a new name rather than replacing the old one keeps `main` — which still +# expects the pre-bump sha256 — fetching its own artifact while this branch is open. +ETHREX_REAL_BLOCK_FIXTURE_URL := https://github.com/yetanotherco/lambda_vm/releases/download/bench-fixtures-v1/ethrex_mainnet_25368371_4f658c2b.bin ETHREX_REAL_BLOCK_FIXTURE_SHA256 := 0a301731b84515260c2ad7779fef3e4ef8b2424fbcc055ee2f5a224bc88120ab # The block's source cache, hosted in the same release. Only `regen-real-block-fixture` # reads it — the converter's TESTS use a different, upstream-pinned cache (below). From 55b400cf1bbd0c57b029d6081449d524da6f90d6 Mon Sep 17 00:00:00 2001 From: diegokingston Date: Mon, 10 Aug 2026 16:20:14 -0300 Subject: [PATCH 04/12] docs(ethrex): point the fixture docs at the rev-suffixed asset MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Makefile fetches ethrex_mainnet_25368371_4f658c2b.bin (the suffixed upload keeps main's pre-bump checksum working while the branch is open), but the converter README's asset table still listed the un-suffixed name with the post-bump checksum next to a 'Re-upload pending' note that the suffixed upload made moot, and executor/tests/README.md named the un-suffixed asset with the post-bump byte count. Also drop the dangling ETHREX_BUMP_CYCLE_RESULTS.md reference — the numbers are quoted inline. --- executor/tests/README.md | 2 +- tooling/ethrex-block-converter/README.md | 20 +++++++++----------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/executor/tests/README.md b/executor/tests/README.md index ae35e6135..fc6b3f8a8 100644 --- a/executor/tests/README.md +++ b/executor/tests/README.md @@ -70,7 +70,7 @@ ethrex_bench_4.bin The blocks above are synthetic (N plain ETH transfers over a small genesis). For a representative workload — real contract execution, real trie depth, real bytecode — `make ethrex-real-block-fixture` downloads -`ethrex_mainnet_25368371.bin` (1,110,165 B) from the `bench-fixtures-v1` release +`ethrex_mainnet_25368371_4f658c2b.bin` (1,110,165 B) from the `bench-fixtures-v1` release and verifies it against `ETHREX_REAL_BLOCK_FIXTURE_SHA256` in the Makefile before moving it into place. It is gitignored rather than committed, so the checksum lives next to the URL in the Makefile rather than in the table above (the checksum diff --git a/tooling/ethrex-block-converter/README.md b/tooling/ethrex-block-converter/README.md index 268d6a0fb..48c58e27b 100644 --- a/tooling/ethrex-block-converter/README.md +++ b/tooling/ethrex-block-converter/README.md @@ -88,17 +88,16 @@ Artifacts live in the **[`bench-fixtures-v1`][release]** release on | asset | sha256 | read by | |---|---|---| -| `ethrex_mainnet_25368371.bin` | `0a301731…` | every benchmark (**current default**) | +| `ethrex_mainnet_25368371_4f658c2b.bin` | `0a301731…` | every benchmark (**current default**) | | `cache_mainnet_25368371.json` | `7aa88a5f…` | `regen-real-block-fixture` | | `ethrex_mainnet_25453112.bin` | `0298663d…` | alternate candidate | | `cache_mainnet_25453112.json` | `20ffbbc1…` | alternate candidate | -> **Re-upload pending.** The `0a301731…` above is what the Makefile verifies against -> after the ethrex `4f658c2b` bump, which moved the rkyv layout and so changed the -> fixture bytes. The hosted asset still carries the pre-bump `61eba49b…` until it is -> replaced in the release, so `make ethrex-real-block-fixture` fails its checksum on a -> clean checkout in the meantime — loudly, which is the designed failure mode. Only the -> `.bin` is stale; the caches are inputs and are unaffected. +> The asset name carries the ethrex rev because the bytes are a function of it: the +> archived `ProgramInput` rkyv layout moves with the pin, so one block has one +> fixture per rev. The pre-bump bytes stay hosted under the original name +> (`ethrex_mainnet_25368371.bin`, `61eba49b…`) so older `main`s — whose Makefile +> pins that sha256 — keep fetching their own artifact. Each block has two assets: the fixture and the **cache** it was converted from (`make ethrex-real-block-cache`, ~2 MB, same verify-then-move contract). Only @@ -364,10 +363,9 @@ These figures were measured on the pre-bump fixture (`61eba49b…`, 1,110,156 B) left as measured rather than restamped. The ethrex `4f658c2b` bump changed the fixture bytes, so they are a baseline for a workload that no longer exists byte-for-byte. -Post-bump CPU counterparts, measured ABBA on `vm-benchmarks-1` at the same epoch 2^22 -(see `ETHREX_BUMP_CYCLE_RESULTS.md`): **45,074,552 cycles** (−11.24%), **142.37 s** CPU -prove (−10.87%), **936.7 MB** proof (−12.22%), peak RSS flat at ~48 GB. The GPU column -has no post-bump counterpart yet. +Post-bump CPU counterparts, measured ABBA on `vm-benchmarks-1` at the same epoch 2^22: +**45,074,552 cycles** (−11.24%), **142.37 s** CPU prove (−10.87%), **936.7 MB** proof +(−12.22%), peak RSS flat at ~48 GB. The GPU column has no post-bump counterpart yet. | block | gas | cycles | GPU prove (RTX 5090) | CPU prove | proof | fixture | |---|---|---|---|---|---|---| From d829a2cbb844f09c9d22ca6bdbaf8857c6e8859c Mon Sep 17 00:00:00 2001 From: jotabulacios Date: Wed, 26 Aug 2026 17:10:30 -0300 Subject: [PATCH 05/12] Move the ethrex pin from 4f658c2b to 797df554, off the unmerged feat/lambdavm-prover-backend branch and onto ethrex main, and stop declaring the lambdavm feature. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Requiring that feature is what tied the guest to the backend branch, since it exists nowhere else — and that branch is 69 commits behind main and has not moved since 2026-08-04, so waiting for it to merge was costing real performance. On the real benchmark block the guest goes from 34,241,608 to 30,498,818 cycles and from 120.715 s to 110.259 s of proving time (median of 3, spread under 0.8%), dropping from 9 epochs to 8; against main's pin the cycle count falls 22.9%. No feature replaces it. ethrex's per-zkVM features are not backend selectors — each is only a list of optional crypto dependencies, and none gates any method of the Crypto trait. Measured against the sibling feature activating the widest dependency set, ethrex's precompile stress fixtures come out identical to the cycle (stress_modexp_150M 6,373,285,966 and stress_alt_bn128_150M 22,986,061,145 both ways) with a smaller ELF. What makes this guest LambdaVM never travelled through a feature: lambda-vm-syscalls, lambda-vm-ethrex-crypto and the riscv64im-lambda-vm-elf target are direct, and every run still reports its 116 ECSM and 10,659 keccak precompile calls. 797df554 is the last commit where this is only a rev change. b5271885 rewrites the guest entry point to run_stateless_guest over SSZ input, which needs a new shim and a new fixture format; and between 797df554 and that boundary there is no perf(levm) work, while the two commits that matter (#7105, #7104) are already in. Release tags do not help — v24.0.0 predates both and is diverged from main, because ethrex cuts releases from a side branch. The rkyv ProgramInput layout moved with the rev, so every committed fixture is regenerated and the converter's reproducibility digest updated, as that test asks for on a legitimate bump. scripts/set_ethrex_rev.sh moves all 11 pins together: a guest and tooling on different revs do not fail to build, they produce a fixture the guest silently misreads. The real-block fixture asset for the new rev still has to be uploaded to the bench-fixtures-v1 release before CI can fetch it. --- BUMP_797df554_RESULTS.md | 130 +++++++++++++++++ Makefile | 4 +- crypto/ethrex-crypto/Cargo.toml | 2 +- executor/programs/rust/ethrex/Cargo.lock | 157 +++++++++------------ executor/programs/rust/ethrex/Cargo.toml | 49 +++++-- executor/tests/README.md | 8 +- executor/tests/ethrex_10_transfers.bin | Bin 13474 -> 13492 bytes executor/tests/ethrex_bench_4.bin | Bin 16174 -> 16192 bytes executor/tests/ethrex_empty_block.bin | Bin 8526 -> 8544 bytes executor/tests/ethrex_simple_tx.bin | Bin 11548 -> 11566 bytes scripts/set_ethrex_rev.sh | 87 ++++++++++++ tooling/ethrex-block-converter/Cargo.lock | 129 ++++++++++------- tooling/ethrex-block-converter/Cargo.toml | 8 +- tooling/ethrex-block-converter/src/main.rs | 2 +- tooling/ethrex-fixtures/Cargo.lock | 109 ++++++++++---- tooling/ethrex-fixtures/Cargo.toml | 10 +- tooling/ethrex-tests/Cargo.lock | 84 ++++++++--- tooling/ethrex-tests/Cargo.toml | 2 +- 18 files changed, 564 insertions(+), 217 deletions(-) create mode 100644 BUMP_797df554_RESULTS.md create mode 100755 scripts/set_ethrex_rev.sh diff --git a/BUMP_797df554_RESULTS.md b/BUMP_797df554_RESULTS.md new file mode 100644 index 000000000..21a6b1525 --- /dev/null +++ b/BUMP_797df554_RESULTS.md @@ -0,0 +1,130 @@ +# Bumping the ethrex pin to `797df554` + +Moves the guest from `4f658c2b` (2026-07-31, on the unmerged +`feat/lambdavm-prover-backend` branch) to `797df554` (2026-08-07, on ethrex +`main`). + +## Results + +Real mainnet block 25368371 — the fixture `bench_abba.sh`, `bench_verify.sh`, +`perf_diff.sh` and `benchmark-pr.yml` all resolve through +`make print-real-block-fixture`. + +| | before (`4f658c2b`) | after (`797df554`) | delta | +|---|---|---|---| +| **Proving time** (median of 3) | **120.715 s** | **110.259 s** | **−8.66%** | +| run spread | 0.681 s (0.56%) | 0.821 s (0.74%) | | +| Executed cycles | 34,241,608 | 30,498,818 | −10.93% | +| **Epochs** (2^22) | **9** | **8** | −1 | +| Peak heap | 47.3 GB | 46.2 GB | −2.4% | + +10.46 s off every proof, against a run spread below 0.8% on both sides — the +delta is roughly twelve times the noise. + +Against `main`'s pin (`156cb8d6`, 2026-05-22) the guest goes from **39,563,400** +to **30,498,818** cycles, **−22.9%**. + +### Time does not track cycles + +−10.93% of cycles buys −8.66% of proving time, and that gap is structural rather +than measurement error: proving cost also carries per-epoch fixed work and table +rows that do not shrink with the instruction count. Quoting a cycle delta as if it +were a time delta will overpromise. + +The epoch count is the clearest instance. At 2^22 cycles per epoch, 34.2M needed 9 +and 30.5M fits in 8, and that single step accounts for much of the 10 s. It also +means the next increment of cycle savings returns less until it drops the ninth +epoch — the benefit arrives in steps, not smoothly. + +## What changed + +**The pin**, in all 11 places (`scripts/set_ethrex_rev.sh` moves them together, so +the guest and the fixture tooling cannot drift apart — a mismatch there does not +fail to build, it produces a fixture the guest silently misreads). + +**The `lambdavm` feature is gone**, and not replaced. `ethrex-guest-program` +carries one feature per zkVM and none of them selects a backend: each is only a +list of optional crypto dependencies, and none gates any method of the `Crypto` +trait (its gates are `secp256k1`, `c-kzg`, `blst`, `std`). Measured against the +sibling feature that activates the widest dependency set, ethrex's own precompile +stress fixtures come out identical to the cycle — `stress_modexp_150M` +6,373,285,966 and `stress_alt_bn128_150M` 22,986,061,145 both ways — with the real +block at 30,498,818 vs 30,501,620 and a 2,928-byte smaller ELF. + +Requiring `lambdavm` is what tied the guest to the backend branch, since that is +the only place it exists. What makes this guest LambdaVM never travelled through +it: `lambda-vm-syscalls`, `lambda-vm-ethrex-crypto` and the +`riscv64im-lambda-vm-elf` target are direct, and every run above reports 116 ECSM +and 10,659 keccak precompile calls — the injected crypto is live on both sides. + +**Fixtures regenerated.** The rkyv `ProgramInput` layout moved with the rev, so +every committed `.bin` from the old pin fails to deserialize. All four synthetic +fixtures plus the real block were rebuilt; the converter's reproducibility digest +was updated, which is what that test asks for on a legitimate rev bump. + +| fixture | cycles | ECSM | +|---|---|---| +| `ethrex_empty_block` | 431,162 | 0 | +| `ethrex_simple_tx` | 653,263 | 4 | +| `ethrex_bench_4` | 1,047,001 | 16 | +| `ethrex_10_transfers` | 1,286,761 | 40 | +| real block 25368371 | 30,498,818 | 116 | + +## Why `797df554` and not something newer + +`b5271885` (2026-08-14) rewrites the guest entry point from `ProgramInput` / +`execution_program` to `run_stateless_guest` taking schema-prefixed SSZ +`statelessInputBytes`. Past that commit this is no longer a pin bump — it needs a +new guest shim and a new fixture format. `797df554` is the last point where the +bump is only the rev. + +Within that window it is also the right end of it: between 2026-08-07 and the +boundary there are 14 commits and **no `perf(levm)`**. The two that matter — +`perf(levm): monomorphize the dispatch loop on the validation observer` (#7105) +and `perf(l1): give branch-node hashing a monomorphic RLP encoder` (#7104) — are +already in. + +Release tags do not help here. `v24.0.0`'s commit predates both, and it is +*diverged* from `main` (4 commits of its own, 66 behind) because ethrex cuts +releases from a side branch rather than from the tip — so a tag can lack work that +is already merged. `v25.0.0` is past the API boundary. + +## Method + +`vm-benchmarks-1`, 96 cores / 125 GB, rustc 1.94.0. The real-block step of +`.github/workflows/benchmark-pr.yml` verbatim: + +``` +cli prove $ELF --private-input $REAL_INPUT \ + --continuations --epoch-size-log2 22 -o /tmp/real_proof.bin --time +``` + +3 runs per side, reported as median plus spread. + +Both sides started on an idle box (load 0.61 and 1.99). The baseline was held back +until load fell below 3 after the first side finished — starting it hot would have +inflated the baseline and flattered the bump. + +Each side used **its own canonical fixture**: the baseline fetched the published +`_4f658c2b` release asset, the bumped side used the newly generated `_797df554` +one. They cannot share a file — the rkyv layout differs — and each side's own +asset is what CI would fetch, which is the honest comparison rather than two +ad-hoc conversions. + +Cycle counts are deterministic: the bumped side reported 30,498,818 identically on +a laptop and on the bench box. + +Raw logs in `bench_ethrex_bump_20260826/`. + +## Before merging + +`ethrex_mainnet_25368371_797df554.bin` (in the repo root) must be uploaded to the +`bench-fixtures-v1` release of **yetanotherco/lambda_vm**. The Makefile already +points at it with its sha256; until the asset exists, `make +ethrex-real-block-fixture` works locally (the file is in place and verifies) but +CI cannot fetch it. + +This also stops being a routine bump: it leaves `feat/lambdavm-prover-backend` and +consumes ethrex `main` as a library. That branch is 69 commits behind `main` and +has not moved since 2026-08-04, so waiting for it to merge was itself costing the +−22.9% above. The PR's existing approval predates this change. diff --git a/Makefile b/Makefile index b1f13c9e6..9c4c096a1 100644 --- a/Makefile +++ b/Makefile @@ -311,8 +311,8 @@ ETHREX_REAL_BLOCK := 25368371 # archived ProgramInput layout moves with the pin, so one block has one fixture per rev. # Uploading under a new name rather than replacing the old one keeps `main` — which still # expects the pre-bump sha256 — fetching its own artifact while this branch is open. -ETHREX_REAL_BLOCK_FIXTURE_URL := https://github.com/yetanotherco/lambda_vm/releases/download/bench-fixtures-v1/ethrex_mainnet_25368371_4f658c2b.bin -ETHREX_REAL_BLOCK_FIXTURE_SHA256 := 0a301731b84515260c2ad7779fef3e4ef8b2424fbcc055ee2f5a224bc88120ab +ETHREX_REAL_BLOCK_FIXTURE_URL := https://github.com/yetanotherco/lambda_vm/releases/download/bench-fixtures-v1/ethrex_mainnet_25368371_797df554.bin +ETHREX_REAL_BLOCK_FIXTURE_SHA256 := 573004e62e3680a00d3cdbae19dc4897e2ec60d6ec0c1d05d9ef118cb8aef17f # The block's source cache, hosted in the same release. Only `regen-real-block-fixture` # reads it — the converter's TESTS use a different, upstream-pinned cache (below). ETHREX_REAL_BLOCK_CACHE_URL := https://github.com/yetanotherco/lambda_vm/releases/download/bench-fixtures-v1/cache_mainnet_25368371.json diff --git a/crypto/ethrex-crypto/Cargo.toml b/crypto/ethrex-crypto/Cargo.toml index 5310c00b0..09d53ac3b 100644 --- a/crypto/ethrex-crypto/Cargo.toml +++ b/crypto/ethrex-crypto/Cargo.toml @@ -18,7 +18,7 @@ license = "MIT OR Apache-2.0" # Defines the `Crypto` trait, `CryptoError`, and `keccak::keccak_hash`. Same rev # + `default-features = false` as the guest's ethrex-crypto, so feature # unification adds nothing to the guest build (no C secp256k1 / malachite / kzg). -ethrex-crypto = { git = "https://github.com/lambdaclass/ethrex.git", rev = "4f658c2b3d10e3f21d35ce546870f55ca3f940fc", package = "ethrex-crypto", default-features = false } +ethrex-crypto = { git = "https://github.com/lambdaclass/ethrex.git", rev = "797df5540c7d35cafd69b6971a74b2a49c67d1dd", package = "ethrex-crypto", default-features = false } # Pinned to the exact 0.13.4 ethrex uses so the guest resolves a single k256 # (a version split would make `FieldElement`/`Scalar` incompatible types). # `expose-field` is required by the x-only reconstruction. diff --git a/executor/programs/rust/ethrex/Cargo.lock b/executor/programs/rust/ethrex/Cargo.lock index 93a5d800d..63705e473 100644 --- a/executor/programs/rust/ethrex/Cargo.lock +++ b/executor/programs/rust/ethrex/Cargo.lock @@ -189,22 +189,6 @@ version = "1.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06" -[[package]] -name = "bitcoin-io" -version = "0.1.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11301df0b06f22dea7bb1916403fdd88a371031e495c49b8f96931b28189e175" - -[[package]] -name = "bitcoin_hashes" -version = "0.14.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c9901a56e133a1fc86eeb1113e2591f45f4682451ca893bff494d2f88918e3f" -dependencies = [ - "bitcoin-io", - "hex-conservative", -] - [[package]] name = "bitvec" version = "1.0.1" @@ -226,19 +210,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "bls12_381" -version = "0.8.0" -source = "git+https://github.com/lambdaclass/bls12_381?branch=expose-affine-constructors#78cad0378b17fc3157b83f514be192bf46edf9a1" -dependencies = [ - "digest", - "ff", - "group", - "pairing", - "rand_core 0.6.4", - "subtle", -] - [[package]] name = "bs58" version = "0.5.1" @@ -697,8 +668,8 @@ dependencies = [ [[package]] name = "ethrex-common" -version = "22.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" +version = "23.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=797df5540c7d35cafd69b6971a74b2a49c67d1dd#797df5540c7d35cafd69b6971a74b2a49c67d1dd" dependencies = [ "bytes", "crc32fast", @@ -712,6 +683,10 @@ dependencies = [ "indexmap 2.14.0", "lazy_static", "libc", + "libssz", + "libssz-derive", + "libssz-merkle", + "libssz-types", "lru", "once_cell", "rkyv", @@ -725,8 +700,8 @@ dependencies = [ [[package]] name = "ethrex-crypto" -version = "22.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" +version = "23.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=797df5540c7d35cafd69b6971a74b2a49c67d1dd#797df5540c7d35cafd69b6971a74b2a49c67d1dd" dependencies = [ "ark-bn254", "ark-ec", @@ -745,10 +720,9 @@ dependencies = [ [[package]] name = "ethrex-guest-program" -version = "22.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" +version = "23.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=797df5540c7d35cafd69b6971a74b2a49c67d1dd#797df5540c7d35cafd69b6971a74b2a49c67d1dd" dependencies = [ - "bls12_381", "bytes", "ethereum-types", "ethrex-common", @@ -756,10 +730,7 @@ dependencies = [ "ethrex-l2-common", "ethrex-rlp", "ethrex-vm", - "ff", "hex", - "k256", - "lambda-vm-syscalls", "rkyv", "serde", "serde_with", @@ -768,8 +739,8 @@ dependencies = [ [[package]] name = "ethrex-l2-common" -version = "22.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" +version = "23.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=797df5540c7d35cafd69b6971a74b2a49c67d1dd#797df5540c7d35cafd69b6971a74b2a49c67d1dd" dependencies = [ "bytes", "ethereum-types", @@ -778,7 +749,6 @@ dependencies = [ "k256", "lambdaworks-crypto", "rkyv", - "secp256k1", "serde", "serde_with", "thiserror 2.0.18", @@ -787,14 +757,15 @@ dependencies = [ [[package]] name = "ethrex-levm" -version = "22.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" +version = "23.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=797df5540c7d35cafd69b6971a74b2a49c67d1dd#797df5540c7d35cafd69b6971a74b2a49c67d1dd" dependencies = [ "bytes", "derive_more", "ethrex-common", "ethrex-crypto", "ethrex-rlp", + "libssz", "malachite", "rustc-hash", "serde", @@ -804,8 +775,8 @@ dependencies = [ [[package]] name = "ethrex-rlp" -version = "22.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" +version = "23.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=797df5540c7d35cafd69b6971a74b2a49c67d1dd#797df5540c7d35cafd69b6971a74b2a49c67d1dd" dependencies = [ "bytes", "ethereum-types", @@ -814,8 +785,8 @@ dependencies = [ [[package]] name = "ethrex-trie" -version = "22.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" +version = "23.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=797df5540c7d35cafd69b6971a74b2a49c67d1dd#797df5540c7d35cafd69b6971a74b2a49c67d1dd" dependencies = [ "anyhow", "bytes", @@ -834,8 +805,8 @@ dependencies = [ [[package]] name = "ethrex-vm" -version = "22.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" +version = "23.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=797df5540c7d35cafd69b6971a74b2a49c67d1dd#797df5540c7d35cafd69b6971a74b2a49c67d1dd" dependencies = [ "bytes", "derive_more", @@ -856,7 +827,6 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" dependencies = [ - "bitvec", "rand_core 0.6.4", "subtle", ] @@ -1019,15 +989,6 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" -[[package]] -name = "hex-conservative" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda06d18ac606267c40c04e41b9947729bf8b9efe74bd4e82b61a5f26a510b9f" -dependencies = [ - "arrayvec", -] - [[package]] name = "hex-literal" version = "0.4.1" @@ -1284,6 +1245,47 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" +[[package]] +name = "libssz" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d498c0482bba87d2647ea4601ea76cf2b498065e3958798a88f49274f3ced5e9" +dependencies = [ + "smallvec", +] + +[[package]] +name = "libssz-derive" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08ddfb5c969c28a4a54043e630f80c723352637bd1020f256ee3ac7a8814922b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "libssz-merkle" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63c6d6d5ce5d79bba66bc98c99869eedffedf7f14f0aa0915f1a62802650bdf6" +dependencies = [ + "libssz", + "sha2", +] + +[[package]] +name = "libssz-types" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "747273ab2d923e82ed147091fe0fb3e602dd2012c872cdad5efe69e27c3b4099" +dependencies = [ + "libssz", + "libssz-merkle", + "smallvec", +] + [[package]] name = "log" version = "0.4.32" @@ -1429,15 +1431,6 @@ dependencies = [ "sha2", ] -[[package]] -name = "pairing" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fec4625e73cf41ef4bb6846cafa6d44736525f442ba45e407c4a000a13996f" -dependencies = [ - "group", -] - [[package]] name = "parity-scale-codec" version = "3.7.5" @@ -1861,26 +1854,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "secp256k1" -version = "0.30.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b50c5943d326858130af85e049f2661ba3c78b26589b8ab98e65e80ae44a1252" -dependencies = [ - "bitcoin_hashes", - "rand 0.8.6", - "secp256k1-sys", -] - -[[package]] -name = "secp256k1-sys" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4387882333d3aa8cb20530a17c69a3752e97837832f34f6dccc760e715001d9" -dependencies = [ - "cc", -] - [[package]] name = "serde" version = "1.0.228" @@ -2005,6 +1978,12 @@ version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" +[[package]] +name = "smallvec" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ed6a63f02c8539c91a8685a86f4099661ba3da017932f6ebbea6de3f0fa7c90" + [[package]] name = "spin" version = "0.9.9" diff --git a/executor/programs/rust/ethrex/Cargo.toml b/executor/programs/rust/ethrex/Cargo.toml index 58d63cd5f..1d2ef0f4a 100644 --- a/executor/programs/rust/ethrex/Cargo.toml +++ b/executor/programs/rust/ethrex/Cargo.toml @@ -18,20 +18,49 @@ lambda-vm-syscalls = { path = "../../../../syscalls" } # lambda_vm repo and injected in src/main.rs — so crypto changes stay in our repo # and don't require an ethrex PR. lambda-vm-ethrex-crypto = { path = "../../../../crypto/ethrex-crypto" } -# Pinned by immutable `rev` to a commit on the open LambdaVM-backend PR branch -# (feat/lambdavm-prover-backend) of ethrex; re-pin to the merge commit once it -# lands on ethrex `main`. The `lambdavm` feature is kept only for its dependency -# wiring (`ProgramInput`/`execution_program`/`ProgramOutput::encode` + pure-Rust -# crypto defaults); ethrex's own `LambdaVmCrypto` compiles unused — we inject our -# own. KZG is NOT linked under this feature, so the point-evaluation precompile -# (0x0a) is unsupported — see src/main.rs. -ethrex-guest-program = { git = "https://github.com/lambdaclass/ethrex.git", rev = "4f658c2b3d10e3f21d35ce546870f55ca3f940fc", package = "ethrex-guest-program", default-features = false, features = ["lambdavm"] } +# Pinned by immutable `rev` to a commit on ethrex `main`. It used to point at the +# open LambdaVM-backend PR branch (`feat/lambdavm-prover-backend`) and wait for +# that to merge; it no longer does, because the branch stopped moving 69 commits +# behind `main` while guest performance work kept landing there. Measured on the +# real benchmark block, that wait had grown to -22.9%. +# +# No `features = [...]`, deliberately — not even `lambdavm`. +# +# `ethrex-guest-program` carries one feature per zkVM and, despite the names, none +# of them selects a backend: each is only a list of optional crypto dependencies +# to activate, and none gates any method of the `Crypto` trait (its gates are +# `secp256k1`, `c-kzg`, `blst`, `std`). `lambdavm` was +# `["dep:k256", "dep:lambda-vm-syscalls", "ethrex-l2-common/secp256k1"]`, and +# since #702 moved the `Crypto` impl into this repo the syscalls it pulled are for +# ethrex's own provider, which we no longer use — while this guest already depends +# on `lambda-vm-syscalls` by path, three lines above. +# +# What makes this guest LambdaVM is those path deps plus the +# `riscv64im-lambda-vm-elf` target. None of it travels through a feature: every +# run reports its ECSM and keccak precompile calls, which is what actually proves +# the injected crypto is live. +# +# Verified rather than assumed. Against the sibling feature activating the widest +# dependency set, ethrex's own precompile stress fixtures come out identical to +# the cycle — `stress_modexp_150M` 6,373,285,966 and `stress_alt_bn128_150M` +# 22,986,061,145 both ways — and the real benchmark block is 30,498,818 here vs +# 30,501,620 there, with a 2,928-byte smaller ELF. The difference is dead +# `substrate-bn`/`bls12_381` that the arkworks-based trait defaults never call. +# +# Declaring nothing is also what frees the pin: `lambdavm` exists ONLY on that +# unmerged branch, so requiring it is precisely what tied this guest to it. See +# scripts/bench_ethrex_pr.sh, which re-pins across arbitrary revs to measure +# upstream guest PRs. +# +# KZG is not linked, so the point-evaluation precompile (0x0a) is unsupported — +# see src/main.rs. +ethrex-guest-program = { git = "https://github.com/lambdaclass/ethrex.git", rev = "797df5540c7d35cafd69b6971a74b2a49c67d1dd", package = "ethrex-guest-program", default-features = false } # Exact pin: must match the fixture writer (tooling/ethrex-fixtures) and the # executor test reader so the rkyv ProgramInput layout stays consistent. rkyv = { version = "=0.8.16", features = ["std", "unaligned"] } -# `ethrex-guest-program`'s `lambdavm` feature git-deps `lambda-vm-syscalls` at a -# pinned commit of THIS repo, which upstream bumps on its own schedule. Override it +# `lambda-vm-syscalls` can still reach the graph as a git dep pinned to a commit +# of THIS repo, which upstream bumps on its own schedule. Override it # with the working-tree copy so the guest always links the same syscalls as the rest # of the repo — including uncommitted local edits — rather than whatever commit # ethrex last pinned. (At the current ethrex rev the two happen to coincide; this diff --git a/executor/tests/README.md b/executor/tests/README.md index fc6b3f8a8..6ecbc7212 100644 --- a/executor/tests/README.md +++ b/executor/tests/README.md @@ -48,19 +48,19 @@ Known fixtures: ```text ethrex_empty_block.bin - sha256: ca7454142f13db5d04356366e3917d264cbea709ddd1b5e6526720dbaa12064d + sha256: 8d6f6061c71c23fad1d5dee26242d631efe0bff8d7f49422c2ba4cde9d4be919 contents: stateless ethrex empty block ProgramInput (0 transactions) ethrex_simple_tx.bin - sha256: 29c1607297d21d88accb33767c8e03eb6536d746e6b2399930afdc9d67f1fe3f + sha256: c40bce364f22758ab7fa6fe8b45ce4c305dee5add4536ef6dca0e74e410e2729 contents: stateless ethrex block with one plain ETH transfer transaction ethrex_10_transfers.bin - sha256: d04cfed35bd16c8248ab8ebf2f3ca2ff01c08269271b17e5d5db3b1f22ea03ad + sha256: 4d862e8537284729ff11c7bcf91c971e562dd6bbce2a1e181ba5bf48cb6b65cf contents: stateless ethrex block with ten plain ETH transfer transactions ethrex_bench_4.bin - sha256: bb26e6d6595f537c2fd57bfd59da6abe82241bd92690a21c2225da94d5cf507a + sha256: 03ed0d175622af6ef9a981d7652ba7c86630b9473f49cae17edf649724b704e1 contents: stateless ethrex block with four plain ETH transfers, `distinct` mode (N senders -> N recipients); read by the recursion profile target ``` diff --git a/executor/tests/ethrex_10_transfers.bin b/executor/tests/ethrex_10_transfers.bin index dd9303cfe4167942b6d264c42058a2ddc6c3c544..201351189e5462b12704ee2e5084ad44ab349682 100644 GIT binary patch delta 70 zcmZ3Kxg~Rh2KU4OPKonh{{QD-G`~N?XVqlblFeWeLmfRf4ZKlq6Wb*_gX~xM5 WM7SrfHQvqi?f2x15(bkExHtggr5hsv delta 74 zcmdmzxhQjk2DkK$FaQ5@F)%Rb{QdtQNHH)fLm9@!lNEV{H^*~ZsxzM5Jkv;;ak2py X$7CI2&dKMD*D(G6J(*F|03-weDz6$@ diff --git a/executor/tests/ethrex_bench_4.bin b/executor/tests/ethrex_bench_4.bin index 6b716bfc9002715b7c010a4d17072122742f5b75..23c2453ee946e46c1b8ab3d8b9fca79d03b11d11 100644 GIT binary patch delta 74 zcmZ2icc5;A3fsg0PKnDu|Nm!UU|>-G`~N?XVqlblFeZOsliVE2cFc^?WV4K|G~?tC ahTN0&SlK4q+ihj~_IvU}4TH%#tQ-Jb7aT1B delta 61 zcmX?5x2|r33Y*ZKpa1`}FfcIa{QdtQNHH)fZ?khSCNE@`+|0&oC&PGjv#Y!`-G`~N?XVqlblFec}*NN&E&Y^Kh5WHXnxG~?t4 ZQrwgKwAm-?>1<*8_It9Tq!EzI1^_i%8+QNz delta 61 zcmZ1%H79DrB4(kuKmY$TGB7ac{QdtQNHH)fZ{Euss?K diff --git a/scripts/set_ethrex_rev.sh b/scripts/set_ethrex_rev.sh new file mode 100755 index 000000000..0ae03673d --- /dev/null +++ b/scripts/set_ethrex_rev.sh @@ -0,0 +1,87 @@ +#!/usr/bin/env bash +# Re-pin every ethrex git dependency in this repo to one rev, atomically. +# +# The guest and the host-side tooling exchange ethrex types (the SSZ stateless +# input the converter writes and the guest decodes), so a rev that differs +# between them is not a version skew that fails to build -- it is a fixture the +# guest silently decodes as the all-zero default. Keeping every pin on one rev +# is what makes that impossible, which is why this rewrites all of them together +# rather than leaving them to be bumped by hand. +# +# Usage: +# scripts/set_ethrex_rev.sh <40-char-sha> re-pin everything +# scripts/set_ethrex_rev.sh --guest-only <40-char-sha> re-pin only the guest graph +# scripts/set_ethrex_rev.sh --show print the current pin(s) +# +# `--guest-only` moves the crates the guest ELF is built from and leaves the +# host-side fixture tooling where it is. That split is what lets a benchmark vary +# the guest across two revs while holding the fixture constant: the fixture is +# just bytes, its wire format does not change within a PR, and regenerating it per +# rev would instead drag the whole ethrex HOST api (which does drift) into the +# measurement. +set -euo pipefail + +REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +cd "$REPO_ROOT" + +# Every manifest carrying an ethrex git dep. Kept explicit rather than globbed so +# a new one has to be added deliberately -- a manifest silently left behind is +# exactly the skew described above. +# The guest ELF's own graph. `crypto/ethrex-crypto` is a path dep of BOTH the +# guest and the converter, so moving it moves what the converter links too -- +# which is why a `--guest-only` run must come after the fixture already exists. +GUEST_MANIFESTS=( + executor/programs/rust/ethrex/Cargo.toml + crypto/ethrex-crypto/Cargo.toml +) + +# Host-side tooling: builds fixtures, never lands in the ELF. +TOOLING_MANIFESTS=( + tooling/ethrex-tests/Cargo.toml + tooling/ethrex-block-converter/Cargo.toml + tooling/ethrex-fixtures/Cargo.toml +) + +MANIFESTS=("${GUEST_MANIFESTS[@]}" "${TOOLING_MANIFESTS[@]}") + +current_revs() { + grep -ho 'rev = "[0-9a-f]\{40\}"' "${MANIFESTS[@]}" | sort -u | sed 's/rev = //;s/"//g' +} + +if [[ "${1:-}" == "--show" || $# -eq 0 ]]; then + # No `mapfile`: macOS ships bash 3.2, where it does not exist. + revs="$(current_revs)" + if [[ "$(printf '%s\n' "$revs" | wc -l | tr -d ' ')" == "1" ]]; then + echo "$revs" + else + # Expected mid-benchmark (a `--guest-only` re-pin is exactly this state), so + # report it rather than failing. + echo "MIXED:" >&2 + printf ' %s\n' $revs >&2 + exit 1 + fi + exit 0 +fi + +TARGETS=("${MANIFESTS[@]}") +SCOPE="all manifests" +if [[ "${1:-}" == "--guest-only" ]]; then + shift + TARGETS=("${GUEST_MANIFESTS[@]}") + SCOPE="the guest graph only" +fi + +NEW_REV="${1:-}" +if [[ ! "$NEW_REV" =~ ^[0-9a-f]{40}$ ]]; then + echo "error: expected a 40-character commit sha, got '$NEW_REV'" >&2 + exit 2 +fi + +for manifest in "${TARGETS[@]}"; do + [[ -f "$manifest" ]] || { echo "error: missing $manifest" >&2; exit 1; } + # Only rewrite revs on ethrex deps: the same file may pin other git deps. + perl -pi -e 's{(github\.com/lambdaclass/ethrex\.git", rev = ")[0-9a-f]{40}(")}{${1}'"$NEW_REV"'${2}}g' "$manifest" +done + +echo "re-pinned $SCOPE to $NEW_REV:" +printf ' %s\n' "${TARGETS[@]}" diff --git a/tooling/ethrex-block-converter/Cargo.lock b/tooling/ethrex-block-converter/Cargo.lock index e68dfc38c..5c216acbb 100644 --- a/tooling/ethrex-block-converter/Cargo.lock +++ b/tooling/ethrex-block-converter/Cargo.lock @@ -305,19 +305,6 @@ dependencies = [ "objc2", ] -[[package]] -name = "bls12_381" -version = "0.8.0" -source = "git+https://github.com/lambdaclass/bls12_381?branch=expose-affine-constructors#78cad0378b17fc3157b83f514be192bf46edf9a1" -dependencies = [ - "digest", - "ff", - "group", - "pairing", - "rand_core 0.6.4", - "subtle", -] - [[package]] name = "blst" version = "0.3.17" @@ -877,18 +864,21 @@ dependencies = [ [[package]] name = "ethrex-blockchain" -version = "22.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" +version = "23.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=797df5540c7d35cafd69b6971a74b2a49c67d1dd#797df5540c7d35cafd69b6971a74b2a49c67d1dd" dependencies = [ "bytes", "crossbeam", "ethrex-common", "ethrex-crypto", + "ethrex-guest-program", "ethrex-metrics", "ethrex-rlp", "ethrex-storage", "ethrex-trie", "ethrex-vm", + "libssz", + "libssz-merkle", "rayon", "rustc-hash", "thiserror 2.0.19", @@ -899,8 +889,8 @@ dependencies = [ [[package]] name = "ethrex-common" -version = "22.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" +version = "23.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=797df5540c7d35cafd69b6971a74b2a49c67d1dd#797df5540c7d35cafd69b6971a74b2a49c67d1dd" dependencies = [ "bytes", "crc32fast", @@ -914,6 +904,10 @@ dependencies = [ "indexmap 2.14.0", "lazy_static", "libc", + "libssz", + "libssz-derive", + "libssz-merkle", + "libssz-types", "lru", "once_cell", "rkyv", @@ -927,8 +921,8 @@ dependencies = [ [[package]] name = "ethrex-config" -version = "22.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" +version = "23.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=797df5540c7d35cafd69b6971a74b2a49c67d1dd#797df5540c7d35cafd69b6971a74b2a49c67d1dd" dependencies = [ "ethrex-common", "ethrex-p2p", @@ -939,8 +933,8 @@ dependencies = [ [[package]] name = "ethrex-crypto" -version = "22.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" +version = "23.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=797df5540c7d35cafd69b6971a74b2a49c67d1dd#797df5540c7d35cafd69b6971a74b2a49c67d1dd" dependencies = [ "ark-bn254", "ark-ec", @@ -960,10 +954,9 @@ dependencies = [ [[package]] name = "ethrex-guest-program" -version = "22.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" +version = "23.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=797df5540c7d35cafd69b6971a74b2a49c67d1dd#797df5540c7d35cafd69b6971a74b2a49c67d1dd" dependencies = [ - "bls12_381", "bytes", "ethereum-types", "ethrex-common", @@ -971,10 +964,7 @@ dependencies = [ "ethrex-l2-common", "ethrex-rlp", "ethrex-vm", - "ff", "hex", - "k256", - "lambda-vm-syscalls", "rkyv", "serde", "serde_with", @@ -983,8 +973,8 @@ dependencies = [ [[package]] name = "ethrex-l2-common" -version = "22.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" +version = "23.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=797df5540c7d35cafd69b6971a74b2a49c67d1dd#797df5540c7d35cafd69b6971a74b2a49c67d1dd" dependencies = [ "bytes", "ethereum-types", @@ -993,7 +983,6 @@ dependencies = [ "k256", "lambdaworks-crypto", "rkyv", - "secp256k1", "serde", "serde_with", "thiserror 2.0.19", @@ -1002,14 +991,15 @@ dependencies = [ [[package]] name = "ethrex-levm" -version = "22.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" +version = "23.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=797df5540c7d35cafd69b6971a74b2a49c67d1dd#797df5540c7d35cafd69b6971a74b2a49c67d1dd" dependencies = [ "bytes", "derive_more", "ethrex-common", "ethrex-crypto", "ethrex-rlp", + "libssz", "malachite", "rustc-hash", "serde", @@ -1019,8 +1009,8 @@ dependencies = [ [[package]] name = "ethrex-metrics" -version = "22.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" +version = "23.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=797df5540c7d35cafd69b6971a74b2a49c67d1dd#797df5540c7d35cafd69b6971a74b2a49c67d1dd" dependencies = [ "ethrex-common", "serde", @@ -1031,8 +1021,8 @@ dependencies = [ [[package]] name = "ethrex-p2p" -version = "22.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" +version = "23.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=797df5540c7d35cafd69b6971a74b2a49c67d1dd#797df5540c7d35cafd69b6971a74b2a49c67d1dd" dependencies = [ "aes", "aes-gcm", @@ -1073,8 +1063,8 @@ dependencies = [ [[package]] name = "ethrex-rlp" -version = "22.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" +version = "23.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=797df5540c7d35cafd69b6971a74b2a49c67d1dd#797df5540c7d35cafd69b6971a74b2a49c67d1dd" dependencies = [ "bytes", "ethereum-types", @@ -1083,8 +1073,8 @@ dependencies = [ [[package]] name = "ethrex-storage" -version = "22.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" +version = "23.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=797df5540c7d35cafd69b6971a74b2a49c67d1dd#797df5540c7d35cafd69b6971a74b2a49c67d1dd" dependencies = [ "anyhow", "bytes", @@ -1105,8 +1095,8 @@ dependencies = [ [[package]] name = "ethrex-trie" -version = "22.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" +version = "23.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=797df5540c7d35cafd69b6971a74b2a49c67d1dd#797df5540c7d35cafd69b6971a74b2a49c67d1dd" dependencies = [ "anyhow", "bytes", @@ -1125,8 +1115,8 @@ dependencies = [ [[package]] name = "ethrex-vm" -version = "22.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" +version = "23.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=797df5540c7d35cafd69b6971a74b2a49c67d1dd#797df5540c7d35cafd69b6971a74b2a49c67d1dd" dependencies = [ "bytes", "derive_more", @@ -1159,7 +1149,6 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" dependencies = [ - "bitvec", "rand_core 0.6.4", "subtle", ] @@ -1700,6 +1689,47 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" +[[package]] +name = "libssz" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d498c0482bba87d2647ea4601ea76cf2b498065e3958798a88f49274f3ced5e9" +dependencies = [ + "smallvec", +] + +[[package]] +name = "libssz-derive" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08ddfb5c969c28a4a54043e630f80c723352637bd1020f256ee3ac7a8814922b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "libssz-merkle" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63c6d6d5ce5d79bba66bc98c99869eedffedf7f14f0aa0915f1a62802650bdf6" +dependencies = [ + "libssz", + "sha2", +] + +[[package]] +name = "libssz-types" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "747273ab2d923e82ed147091fe0fb3e602dd2012c872cdad5efe69e27c3b4099" +dependencies = [ + "libssz", + "libssz-merkle", + "smallvec", +] + [[package]] name = "lock_api" version = "0.4.14" @@ -1926,15 +1956,6 @@ dependencies = [ "sha2", ] -[[package]] -name = "pairing" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fec4625e73cf41ef4bb6846cafa6d44736525f442ba45e407c4a000a13996f" -dependencies = [ - "group", -] - [[package]] name = "parity-scale-codec" version = "3.7.5" diff --git a/tooling/ethrex-block-converter/Cargo.toml b/tooling/ethrex-block-converter/Cargo.toml index 87550cd8a..28f8d7e1d 100644 --- a/tooling/ethrex-block-converter/Cargo.toml +++ b/tooling/ethrex-block-converter/Cargo.toml @@ -9,13 +9,13 @@ edition = "2024" [dependencies] # Pinned to the SAME ethrex rev as the guest (open LambdaVM-backend PR branch) # so the generated ProgramInput rkyv layout matches what the guest deserializes. -ethrex-common = { git = "https://github.com/lambdaclass/ethrex.git", rev = "4f658c2b3d10e3f21d35ce546870f55ca3f940fc", package = "ethrex-common", default-features = false } -ethrex-config = { git = "https://github.com/lambdaclass/ethrex.git", rev = "4f658c2b3d10e3f21d35ce546870f55ca3f940fc", package = "ethrex-config", default-features = false } +ethrex-common = { git = "https://github.com/lambdaclass/ethrex.git", rev = "797df5540c7d35cafd69b6971a74b2a49c67d1dd", package = "ethrex-common", default-features = false } +ethrex-config = { git = "https://github.com/lambdaclass/ethrex.git", rev = "797df5540c7d35cafd69b6971a74b2a49c67d1dd", package = "ethrex-config", default-features = false } # Only for `NativeCrypto`, the host `Crypto` impl that `into_execution_witness` # now takes. Nothing re-exports it, and this crate's own guest-crypto impl is a # dev-dependency, so the bin build needs its own line. Already in the graph via # `ethrex-config` → `ethrex-p2p`, so this adds no compilation. -ethrex-crypto = { git = "https://github.com/lambdaclass/ethrex.git", rev = "4f658c2b3d10e3f21d35ce546870f55ca3f940fc", package = "ethrex-crypto", default-features = false } +ethrex-crypto = { git = "https://github.com/lambdaclass/ethrex.git", rev = "797df5540c7d35cafd69b6971a74b2a49c67d1dd", package = "ethrex-crypto", default-features = false } # Matches the guest's own declaration (executor/programs/rust/ethrex/Cargo.toml). # # CAVEAT: this line alone does NOT reproduce the guest's precompile surface. The @@ -26,7 +26,7 @@ ethrex-crypto = { git = "https://github.com/lambdaclass/ethrex.git", rev = "4f65 # `ark-ff/asm` BN254) that the guest does not have; verify with # `cargo tree -e features -i ethrex-crypto`. Closing that gap means dropping # `ethrex-config` and sourcing `ChainConfig` another way — see the README. -ethrex-guest-program = { git = "https://github.com/lambdaclass/ethrex.git", rev = "4f658c2b3d10e3f21d35ce546870f55ca3f940fc", package = "ethrex-guest-program", default-features = false, features = ["lambdavm"] } +ethrex-guest-program = { git = "https://github.com/lambdaclass/ethrex.git", rev = "797df5540c7d35cafd69b6971a74b2a49c67d1dd", package = "ethrex-guest-program", default-features = false } # Exact pin: the fixture writer and the guest/executor readers must agree on the # rkyv layout. Keep this in sync with the guest diff --git a/tooling/ethrex-block-converter/src/main.rs b/tooling/ethrex-block-converter/src/main.rs index 545c7cc6e..87bdfe51d 100644 --- a/tooling/ethrex-block-converter/src/main.rs +++ b/tooling/ethrex-block-converter/src/main.rs @@ -230,7 +230,7 @@ mod tests { .map(|b| format!("{b:02x}")) .collect(); assert_eq!( - digest, "6ffc80b25ec9ed3c203c35bdb8a4a05aff08d98b1a9c71648447bc199a552dc9", + digest, "8b3fb1294a5cd7296452d4a0422b0623c2d243e84bc8a51d3f15bc3899354553", "fixture bytes changed — regenerate it and update the README checksum", ); } diff --git a/tooling/ethrex-fixtures/Cargo.lock b/tooling/ethrex-fixtures/Cargo.lock index 1702880a9..03e77ca4a 100644 --- a/tooling/ethrex-fixtures/Cargo.lock +++ b/tooling/ethrex-fixtures/Cargo.lock @@ -975,18 +975,21 @@ dependencies = [ [[package]] name = "ethrex-blockchain" -version = "22.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" +version = "23.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=797df5540c7d35cafd69b6971a74b2a49c67d1dd#797df5540c7d35cafd69b6971a74b2a49c67d1dd" dependencies = [ "bytes", "crossbeam", "ethrex-common", "ethrex-crypto", + "ethrex-guest-program", "ethrex-metrics", "ethrex-rlp", "ethrex-storage", "ethrex-trie", "ethrex-vm", + "libssz", + "libssz-merkle", "rayon", "rustc-hash", "thiserror 2.0.18", @@ -997,8 +1000,8 @@ dependencies = [ [[package]] name = "ethrex-common" -version = "22.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" +version = "23.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=797df5540c7d35cafd69b6971a74b2a49c67d1dd#797df5540c7d35cafd69b6971a74b2a49c67d1dd" dependencies = [ "bytes", "crc32fast", @@ -1012,6 +1015,10 @@ dependencies = [ "indexmap 2.14.0", "lazy_static", "libc", + "libssz", + "libssz-derive", + "libssz-merkle", + "libssz-types", "lru", "once_cell", "rayon", @@ -1027,8 +1034,8 @@ dependencies = [ [[package]] name = "ethrex-crypto" -version = "22.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" +version = "23.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=797df5540c7d35cafd69b6971a74b2a49c67d1dd#797df5540c7d35cafd69b6971a74b2a49c67d1dd" dependencies = [ "ark-bn254", "ark-ec", @@ -1066,8 +1073,8 @@ dependencies = [ [[package]] name = "ethrex-guest-program" -version = "22.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" +version = "23.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=797df5540c7d35cafd69b6971a74b2a49c67d1dd#797df5540c7d35cafd69b6971a74b2a49c67d1dd" dependencies = [ "bytes", "ethereum-types", @@ -1085,8 +1092,8 @@ dependencies = [ [[package]] name = "ethrex-l2-common" -version = "22.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" +version = "23.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=797df5540c7d35cafd69b6971a74b2a49c67d1dd#797df5540c7d35cafd69b6971a74b2a49c67d1dd" dependencies = [ "bytes", "ethereum-types", @@ -1104,8 +1111,8 @@ dependencies = [ [[package]] name = "ethrex-l2-rpc" -version = "22.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" +version = "23.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=797df5540c7d35cafd69b6971a74b2a49c67d1dd#797df5540c7d35cafd69b6971a74b2a49c67d1dd" dependencies = [ "axum", "bytes", @@ -1136,14 +1143,15 @@ dependencies = [ [[package]] name = "ethrex-levm" -version = "22.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" +version = "23.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=797df5540c7d35cafd69b6971a74b2a49c67d1dd#797df5540c7d35cafd69b6971a74b2a49c67d1dd" dependencies = [ "bytes", "derive_more", "ethrex-common", "ethrex-crypto", "ethrex-rlp", + "libssz", "malachite", "rayon", "rustc-hash", @@ -1154,8 +1162,8 @@ dependencies = [ [[package]] name = "ethrex-metrics" -version = "22.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" +version = "23.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=797df5540c7d35cafd69b6971a74b2a49c67d1dd#797df5540c7d35cafd69b6971a74b2a49c67d1dd" dependencies = [ "axum", "ethrex-common", @@ -1170,8 +1178,8 @@ dependencies = [ [[package]] name = "ethrex-p2p" -version = "22.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" +version = "23.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=797df5540c7d35cafd69b6971a74b2a49c67d1dd#797df5540c7d35cafd69b6971a74b2a49c67d1dd" dependencies = [ "aes", "aes-gcm", @@ -1214,8 +1222,8 @@ dependencies = [ [[package]] name = "ethrex-rlp" -version = "22.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" +version = "23.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=797df5540c7d35cafd69b6971a74b2a49c67d1dd#797df5540c7d35cafd69b6971a74b2a49c67d1dd" dependencies = [ "bytes", "ethereum-types", @@ -1224,8 +1232,8 @@ dependencies = [ [[package]] name = "ethrex-rpc" -version = "22.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" +version = "23.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=797df5540c7d35cafd69b6971a74b2a49c67d1dd#797df5540c7d35cafd69b6971a74b2a49c67d1dd" dependencies = [ "axum", "axum-extra", @@ -1264,8 +1272,8 @@ dependencies = [ [[package]] name = "ethrex-storage" -version = "22.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" +version = "23.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=797df5540c7d35cafd69b6971a74b2a49c67d1dd#797df5540c7d35cafd69b6971a74b2a49c67d1dd" dependencies = [ "anyhow", "bytes", @@ -1286,8 +1294,8 @@ dependencies = [ [[package]] name = "ethrex-storage-rollup" -version = "22.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" +version = "23.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=797df5540c7d35cafd69b6971a74b2a49c67d1dd#797df5540c7d35cafd69b6971a74b2a49c67d1dd" dependencies = [ "async-trait", "bincode", @@ -1302,8 +1310,8 @@ dependencies = [ [[package]] name = "ethrex-trie" -version = "22.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" +version = "23.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=797df5540c7d35cafd69b6971a74b2a49c67d1dd#797df5540c7d35cafd69b6971a74b2a49c67d1dd" dependencies = [ "anyhow", "bytes", @@ -1322,8 +1330,8 @@ dependencies = [ [[package]] name = "ethrex-vm" -version = "22.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" +version = "23.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=797df5540c7d35cafd69b6971a74b2a49c67d1dd#797df5540c7d35cafd69b6971a74b2a49c67d1dd" dependencies = [ "bytes", "derive_more", @@ -2212,6 +2220,47 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" +[[package]] +name = "libssz" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d498c0482bba87d2647ea4601ea76cf2b498065e3958798a88f49274f3ced5e9" +dependencies = [ + "smallvec", +] + +[[package]] +name = "libssz-derive" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08ddfb5c969c28a4a54043e630f80c723352637bd1020f256ee3ac7a8814922b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "libssz-merkle" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63c6d6d5ce5d79bba66bc98c99869eedffedf7f14f0aa0915f1a62802650bdf6" +dependencies = [ + "libssz", + "sha2", +] + +[[package]] +name = "libssz-types" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "747273ab2d923e82ed147091fe0fb3e602dd2012c872cdad5efe69e27c3b4099" +dependencies = [ + "libssz", + "libssz-merkle", + "smallvec", +] + [[package]] name = "linux-raw-sys" version = "0.4.15" diff --git a/tooling/ethrex-fixtures/Cargo.toml b/tooling/ethrex-fixtures/Cargo.toml index 3320ba25b..daeda8b15 100644 --- a/tooling/ethrex-fixtures/Cargo.toml +++ b/tooling/ethrex-fixtures/Cargo.toml @@ -9,11 +9,11 @@ edition = "2024" [dependencies] # Pinned to the SAME ethrex rev as the guest (open LambdaVM-backend PR branch) # so the generated ProgramInput rkyv layout matches what the guest deserializes. -ethrex-blockchain = { git = "https://github.com/lambdaclass/ethrex.git", rev = "4f658c2b3d10e3f21d35ce546870f55ca3f940fc", package = "ethrex-blockchain" } -ethrex-storage = { git = "https://github.com/lambdaclass/ethrex.git", rev = "4f658c2b3d10e3f21d35ce546870f55ca3f940fc", package = "ethrex-storage" } -ethrex-common = { git = "https://github.com/lambdaclass/ethrex.git", rev = "4f658c2b3d10e3f21d35ce546870f55ca3f940fc", package = "ethrex-common" } -ethrex-guest-program = { git = "https://github.com/lambdaclass/ethrex.git", rev = "4f658c2b3d10e3f21d35ce546870f55ca3f940fc", package = "ethrex-guest-program" } -ethrex-l2-rpc = { git = "https://github.com/lambdaclass/ethrex.git", rev = "4f658c2b3d10e3f21d35ce546870f55ca3f940fc", package = "ethrex-l2-rpc" } +ethrex-blockchain = { git = "https://github.com/lambdaclass/ethrex.git", rev = "797df5540c7d35cafd69b6971a74b2a49c67d1dd", package = "ethrex-blockchain" } +ethrex-storage = { git = "https://github.com/lambdaclass/ethrex.git", rev = "797df5540c7d35cafd69b6971a74b2a49c67d1dd", package = "ethrex-storage" } +ethrex-common = { git = "https://github.com/lambdaclass/ethrex.git", rev = "797df5540c7d35cafd69b6971a74b2a49c67d1dd", package = "ethrex-common" } +ethrex-guest-program = { git = "https://github.com/lambdaclass/ethrex.git", rev = "797df5540c7d35cafd69b6971a74b2a49c67d1dd", package = "ethrex-guest-program" } +ethrex-l2-rpc = { git = "https://github.com/lambdaclass/ethrex.git", rev = "797df5540c7d35cafd69b6971a74b2a49c67d1dd", package = "ethrex-l2-rpc" } tokio = { version = "1", features = ["rt-multi-thread", "macros"] } # Exact pin: the fixture writer and the guest/executor readers must agree on the diff --git a/tooling/ethrex-tests/Cargo.lock b/tooling/ethrex-tests/Cargo.lock index 84712135c..0a86228f1 100644 --- a/tooling/ethrex-tests/Cargo.lock +++ b/tooling/ethrex-tests/Cargo.lock @@ -693,8 +693,8 @@ dependencies = [ [[package]] name = "ethrex-common" -version = "22.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" +version = "23.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=797df5540c7d35cafd69b6971a74b2a49c67d1dd#797df5540c7d35cafd69b6971a74b2a49c67d1dd" dependencies = [ "bytes", "crc32fast", @@ -708,6 +708,10 @@ dependencies = [ "indexmap 2.14.0", "lazy_static", "libc", + "libssz", + "libssz-derive", + "libssz-merkle", + "libssz-types", "lru", "once_cell", "rayon", @@ -723,8 +727,8 @@ dependencies = [ [[package]] name = "ethrex-crypto" -version = "22.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" +version = "23.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=797df5540c7d35cafd69b6971a74b2a49c67d1dd#797df5540c7d35cafd69b6971a74b2a49c67d1dd" dependencies = [ "ark-bn254", "ark-ec", @@ -744,8 +748,8 @@ dependencies = [ [[package]] name = "ethrex-guest-program" -version = "22.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" +version = "23.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=797df5540c7d35cafd69b6971a74b2a49c67d1dd#797df5540c7d35cafd69b6971a74b2a49c67d1dd" dependencies = [ "bytes", "ethereum-types", @@ -763,8 +767,8 @@ dependencies = [ [[package]] name = "ethrex-l2-common" -version = "22.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" +version = "23.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=797df5540c7d35cafd69b6971a74b2a49c67d1dd#797df5540c7d35cafd69b6971a74b2a49c67d1dd" dependencies = [ "bytes", "ethereum-types", @@ -782,14 +786,15 @@ dependencies = [ [[package]] name = "ethrex-levm" -version = "22.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" +version = "23.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=797df5540c7d35cafd69b6971a74b2a49c67d1dd#797df5540c7d35cafd69b6971a74b2a49c67d1dd" dependencies = [ "bytes", "derive_more", "ethrex-common", "ethrex-crypto", "ethrex-rlp", + "libssz", "malachite", "rayon", "rustc-hash", @@ -800,8 +805,8 @@ dependencies = [ [[package]] name = "ethrex-rlp" -version = "22.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" +version = "23.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=797df5540c7d35cafd69b6971a74b2a49c67d1dd#797df5540c7d35cafd69b6971a74b2a49c67d1dd" dependencies = [ "bytes", "ethereum-types", @@ -819,8 +824,8 @@ dependencies = [ [[package]] name = "ethrex-trie" -version = "22.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" +version = "23.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=797df5540c7d35cafd69b6971a74b2a49c67d1dd#797df5540c7d35cafd69b6971a74b2a49c67d1dd" dependencies = [ "anyhow", "bytes", @@ -839,8 +844,8 @@ dependencies = [ [[package]] name = "ethrex-vm" -version = "22.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" +version = "23.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=797df5540c7d35cafd69b6971a74b2a49c67d1dd#797df5540c7d35cafd69b6971a74b2a49c67d1dd" dependencies = [ "bytes", "derive_more", @@ -1275,6 +1280,47 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" +[[package]] +name = "libssz" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d498c0482bba87d2647ea4601ea76cf2b498065e3958798a88f49274f3ced5e9" +dependencies = [ + "smallvec", +] + +[[package]] +name = "libssz-derive" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08ddfb5c969c28a4a54043e630f80c723352637bd1020f256ee3ac7a8814922b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "libssz-merkle" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63c6d6d5ce5d79bba66bc98c99869eedffedf7f14f0aa0915f1a62802650bdf6" +dependencies = [ + "libssz", + "sha2", +] + +[[package]] +name = "libssz-types" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "747273ab2d923e82ed147091fe0fb3e602dd2012c872cdad5efe69e27c3b4099" +dependencies = [ + "libssz", + "libssz-merkle", + "smallvec", +] + [[package]] name = "log" version = "0.4.33" @@ -1928,6 +1974,12 @@ version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" +[[package]] +name = "smallvec" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ed6a63f02c8539c91a8685a86f4099661ba3da017932f6ebbea6de3f0fa7c90" + [[package]] name = "spin" version = "0.9.9" diff --git a/tooling/ethrex-tests/Cargo.toml b/tooling/ethrex-tests/Cargo.toml index 5ff8ef39f..3c89ea8f7 100644 --- a/tooling/ethrex-tests/Cargo.toml +++ b/tooling/ethrex-tests/Cargo.toml @@ -12,7 +12,7 @@ edition = "2024" executor = { path = "../../executor" } # Pinned to the SAME ethrex rev as the guest (open LambdaVM-backend PR branch) # so the native reference reads the same ProgramInput rkyv layout. -ethrex-guest-program = { git = "https://github.com/lambdaclass/ethrex.git", rev = "4f658c2b3d10e3f21d35ce546870f55ca3f940fc", package = "ethrex-guest-program" } +ethrex-guest-program = { git = "https://github.com/lambdaclass/ethrex.git", rev = "797df5540c7d35cafd69b6971a74b2a49c67d1dd", package = "ethrex-guest-program" } # Exact pin: the fixture writer and the guest/executor readers must agree on the # rkyv layout. Keep this in sync with tooling/ethrex-fixtures and # executor/programs/rust/ethrex/Cargo.toml. From fdbd91c61ed159092d5c09c1ece9ecad2f3989b6 Mon Sep 17 00:00:00 2001 From: jotabulacios Date: Wed, 26 Aug 2026 17:25:49 -0300 Subject: [PATCH 06/12] rm file --- BUMP_797df554_RESULTS.md | 130 --------------------------------------- 1 file changed, 130 deletions(-) delete mode 100644 BUMP_797df554_RESULTS.md diff --git a/BUMP_797df554_RESULTS.md b/BUMP_797df554_RESULTS.md deleted file mode 100644 index 21a6b1525..000000000 --- a/BUMP_797df554_RESULTS.md +++ /dev/null @@ -1,130 +0,0 @@ -# Bumping the ethrex pin to `797df554` - -Moves the guest from `4f658c2b` (2026-07-31, on the unmerged -`feat/lambdavm-prover-backend` branch) to `797df554` (2026-08-07, on ethrex -`main`). - -## Results - -Real mainnet block 25368371 — the fixture `bench_abba.sh`, `bench_verify.sh`, -`perf_diff.sh` and `benchmark-pr.yml` all resolve through -`make print-real-block-fixture`. - -| | before (`4f658c2b`) | after (`797df554`) | delta | -|---|---|---|---| -| **Proving time** (median of 3) | **120.715 s** | **110.259 s** | **−8.66%** | -| run spread | 0.681 s (0.56%) | 0.821 s (0.74%) | | -| Executed cycles | 34,241,608 | 30,498,818 | −10.93% | -| **Epochs** (2^22) | **9** | **8** | −1 | -| Peak heap | 47.3 GB | 46.2 GB | −2.4% | - -10.46 s off every proof, against a run spread below 0.8% on both sides — the -delta is roughly twelve times the noise. - -Against `main`'s pin (`156cb8d6`, 2026-05-22) the guest goes from **39,563,400** -to **30,498,818** cycles, **−22.9%**. - -### Time does not track cycles - -−10.93% of cycles buys −8.66% of proving time, and that gap is structural rather -than measurement error: proving cost also carries per-epoch fixed work and table -rows that do not shrink with the instruction count. Quoting a cycle delta as if it -were a time delta will overpromise. - -The epoch count is the clearest instance. At 2^22 cycles per epoch, 34.2M needed 9 -and 30.5M fits in 8, and that single step accounts for much of the 10 s. It also -means the next increment of cycle savings returns less until it drops the ninth -epoch — the benefit arrives in steps, not smoothly. - -## What changed - -**The pin**, in all 11 places (`scripts/set_ethrex_rev.sh` moves them together, so -the guest and the fixture tooling cannot drift apart — a mismatch there does not -fail to build, it produces a fixture the guest silently misreads). - -**The `lambdavm` feature is gone**, and not replaced. `ethrex-guest-program` -carries one feature per zkVM and none of them selects a backend: each is only a -list of optional crypto dependencies, and none gates any method of the `Crypto` -trait (its gates are `secp256k1`, `c-kzg`, `blst`, `std`). Measured against the -sibling feature that activates the widest dependency set, ethrex's own precompile -stress fixtures come out identical to the cycle — `stress_modexp_150M` -6,373,285,966 and `stress_alt_bn128_150M` 22,986,061,145 both ways — with the real -block at 30,498,818 vs 30,501,620 and a 2,928-byte smaller ELF. - -Requiring `lambdavm` is what tied the guest to the backend branch, since that is -the only place it exists. What makes this guest LambdaVM never travelled through -it: `lambda-vm-syscalls`, `lambda-vm-ethrex-crypto` and the -`riscv64im-lambda-vm-elf` target are direct, and every run above reports 116 ECSM -and 10,659 keccak precompile calls — the injected crypto is live on both sides. - -**Fixtures regenerated.** The rkyv `ProgramInput` layout moved with the rev, so -every committed `.bin` from the old pin fails to deserialize. All four synthetic -fixtures plus the real block were rebuilt; the converter's reproducibility digest -was updated, which is what that test asks for on a legitimate rev bump. - -| fixture | cycles | ECSM | -|---|---|---| -| `ethrex_empty_block` | 431,162 | 0 | -| `ethrex_simple_tx` | 653,263 | 4 | -| `ethrex_bench_4` | 1,047,001 | 16 | -| `ethrex_10_transfers` | 1,286,761 | 40 | -| real block 25368371 | 30,498,818 | 116 | - -## Why `797df554` and not something newer - -`b5271885` (2026-08-14) rewrites the guest entry point from `ProgramInput` / -`execution_program` to `run_stateless_guest` taking schema-prefixed SSZ -`statelessInputBytes`. Past that commit this is no longer a pin bump — it needs a -new guest shim and a new fixture format. `797df554` is the last point where the -bump is only the rev. - -Within that window it is also the right end of it: between 2026-08-07 and the -boundary there are 14 commits and **no `perf(levm)`**. The two that matter — -`perf(levm): monomorphize the dispatch loop on the validation observer` (#7105) -and `perf(l1): give branch-node hashing a monomorphic RLP encoder` (#7104) — are -already in. - -Release tags do not help here. `v24.0.0`'s commit predates both, and it is -*diverged* from `main` (4 commits of its own, 66 behind) because ethrex cuts -releases from a side branch rather than from the tip — so a tag can lack work that -is already merged. `v25.0.0` is past the API boundary. - -## Method - -`vm-benchmarks-1`, 96 cores / 125 GB, rustc 1.94.0. The real-block step of -`.github/workflows/benchmark-pr.yml` verbatim: - -``` -cli prove $ELF --private-input $REAL_INPUT \ - --continuations --epoch-size-log2 22 -o /tmp/real_proof.bin --time -``` - -3 runs per side, reported as median plus spread. - -Both sides started on an idle box (load 0.61 and 1.99). The baseline was held back -until load fell below 3 after the first side finished — starting it hot would have -inflated the baseline and flattered the bump. - -Each side used **its own canonical fixture**: the baseline fetched the published -`_4f658c2b` release asset, the bumped side used the newly generated `_797df554` -one. They cannot share a file — the rkyv layout differs — and each side's own -asset is what CI would fetch, which is the honest comparison rather than two -ad-hoc conversions. - -Cycle counts are deterministic: the bumped side reported 30,498,818 identically on -a laptop and on the bench box. - -Raw logs in `bench_ethrex_bump_20260826/`. - -## Before merging - -`ethrex_mainnet_25368371_797df554.bin` (in the repo root) must be uploaded to the -`bench-fixtures-v1` release of **yetanotherco/lambda_vm**. The Makefile already -points at it with its sha256; until the asset exists, `make -ethrex-real-block-fixture` works locally (the file is in place and verifies) but -CI cannot fetch it. - -This also stops being a routine bump: it leaves `feat/lambdavm-prover-backend` and -consumes ethrex `main` as a library. That branch is 69 commits behind `main` and -has not moved since 2026-08-04, so waiting for it to merge was itself costing the -−22.9% above. The PR's existing approval predates this change. From d2424cc6b2db8be436449148ac35067c5f6def91 Mon Sep 17 00:00:00 2001 From: jotabulacios Date: Wed, 9 Sep 2026 12:21:51 -0300 Subject: [PATCH 07/12] Regenerate the ethrex-crypto lock, add --locked --- Makefile | 12 ++++++++---- crypto/ethrex-crypto/Cargo.lock | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 1f178b3c1..cf794e081 100644 --- a/Makefile +++ b/Makefile @@ -437,7 +437,7 @@ ethrex-real-block-converter-cache: $(ETHREX_CONVERTER_CACHE) # network-rejection guard, and the reproducibility digest. Runs on changes to the # converter (see .github/workflows/ethrex-block-converter.yml), not on every PR. test-ethrex-real-block-converter: $(ETHREX_CONVERTER_CACHE) - cd tooling/ethrex-block-converter && cargo test --release + cd tooling/ethrex-block-converter && cargo test --locked --release # Manual regeneration of the BENCHMARK fixture (not the converter's test block): # fetches that block's own cache and re-converts it, overwriting the fixture in @@ -463,7 +463,7 @@ test-ethrex: compile-programs-rust ethrex-real-block-fixture # otherwise fail on a clean checkout. The committed synthetic fixtures and # `no_kzg_backend_linked` still run. test-ethrex-offline: compile-programs-rust - cd tooling/ethrex-tests && cargo test --release -- --include-ignored --skip test_ethrex_real_block + cd tooling/ethrex-tests && cargo test --locked --release -- --include-ignored --skip test_ethrex_real_block test-flamegraph: cargo test -p executor --test flamegraph @@ -535,9 +535,13 @@ test-syscalls: # exercises the implementation that actually ships; the debug run is kept because # its magnitude debug_asserts turn a contract violation into a loud panic instead # of a silently wrong value. +# `--locked` because this is the only target that builds that workspace: without it +# cargo re-resolves and REWRITES the committed lock on a manifest/lock mismatch, so +# the job passes while the lock describes a different build than the one that ran. +# That is how the ethrex rev bump left this lock a rev behind the manifest. test-ethrex-crypto: - cd crypto/ethrex-crypto && cargo test - cd crypto/ethrex-crypto && cargo test --release + cd crypto/ethrex-crypto && cargo test --locked + cd crypto/ethrex-crypto && cargo test --locked --release test: compile-programs test-syscalls test-ethrex-crypto cargo test diff --git a/crypto/ethrex-crypto/Cargo.lock b/crypto/ethrex-crypto/Cargo.lock index 0cdd80692..47fe0bbbd 100644 --- a/crypto/ethrex-crypto/Cargo.lock +++ b/crypto/ethrex-crypto/Cargo.lock @@ -342,8 +342,8 @@ dependencies = [ [[package]] name = "ethrex-crypto" -version = "22.0.0" -source = "git+https://github.com/lambdaclass/ethrex.git?rev=4f658c2b3d10e3f21d35ce546870f55ca3f940fc#4f658c2b3d10e3f21d35ce546870f55ca3f940fc" +version = "23.0.0" +source = "git+https://github.com/lambdaclass/ethrex.git?rev=797df5540c7d35cafd69b6971a74b2a49c67d1dd#797df5540c7d35cafd69b6971a74b2a49c67d1dd" dependencies = [ "ark-bn254", "ark-ec", From fd164cc5b19f179942c011b6b1fa302623ab1b29 Mon Sep 17 00:00:00 2001 From: jotabulacios Date: Wed, 9 Sep 2026 12:21:51 -0300 Subject: [PATCH 08/12] Gate the ethrex rev and locks in CI --- .github/workflows/pr_main.yaml | 9 ++++++++- scripts/set_ethrex_rev.sh | 32 ++++++++++++++++++++++++++------ 2 files changed, 34 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pr_main.yaml b/.github/workflows/pr_main.yaml index 767e166de..89bff2b03 100644 --- a/.github/workflows/pr_main.yaml +++ b/.github/workflows/pr_main.yaml @@ -40,6 +40,13 @@ jobs: - name: Check ethrex fixture checksums run: make check-ethrex-fixture-checksums + # Five manifests carry the ethrex rev and they must agree: a skew is not a build + # failure, it is a fixture the guest decodes as the all-zero default. `--show` + # exits non-zero on MIXED. It reads manifests only; the matching locks are held by + # `--locked` on each workspace's own test/build step. + - name: Check the ethrex rev is consistent across manifests + run: scripts/set_ethrex_rev.sh --show + # The benchmark comment harness: verifies every steps.X.outputs.Y consumed in # benchmark-pr.yml has a producer (the orphaned-wiring class that once broke # /bench-growth silently), then renders the full comment scenario suite. @@ -153,7 +160,7 @@ jobs: - name: Run ethrex host-reference tests (detached workspace) run: | cd tooling/ethrex-tests && \ - cargo test --release -- --include-ignored --skip test_ethrex_real_block + cargo test --locked --release -- --include-ignored --skip test_ethrex_real_block test-cli: name: CLI tests diff --git a/scripts/set_ethrex_rev.sh b/scripts/set_ethrex_rev.sh index 0ae03673d..5964420e7 100755 --- a/scripts/set_ethrex_rev.sh +++ b/scripts/set_ethrex_rev.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Re-pin every ethrex git dependency in this repo to one rev, atomically. # -# The guest and the host-side tooling exchange ethrex types (the SSZ stateless +# The guest and the host-side tooling exchange ethrex types (the rkyv stateless # input the converter writes and the guest decodes), so a rev that differs # between them is not a version skew that fails to build -- it is a fixture the # guest silently decodes as the all-zero default. Keeping every pin on one rev @@ -54,8 +54,9 @@ if [[ "${1:-}" == "--show" || $# -eq 0 ]]; then if [[ "$(printf '%s\n' "$revs" | wc -l | tr -d ' ')" == "1" ]]; then echo "$revs" else - # Expected mid-benchmark (a `--guest-only` re-pin is exactly this state), so - # report it rather than failing. + # Non-zero on purpose: this is the skew the script exists to prevent, and it is + # what makes `--show` usable as a CI gate. A `--guest-only` re-pin is legitimately + # this state, so a caller doing that should ignore the status. echo "MIXED:" >&2 printf ' %s\n' $revs >&2 exit 1 @@ -63,6 +64,7 @@ if [[ "${1:-}" == "--show" || $# -eq 0 ]]; then exit 0 fi +COUNTS=() TARGETS=("${MANIFESTS[@]}") SCOPE="all manifests" if [[ "${1:-}" == "--guest-only" ]]; then @@ -77,11 +79,29 @@ if [[ ! "$NEW_REV" =~ ^[0-9a-f]{40}$ ]]; then exit 2 fi +# Only rewrite revs on ethrex deps: the same file may pin other git deps. +PATTERN='(github\.com/lambdaclass/ethrex\.git", rev = ")[0-9a-f]{40}(")' + +# Two passes so a partial rewrite is impossible. Pass 1 only counts: the pattern needs +# the git URL and `rev` on ONE physical line, so a manifest in `[dependencies.x]` table +# form matches nothing, and rewriting the others anyway would leave exactly the skew this +# script exists to prevent -- while reporting success. for manifest in "${TARGETS[@]}"; do [[ -f "$manifest" ]] || { echo "error: missing $manifest" >&2; exit 1; } - # Only rewrite revs on ethrex deps: the same file may pin other git deps. - perl -pi -e 's{(github\.com/lambdaclass/ethrex\.git", rev = ")[0-9a-f]{40}(")}{${1}'"$NEW_REV"'${2}}g' "$manifest" + n="$(perl -ne "\$c++ while m{$PATTERN}g; END { print \$c + 0 }" "$manifest")" + if [[ "$n" == "0" ]]; then + echo "error: $manifest carries no ethrex rev this script can rewrite." >&2 + echo " The pattern needs the git URL and \`rev\` on one line; a \`[dependencies.x]\`" >&2 + echo " table form does not match. Nothing was written." >&2 + exit 1 + fi + COUNTS+=("$manifest ($n)") +done + +# Pass 2 rewrites, now that every target is known to match. +for manifest in "${TARGETS[@]}"; do + perl -pi -e "s{$PATTERN}{\${1}$NEW_REV\${2}}g" "$manifest" done echo "re-pinned $SCOPE to $NEW_REV:" -printf ' %s\n' "${TARGETS[@]}" +printf ' %s\n' "${COUNTS[@]}" From 908868fafb9f1f2ea97ae72d18356a597d1506ed Mon Sep 17 00:00:00 2001 From: jotabulacios Date: Wed, 9 Sep 2026 12:21:52 -0300 Subject: [PATCH 09/12] Drop the dead lambda_vm patch sections --- crypto/ethrex-crypto/Cargo.toml | 4 +-- executor/programs/rust/ethrex/Cargo.toml | 37 +++++++---------------- tooling/ethrex-block-converter/Cargo.toml | 25 ++++++--------- tooling/ethrex-fixtures/Cargo.toml | 5 +-- tooling/ethrex-tests/Cargo.toml | 5 +-- 5 files changed, 29 insertions(+), 47 deletions(-) diff --git a/crypto/ethrex-crypto/Cargo.toml b/crypto/ethrex-crypto/Cargo.toml index 09d53ac3b..54a7dfc53 100644 --- a/crypto/ethrex-crypto/Cargo.toml +++ b/crypto/ethrex-crypto/Cargo.toml @@ -16,8 +16,8 @@ license = "MIT OR Apache-2.0" [dependencies] # Defines the `Crypto` trait, `CryptoError`, and `keccak::keccak_hash`. Same rev -# + `default-features = false` as the guest's ethrex-crypto, so feature -# unification adds nothing to the guest build (no C secp256k1 / malachite / kzg). +# + `default-features = false` as the guest's ethrex-crypto, so this line adds +# nothing to the guest build. Note `std` is on anyway, via ethrex-trie's default. ethrex-crypto = { git = "https://github.com/lambdaclass/ethrex.git", rev = "797df5540c7d35cafd69b6971a74b2a49c67d1dd", package = "ethrex-crypto", default-features = false } # Pinned to the exact 0.13.4 ethrex uses so the guest resolves a single k256 # (a version split would make `FieldElement`/`Scalar` incompatible types). diff --git a/executor/programs/rust/ethrex/Cargo.toml b/executor/programs/rust/ethrex/Cargo.toml index 1d2ef0f4a..b93265450 100644 --- a/executor/programs/rust/ethrex/Cargo.toml +++ b/executor/programs/rust/ethrex/Cargo.toml @@ -33,37 +33,22 @@ lambda-vm-ethrex-crypto = { path = "../../../../crypto/ethrex-crypto" } # `["dep:k256", "dep:lambda-vm-syscalls", "ethrex-l2-common/secp256k1"]`, and # since #702 moved the `Crypto` impl into this repo the syscalls it pulled are for # ethrex's own provider, which we no longer use — while this guest already depends -# on `lambda-vm-syscalls` by path, three lines above. +# on `lambda-vm-syscalls` by path, above. # # What makes this guest LambdaVM is those path deps plus the -# `riscv64im-lambda-vm-elf` target. None of it travels through a feature: every -# run reports its ECSM and keccak precompile calls, which is what actually proves -# the injected crypto is live. +# `riscv64im-lambda-vm-elf` target, and `lambdavm` existed ONLY on the unmerged +# branch, so requiring it is what tied this guest to it. Re-pin with +# scripts/set_ethrex_rev.sh. # -# Verified rather than assumed. Against the sibling feature activating the widest -# dependency set, ethrex's own precompile stress fixtures come out identical to -# the cycle — `stress_modexp_150M` 6,373,285,966 and `stress_alt_bn128_150M` -# 22,986,061,145 both ways — and the real benchmark block is 30,498,818 here vs -# 30,501,620 there, with a 2,928-byte smaller ELF. The difference is dead -# `substrate-bn`/`bls12_381` that the arkworks-based trait defaults never call. +# Measured, not assumed: against the sibling feature activating the widest dependency +# set, `stress_modexp_150M` (6,373,285,966) and `stress_alt_bn128_150M` +# (22,986,061,145) are identical to the cycle, and the real benchmark block is +# 30,498,818 here vs 30,501,620 there, with a 2,928-byte smaller ELF. What the drop +# actually removes is C libsecp256k1 (`secp256k1`, `secp256k1-sys`, `bitcoin_hashes`, +# `bitcoin-io`, `hex-conservative` leave the lock); we inject our own ecrecover. # -# Declaring nothing is also what frees the pin: `lambdavm` exists ONLY on that -# unmerged branch, so requiring it is precisely what tied this guest to it. See -# scripts/bench_ethrex_pr.sh, which re-pins across arbitrary revs to measure -# upstream guest PRs. -# -# KZG is not linked, so the point-evaluation precompile (0x0a) is unsupported — -# see src/main.rs. +# 0x0a and 0x0b-0x11 are unsupported — see src/main.rs. ethrex-guest-program = { git = "https://github.com/lambdaclass/ethrex.git", rev = "797df5540c7d35cafd69b6971a74b2a49c67d1dd", package = "ethrex-guest-program", default-features = false } # Exact pin: must match the fixture writer (tooling/ethrex-fixtures) and the # executor test reader so the rkyv ProgramInput layout stays consistent. rkyv = { version = "=0.8.16", features = ["std", "unaligned"] } - -# `lambda-vm-syscalls` can still reach the graph as a git dep pinned to a commit -# of THIS repo, which upstream bumps on its own schedule. Override it -# with the working-tree copy so the guest always links the same syscalls as the rest -# of the repo — including uncommitted local edits — rather than whatever commit -# ethrex last pinned. (At the current ethrex rev the two happen to coincide; this -# override is what keeps that coincidence from being load-bearing.) -[patch."https://github.com/yetanotherco/lambda_vm.git"] -lambda-vm-syscalls = { path = "../../../../syscalls" } diff --git a/tooling/ethrex-block-converter/Cargo.toml b/tooling/ethrex-block-converter/Cargo.toml index 28f8d7e1d..ba7a458b2 100644 --- a/tooling/ethrex-block-converter/Cargo.toml +++ b/tooling/ethrex-block-converter/Cargo.toml @@ -7,14 +7,15 @@ edition = "2024" [workspace] [dependencies] -# Pinned to the SAME ethrex rev as the guest (open LambdaVM-backend PR branch) -# so the generated ProgramInput rkyv layout matches what the guest deserializes. +# Pinned to the SAME ethrex rev as the guest so the generated ProgramInput rkyv +# layout matches what the guest deserializes. Re-pin all five manifests together +# with scripts/set_ethrex_rev.sh. ethrex-common = { git = "https://github.com/lambdaclass/ethrex.git", rev = "797df5540c7d35cafd69b6971a74b2a49c67d1dd", package = "ethrex-common", default-features = false } ethrex-config = { git = "https://github.com/lambdaclass/ethrex.git", rev = "797df5540c7d35cafd69b6971a74b2a49c67d1dd", package = "ethrex-config", default-features = false } # Only for `NativeCrypto`, the host `Crypto` impl that `into_execution_witness` -# now takes. Nothing re-exports it, and this crate's own guest-crypto impl is a -# dev-dependency, so the bin build needs its own line. Already in the graph via -# `ethrex-config` → `ethrex-p2p`, so this adds no compilation. +# now takes. `ethrex_guest_program::crypto` re-exports it, but this crate's own +# guest-crypto impl is a dev-dependency, so the bin build needs its own line. +# Already in the graph via `ethrex-config` → `ethrex-p2p`, so this adds no compilation. ethrex-crypto = { git = "https://github.com/lambdaclass/ethrex.git", rev = "797df5540c7d35cafd69b6971a74b2a49c67d1dd", package = "ethrex-crypto", default-features = false } # Matches the guest's own declaration (executor/programs/rust/ethrex/Cargo.toml). # @@ -22,10 +23,10 @@ ethrex-crypto = { git = "https://github.com/lambdaclass/ethrex.git", rev = "797d # `ethrex-config` dep above pulls `ethrex-p2p`, whose `default = ["c-kzg"]` # propagates to `ethrex-crypto/c-kzg` — and `default-features = false` cannot # switch it off, because ethrex's own workspace declares `ethrex-p2p` with its -# defaults on. So this graph links a working c-kzg (and malachite modexp, and -# `ark-ff/asm` BN254) that the guest does not have; verify with -# `cargo tree -e features -i ethrex-crypto`. Closing that gap means dropping -# `ethrex-config` and sourcing `ChainConfig` another way — see the README. +# defaults on. So this graph links a working c-kzg that the guest does not have; +# verify with `cargo tree -e features -i ethrex-crypto`. c-kzg is the whole gap now — +# malachite modexp and `ark-ff/asm` are on both sides since ethrex-trie's `std` default. +# Closing it means dropping `ethrex-config` and sourcing `ChainConfig` another way. ethrex-guest-program = { git = "https://github.com/lambdaclass/ethrex.git", rev = "797df5540c7d35cafd69b6971a74b2a49c67d1dd", package = "ethrex-guest-program", default-features = false } # Exact pin: the fixture writer and the guest/executor readers must agree on the @@ -59,9 +60,3 @@ lambda-vm-ethrex-crypto = { path = "../../crypto/ethrex-crypto" } # No feature delta against the rest of the graph (sha2/std is already on), so this # one can stay a dev-dependency without forcing the rebuild described above. sha2 = "0.10" - -# `ethrex-guest-program`'s `lambdavm` feature git-deps `lambda-vm-syscalls` at a -# pinned commit of this repo; override it with the working-tree copy, as the guest -# does, so both resolve the same syscalls. -[patch."https://github.com/yetanotherco/lambda_vm.git"] -lambda-vm-syscalls = { path = "../../syscalls" } diff --git a/tooling/ethrex-fixtures/Cargo.toml b/tooling/ethrex-fixtures/Cargo.toml index daeda8b15..fbbde505d 100644 --- a/tooling/ethrex-fixtures/Cargo.toml +++ b/tooling/ethrex-fixtures/Cargo.toml @@ -7,8 +7,9 @@ edition = "2024" [workspace] [dependencies] -# Pinned to the SAME ethrex rev as the guest (open LambdaVM-backend PR branch) -# so the generated ProgramInput rkyv layout matches what the guest deserializes. +# Pinned to the SAME ethrex rev as the guest so the generated ProgramInput rkyv +# layout matches what the guest deserializes. Re-pin all five manifests together +# with scripts/set_ethrex_rev.sh. ethrex-blockchain = { git = "https://github.com/lambdaclass/ethrex.git", rev = "797df5540c7d35cafd69b6971a74b2a49c67d1dd", package = "ethrex-blockchain" } ethrex-storage = { git = "https://github.com/lambdaclass/ethrex.git", rev = "797df5540c7d35cafd69b6971a74b2a49c67d1dd", package = "ethrex-storage" } ethrex-common = { git = "https://github.com/lambdaclass/ethrex.git", rev = "797df5540c7d35cafd69b6971a74b2a49c67d1dd", package = "ethrex-common" } diff --git a/tooling/ethrex-tests/Cargo.toml b/tooling/ethrex-tests/Cargo.toml index 3c89ea8f7..f7daff1d4 100644 --- a/tooling/ethrex-tests/Cargo.toml +++ b/tooling/ethrex-tests/Cargo.toml @@ -10,8 +10,9 @@ edition = "2024" [dev-dependencies] executor = { path = "../../executor" } -# Pinned to the SAME ethrex rev as the guest (open LambdaVM-backend PR branch) -# so the native reference reads the same ProgramInput rkyv layout. +# Pinned to the SAME ethrex rev as the guest so the native reference reads the same +# ProgramInput rkyv layout. Re-pin all five manifests together with +# scripts/set_ethrex_rev.sh. ethrex-guest-program = { git = "https://github.com/lambdaclass/ethrex.git", rev = "797df5540c7d35cafd69b6971a74b2a49c67d1dd", package = "ethrex-guest-program" } # Exact pin: the fixture writer and the guest/executor readers must agree on the # rkyv layout. Keep this in sync with tooling/ethrex-fixtures and From c141ac57f838ee0333a16ffd052d46937dd8d452 Mon Sep 17 00:00:00 2001 From: jotabulacios Date: Wed, 9 Sep 2026 12:21:52 -0300 Subject: [PATCH 10/12] Pin the missing BLS12-381 backend with a test --- crypto/ethrex-crypto/src/lib.rs | 5 ++++- executor/programs/rust/ethrex/src/main.rs | 5 ++--- tooling/ethrex-block-converter/src/main.rs | 10 +++++----- tooling/ethrex-tests/tests/ethrex.rs | 19 +++++++++++++++++++ 4 files changed, 30 insertions(+), 9 deletions(-) diff --git a/crypto/ethrex-crypto/src/lib.rs b/crypto/ethrex-crypto/src/lib.rs index ec36b0831..d3724f92c 100644 --- a/crypto/ethrex-crypto/src/lib.rs +++ b/crypto/ethrex-crypto/src/lib.rs @@ -14,7 +14,10 @@ //! back to the pure-Rust `ProjectivePoint::lincomb`. //! //! Every other `Crypto` method inherits the trait default (vetted pure-Rust -//! crates: `ark-bn254`, `bls12_381`, `p256`, `sha2`, `ripemd`, …). +//! crates: `ark-bn254`, `p256`, `sha2`, `ripemd`, …), except two families that +//! error because no backend is linked: KZG `0x0a` (reverts) and BLS12-381 +//! `0x0b`-`0x11` (aborts). Pinned by `no_{kzg,bls}_backend_linked` in +//! `tooling/ethrex-tests`. use ethrex_crypto::keccak::keccak_hash; use ethrex_crypto::{Crypto, CryptoError}; diff --git a/executor/programs/rust/ethrex/src/main.rs b/executor/programs/rust/ethrex/src/main.rs index 8154978cf..eae31effd 100644 --- a/executor/programs/rust/ethrex/src/main.rs +++ b/executor/programs/rust/ethrex/src/main.rs @@ -17,9 +17,8 @@ pub fn main() { // It accelerates trait-routed `keccak256` (via the keccak_permute precompile) // and `secp256k1_ecrecover` (via the ECSM precompile); everything else uses // ethrex's pure-Rust trait defaults. ethrex's trie/RLP keccak that goes - // through the free `keccak_hash` fn is still software, and KZG (0x0a) is - // unsupported under the `lambdavm` feature (blob txs execute; a point-eval - // precompile call reverts). + // through the free `keccak_hash` fn is still software. Unsupported, no backend + // linked: KZG 0x0a (reverts) and BLS12-381 0x0b-0x11 (aborts on the unwrap below). let crypto = Arc::new(LambdaVmEcsmCrypto); let output = execution_program(input, crypto).unwrap(); lambda_vm_syscalls::syscalls::commit(&output.encode()); diff --git a/tooling/ethrex-block-converter/src/main.rs b/tooling/ethrex-block-converter/src/main.rs index 87bdfe51d..98df955d6 100644 --- a/tooling/ethrex-block-converter/src/main.rs +++ b/tooling/ethrex-block-converter/src/main.rs @@ -75,11 +75,11 @@ fn program_input_from_cache( // `into_execution_witness` rebuilds the trie structures from the flat node // list and needs the parent header, which the cache carries inside `witness`. - // Those headers are now decoded by the caller rather than inside the call, and - // the `Crypto` argument is what recomputes the block hashes the parent lookup - // matches on. `NativeCrypto` is keccak-only here, so it produces the same bytes - // as the `LambdaVmEcsmCrypto` the guest injects (whose host path is also - // software keccak) — the fixture does not depend on which one converts it. + // Those headers are now decoded by the caller rather than inside the call, and the + // parent lookup matches on `h.number` without touching `crypto` at all. The `Crypto` + // argument is used only for keccak over the trie-node preimages, so `NativeCrypto` + // produces the same bytes as the `LambdaVmEcsmCrypto` the guest injects (whose host + // path is also software keccak) — the fixture does not depend on which one converts it. let chain_config = cache.network.get_genesis()?.config; let decoded_headers = decode_witness_headers(&cache.witness.headers)?; let witness = cache.witness.into_execution_witness( diff --git a/tooling/ethrex-tests/tests/ethrex.rs b/tooling/ethrex-tests/tests/ethrex.rs index 9ad1ee786..4fa53971c 100644 --- a/tooling/ethrex-tests/tests/ethrex.rs +++ b/tooling/ethrex-tests/tests/ethrex.rs @@ -149,6 +149,25 @@ fn no_kzg_backend_linked() { ); } +/// Same screen for EIP-2537 (0x0b-0x11), which the 797df554 bump moved behind the +/// native-only `blst` feature. Unlike the KZG gap these do NOT revert: levm maps +/// `CryptoError::Unsupported` to `InternalError`, which aborts the run. Goes red if a +/// dependency restores a backend, or if upstream rewords the message. +#[test] +fn no_bls_backend_linked() { + use ethrex_guest_program::crypto::{Crypto, NativeCrypto}; + let result = NativeCrypto.bls12_381_g1_add(([0u8; 48], [0u8; 48]), ([0u8; 48], [0u8; 48])); + let message = match result { + Ok(_) => "bls12_381_g1_add accepted zero input".to_string(), + Err(err) => format!("{err:?}"), + }; + assert!( + message.contains("requires the `blst` feature"), + "a BLS12-381 backend is linked into ethrex-tests, so the native reference no \ + longer matches the guest on 0x0b-0x11: {message}" + ); +} + /// The same real block through the guest ELF, checking the VM's committed /// output matches the native reference. Split from the native gate above /// because this one needs the ethrex ELF and is far heavier than the synthetic From 55941aea4318634212c251b2b53691923cc4eb85 Mon Sep 17 00:00:00 2001 From: jotabulacios Date: Wed, 9 Sep 2026 12:21:52 -0300 Subject: [PATCH 11/12] Key the real-block benchmark on the fixture digest --- .github/workflows/benchmark-pr.yml | 59 +++++++++++++++++++++++------- 1 file changed, 46 insertions(+), 13 deletions(-) diff --git a/.github/workflows/benchmark-pr.yml b/.github/workflows/benchmark-pr.yml index b9da23925..56fa23e5b 100644 --- a/.github/workflows/benchmark-pr.yml +++ b/.github/workflows/benchmark-pr.yml @@ -70,10 +70,12 @@ env: ELF: executor/program_artifacts/rust/ethrex.elf # The workload: a real Ethereum block. WHICH block lives in # the Makefile and nowhere else — nothing in this file names one, so a repoint - # moves this job without editing it. At the current default that is 50.78M cycles, - # 10,478 keccak calls and 116 ecsm calls: ~5.8x the work of the synthetic block with a - # ~18x different keccak:ecrecover mix. That is the whole point — a prover change - # can move the synthetic number and the real one in opposite directions. + # moves this job without editing it. At the current default and pinned ethrex rev that + # is 30,498,818 cycles, 10,659 keccak calls and 116 ecsm calls — several times the work + # of the synthetic block, at a very different keccak:ecrecover mix. That is the whole + # point: a prover change can move the synthetic number and the real one in opposite + # directions. All three figures move with the ethrex rev, so re-measure on a bump + # rather than carrying them across one. # # The path is resolved from the Makefile (`make -s print-real-block-fixture`) into # REAL_INPUT at run time. The ~1 MB .bin is gitignored and FETCHED by URL + sha256 @@ -191,11 +193,13 @@ jobs: - name: Generate ethrex bench fixtures run: | - # Generated, not committed (gitignored via executor/.gitignore). They are - # untracked, so they survive the baseline `git checkout origin/main` below — - # the SAME workload (ELF + inputs) is proven on both the PR and main sides. + # Generated, not committed (gitignored via executor/.gitignore) — except + # ethrex_bench_4.bin, which the same file re-includes and is therefore tracked. + # The gitignored ones survive the baseline `git checkout origin/main` below on + # their own; bench_4 is restored explicitly there. Either way the SAME workload + # (ELF + inputs) is proven on both the PR and main sides. # distinct = N independent genesis-funded senders -> N distinct recipients. - ( cd tooling/ethrex-fixtures && cargo build --release ) + ( cd tooling/ethrex-fixtures && cargo build --locked --release ) GEN=tooling/ethrex-fixtures/target/release/ethrex-fixtures for n in $GROWTH_STEPS; do "$GEN" "$n" "executor/tests/ethrex_bench_${n}.bin" distinct @@ -459,6 +463,11 @@ jobs: echo "real_time_spread=$TIME_SPREAD" echo "real_all_times=$ALL_TIMES" echo "real_input=$(basename "$REAL_INPUT")" + # The basename is derived from network+block, so it is a complete key for + # WHICH block but not for which bytes: the archived ProgramInput layout moves + # with the ethrex rev, so one basename can name two byte streams. The digest + # is what makes the comparison guard below able to see a fixture swap. + echo "real_input_sha=$(sha256sum "$REAL_INPUT" | cut -c1-12)" } | tee -a /tmp/metrics.txt >> "$GITHUB_OUTPUT" - name: Upload metrics artifact @@ -491,7 +500,8 @@ jobs: # grep could match two lines and write a multi-line step output. get() { grep "^$1=" "$BASELINE_FILE" | head -1 | cut -d= -f2; } for key in growth_heaps growth_slope_mb growth_r2 \ - real_time_s real_peak_mb real_time_spread real_input; do + real_time_s real_peak_mb real_time_spread real_input \ + real_input_sha; do # A baseline predating the real block simply has no real_* keys; empty # values hide the table rather than producing a bogus comparison. echo "$key=$(get "$key")" >> "$GITHUB_OUTPUT" @@ -521,11 +531,19 @@ jobs: PR_SHA=$(git rev-parse HEAD) # Checkout main and rebuild the prover (CLI) only. The workload — the gitignored - # ethrex ELF and the generated, untracked bench fixtures — is left untouched by - # the checkout, so the same inputs are proven on both the PR and main sides. + # ethrex ELF and the real-block fixture — is left untouched by the checkout, so + # the same inputs are proven on both the PR and main sides. git fetch origin main git checkout origin/main + # ...with one exception: ethrex_bench_4.bin is TRACKED (executor/.gitignore + # re-includes it), so the checkout above replaces it with main's copy. The + # generator is deterministic, so the file is clean against HEAD and the checkout + # succeeds silently. On a PR that bumps the ethrex rev those bytes are a + # different archive layout, and bench_4 is index 0 of GROWTH_PROGRAMS — the + # point would be a fabricated delta. Put the PR's copy back. + git checkout "$PR_SHA" -- executor/tests/ethrex_bench_4.bin + cargo build --release -p cli --features jemalloc-stats # --- Growth benchmarks (default parallelism, 1 sample each) --- @@ -642,6 +660,7 @@ jobs: BA_REAL_PEAK: ${{ steps.baseline-artifact.outputs.real_peak_mb }} BA_REAL_SPREAD: ${{ steps.baseline-artifact.outputs.real_time_spread }} BA_REAL_INPUT: ${{ steps.baseline-artifact.outputs.real_input }} + BA_REAL_INPUT_SHA: ${{ steps.baseline-artifact.outputs.real_input_sha }} # Baseline run outputs BR_GROWTH_HEAPS: ${{ steps.baseline-run.outputs.growth_heaps }} BR_GROWTH_SLOPE: ${{ steps.baseline-run.outputs.growth_slope_mb }} @@ -657,6 +676,7 @@ jobs: PR_REAL_PEAK: ${{ steps.pr-real.outputs.real_peak_mb }} PR_REAL_EPOCHS: ${{ steps.pr-real.outputs.real_epochs }} PR_REAL_INPUT: ${{ steps.pr-real.outputs.real_input }} + PR_REAL_INPUT_SHA: ${{ steps.pr-real.outputs.real_input_sha }} PR_REAL_RUNS: ${{ steps.pr-real.outputs.real_runs }} PR_REAL_TIME_SPREAD: ${{ steps.pr-real.outputs.real_time_spread }} PR_REAL_ALL_TIMES: ${{ steps.pr-real.outputs.real_all_times }} @@ -671,6 +691,7 @@ jobs: BASELINE_REAL_PEAK="$BA_REAL_PEAK" BASELINE_REAL_SPREAD="$BA_REAL_SPREAD" BASELINE_REAL_INPUT="$BA_REAL_INPUT" + BASELINE_REAL_INPUT_SHA="$BA_REAL_INPUT_SHA" else BASELINE_SRC="built from main" BASELINE_GROWTH_HEAPS="$BR_GROWTH_HEAPS" @@ -684,6 +705,7 @@ jobs: # Freshly proven on this runner from $REAL_INPUT, so by construction the # same block the PR side used; the cached path carries its own label. BASELINE_REAL_INPUT="$PR_REAL_INPUT" + BASELINE_REAL_INPUT_SHA="$PR_REAL_INPUT_SHA" fi echo "baseline_src=$BASELINE_SRC" >> "$GITHUB_OUTPUT" @@ -714,9 +736,20 @@ jobs: # except on a mismatch, which real_mismatch below already carries. if [ -n "$PR_REAL_TIME" ] && [ -n "$BASELINE_REAL_TIME" ]; then + # Two keys, because they catch different things: the basename catches a + # repoint to another block, the digest catches the same block re-archived at + # a different ethrex rev (a baseline older than a pin bump). A baseline + # predating the digest key has an empty one and is compared on name alone, + # which is the pre-existing behaviour rather than a new mismatch. + REAL_SKEW="" if [ -n "$BASELINE_REAL_INPUT" ] && [ "$BASELINE_REAL_INPUT" != "$PR_REAL_INPUT" ]; then - echo "::warning::Baseline real block ($BASELINE_REAL_INPUT) differs from the PR's ($PR_REAL_INPUT); not comparing." - echo "real_mismatch=$BASELINE_REAL_INPUT" >> "$GITHUB_OUTPUT" + REAL_SKEW="$BASELINE_REAL_INPUT" + elif [ -n "$BASELINE_REAL_INPUT_SHA" ] && [ "$BASELINE_REAL_INPUT_SHA" != "$PR_REAL_INPUT_SHA" ]; then + REAL_SKEW="$BASELINE_REAL_INPUT@$BASELINE_REAL_INPUT_SHA" + fi + if [ -n "$REAL_SKEW" ]; then + echo "::warning::Baseline real block ($REAL_SKEW) differs from the PR's ($PR_REAL_INPUT@$PR_REAL_INPUT_SHA); not comparing." + echo "real_mismatch=$REAL_SKEW" >> "$GITHUB_OUTPUT" else REAL_TIME_DIFF=$(awk "BEGIN { printf \"%.3f\", $PR_REAL_TIME - $BASELINE_REAL_TIME }") REAL_TIME_PCT=$(awk "BEGIN { printf \"%.1f\", (($PR_REAL_TIME - $BASELINE_REAL_TIME) * 100) / $BASELINE_REAL_TIME }") From 6cfb43cba8bf89d75b1aeb4d147dc316f9bafaf4 Mon Sep 17 00:00:00 2001 From: jotabulacios Date: Wed, 9 Sep 2026 12:21:52 -0300 Subject: [PATCH 12/12] Repoint the ethrex docs at 797df554 --- bench_vs/README_ethrex.md | 7 +++ executor/tests/README.md | 24 ++++++--- tooling/ethrex-block-converter/README.md | 69 ++++++++++++++---------- 3 files changed, 63 insertions(+), 37 deletions(-) diff --git a/bench_vs/README_ethrex.md b/bench_vs/README_ethrex.md index c1b319ac3..53be32a98 100644 --- a/bench_vs/README_ethrex.md +++ b/bench_vs/README_ethrex.md @@ -14,6 +14,11 @@ rkyv-encoded) for the ethrex commit pinned (as `rev`) in `executor/programs/rust/ethrex/Cargo.toml`. The guest reads it via `get_private_input()` and runs ethrex's `execution_program`. +Both the fixtures and those instruction counts are therefore a function of that pin: the +counts above were measured at `156cb8d6` and have not been re-measured since the +`797df554` bump, which regenerated both fixtures. Treat them as an order of magnitude, +and re-run the benchmark for real numbers. + The timing window is **single-shot end-to-end prove** (ELF load + execution + trace build + AIR construction + STARK prove); it **excludes** verification. @@ -42,6 +47,8 @@ Output (example): ethrex 1 tx 47.302s 4392951 ``` +(Example output, taken at ethrex `156cb8d6` — see the note above.) + With `--report-dir DIR` it also writes: - `DIR/ethrex_summary.md` — markdown table - `DIR/ethrex_metrics.txt` — `_time_s=` / `_cycles=` per block diff --git a/executor/tests/README.md b/executor/tests/README.md index 6ecbc7212..7ae08e85c 100644 --- a/executor/tests/README.md +++ b/executor/tests/README.md @@ -10,14 +10,16 @@ workspace: ethrex pins rkyv `unaligned`, which must not feature-unify with the main workspace's aligned proof format). The ethrex guest, the native test reference, and the fixture generator are all -pinned to the same ethrex revision (the open LambdaVM-backend PR branch, until it -merges to `main`): +pinned to the same ethrex revision — a commit on ethrex `main`: ```text https://github.com/lambdaclass/ethrex.git -4f658c2b3d10e3f21d35ce546870f55ca3f940fc +797df5540c7d35cafd69b6971a74b2a49c67d1dd ``` +Five manifests carry that pin, not one. `scripts/set_ethrex_rev.sh --show` prints +it and fails if they ever disagree. + ### Generation These blobs are generated reproducibly by the in-repo tool `tooling/ethrex-fixtures` @@ -39,10 +41,16 @@ recursion profile target rather than the executor tests (see the Makefile's regenerated and checksummed with them — a rev bump makes every one of these undecodable, not just the three the executor reads. -To regenerate after an ethrex rev bump, update the `rev` in -`tooling/ethrex-fixtures/Cargo.toml` (and the guest's), then run -`make regen-ethrex-fixtures` from the repo root. The target rebuilds the -committed fixtures and refreshes the checksums below. +It is also the only committed fixture nothing decodes in PR-blocking CI: the other three +go through `rkyv::from_bytes` in `tooling/ethrex-tests`, while this one's single in-repo +reader (`prover/src/tests/page_offset_forgery_poc.rs`) only reads its length. + +To regenerate after an ethrex rev bump, re-pin with +`scripts/set_ethrex_rev.sh <40-char-sha>` (all five manifests at once), regenerate the +five locks, then run `make regen-ethrex-fixtures` from the repo root. + +The checksums below are refreshed by that same run, so they catch a hand-edited `.bin` +but never one that is stale against the pinned rev. `--show` is what catches the cause. Known fixtures: @@ -70,7 +78,7 @@ ethrex_bench_4.bin The blocks above are synthetic (N plain ETH transfers over a small genesis). For a representative workload — real contract execution, real trie depth, real bytecode — `make ethrex-real-block-fixture` downloads -`ethrex_mainnet_25368371_4f658c2b.bin` (1,110,165 B) from the `bench-fixtures-v1` release +`ethrex_mainnet_25368371_797df554.bin` (1,110,183 B) from the `bench-fixtures-v1` release and verifies it against `ETHREX_REAL_BLOCK_FIXTURE_SHA256` in the Makefile before moving it into place. It is gitignored rather than committed, so the checksum lives next to the URL in the Makefile rather than in the table above (the checksum diff --git a/tooling/ethrex-block-converter/README.md b/tooling/ethrex-block-converter/README.md index 48c58e27b..1d14d6c9b 100644 --- a/tooling/ethrex-block-converter/README.md +++ b/tooling/ethrex-block-converter/README.md @@ -11,16 +11,19 @@ opposite — a block that actually looks like Ethereum. Figures below are for the **current default** real block, mainnet 25368371; a repoint replaces them (see [Adopting a different block](#adopting-a-different-block)). -All are measured. +All are measured. Everything downstream of the archive layout — serialized size, cycles +and the accelerator counts — also moves with the pinned ethrex rev, so each column says +which rev it was taken at; the synthetic column has not been re-measured since the +`797df554` bump. -| | `ethrex_bench_20.bin` (synthetic) | `ethrex_mainnet_25368371.bin` (real, default) | +| | `ethrex_bench_20.bin` (synthetic, `4f658c2b`) | `ethrex_mainnet_25368371.bin` (real, default, `797df554`) | |---|---|---| | gas used | 420,000 | **2,428,684** | | transactions | 20 (all plain transfers) | 29 (real mix) | -| serialized size | 32,766 B | 1,110,156 B | -| cycles | 8,734,622 | **50,781,557** | -| keccak / ecsm calls | 411 / 80 | **10,478** / 116 | -| keccaks per ECSM call | 5.1 | **90** | +| serialized size | 32,766 B | 1,110,183 B | +| cycles | 8,734,622 | **30,498,818** | +| keccak / ecsm calls | 411 / 80 | **10,659** / 116 | +| keccaks per ECSM call | 5.1 | **92** | The last row counts keccaks per **ECSM call**, which is the ratio of the two rows above it. One ecrecover issues four ECSM ecalls — `lincomb2_with_oracle` in @@ -88,7 +91,9 @@ Artifacts live in the **[`bench-fixtures-v1`][release]** release on | asset | sha256 | read by | |---|---|---| -| `ethrex_mainnet_25368371_4f658c2b.bin` | `0a301731…` | every benchmark (**current default**) | +| `ethrex_mainnet_25368371_797df554.bin` | `573004e6…` | every benchmark (**current default**) | +| `ethrex_mainnet_25368371.bin` | `61eba49b…` | superseded; `main` still fetches this one | +| `ethrex_mainnet_25368371_4f658c2b.bin` | `0a301731…` | superseded (intermediate rev, unused) | | `cache_mainnet_25368371.json` | `7aa88a5f…` | `regen-real-block-fixture` | | `ethrex_mainnet_25453112.bin` | `0298663d…` | alternate candidate | | `cache_mainnet_25453112.json` | `20ffbbc1…` | alternate candidate | @@ -136,15 +141,17 @@ cargo run --release -- Output is deterministic for a given cache file: ```text -wrote ../../executor/tests/ethrex_mainnet_25368371.bin (1110165 bytes): 1 block(s) \ +wrote ../../executor/tests/ethrex_mainnet_25368371.bin (1110183 bytes): 1 block(s) \ from mainnet starting at #25368371, 29 transaction(s), 2428684 gas ``` -Verified at the current ethrex rev: regenerating from the hosted cache reproduces -`0a301731…` byte for byte, and the result passes `test_ethrex_real_block_native` — -which is what proves the hosted cache and the fixture the Makefile expects describe -the same block. (Byte count and digest are both rev-dependent: the `4f658c2b` bump -moved them from 1,110,156 B / `61eba49b…`, the bytes still hosted in the release.) +Verified at the current ethrex rev (`797df554`): regenerating from the hosted cache +reproduces `573004e6…` byte for byte, and the result passes +`test_ethrex_real_block_native` — which is what proves the hosted cache and the fixture +the Makefile expects describe the same block. Byte count and digest are both +rev-dependent; this block has one archive per rev it has been pinned at +(1,110,156 B / `61eba49b…`, then 1,110,165 B / `0a301731…`, now this one), which is why +the release assets carry the rev in their names. The converter's `conversion_is_reproducible` test enforces the same property, but against its own pinned block rather than this one — see [Validation](#validation). @@ -354,8 +361,9 @@ repointed ~1 MB fixture cannot become committable by accident. ### Measured cost of candidate blocks Cost is a property of the block, so it changes with the repoint. All figures are -measured, never derived from gas — **cycles per gas is not constant** (20.9 for the -current default), so sizing a candidate from its gas mispredicts cost. +measured, never derived from gas — **cycles per gas is not constant** (12.6 for the +current default at `797df554`; it was 20.9 at `4f658c2b`), so sizing a candidate from its +gas mispredicts cost. **Current default — main-vintage (merge `fdb92f67`, main @ `9ccdaf2`):** @@ -363,9 +371,14 @@ These figures were measured on the pre-bump fixture (`61eba49b…`, 1,110,156 B) left as measured rather than restamped. The ethrex `4f658c2b` bump changed the fixture bytes, so they are a baseline for a workload that no longer exists byte-for-byte. -Post-bump CPU counterparts, measured ABBA on `vm-benchmarks-1` at the same epoch 2^22: -**45,074,552 cycles** (−11.24%), **142.37 s** CPU prove (−10.87%), **936.7 MB** proof -(−12.22%), peak RSS flat at ~48 GB. The GPU column has no post-bump counterpart yet. +Counterparts at the intermediate `4f658c2b` rev, measured ABBA on `vm-benchmarks-1` at +the same epoch 2^22: **45,074,552 cycles** (−11.24%), **142.37 s** CPU prove (−10.87%), +**936.7 MB** proof (−12.22%), peak RSS flat at ~48 GB. + +At the currently pinned `797df554` only the cycle count has been re-measured — +**30,498,818 cycles**, 10,659 keccak, 116 ecsm. Prove time, proof size and the GPU column +have no counterpart at this rev yet; re-run `/bench` rather than reading the rows below +as current. | block | gas | cycles | GPU prove (RTX 5090) | CPU prove | proof | fixture | |---|---|---|---|---|---|---| @@ -468,17 +481,15 @@ first run after a repoint reports one-sided numbers until main republishes. ## Why the JSON and not ethrex-replay's own `.bin` -`ethrex-replay` can already emit a rkyv `ProgramInput`, but it tracks ethrex -`main` while we pin a branch off it, and the type has diverged between the two -before: against the previously pinned rev (`156cb8d6…`) `main` carried an extra -`fee_configs` field and had moved the type from `l1::` to `input::`, so replay's -binary would not deserialize in our guest at all. +`ethrex-replay` can already emit a rkyv `ProgramInput`, but the type has diverged from +what our guest expects before: back when we pinned a branch off `main` (`156cb8d6…`) +`main` carried an extra `fee_configs` field and had moved the type from `l1::` to +`input::`, so replay's binary would not deserialize in our guest at all. -At the currently pinned rev (`4f658c2b…`, rebased onto recent `main`) the -`ProgramInput` definition matches `main`'s again, and that gap has closed for -now. What has not closed: replay resolves rkyv itself from ethrex's `^0.8.10` -rather than our exact `=0.8.16`, `main` has no `lambdavm` feature to build the -guest side against, and the next bump can reopen the type gap without warning. +We now pin `main` directly (`797df554…`), so that particular gap is closed by +construction. What has not closed: replay resolves rkyv itself from ethrex's `^0.8.10` +rather than our exact `=0.8.16`, and the next bump can reopen the type gap without +warning. The cache JSON carries only `blocks` + `witness` + `network` as plain serde, so it survives that drift. This tool re-reads it with **our** pinned ethrex types @@ -515,7 +526,7 @@ exercised via the guest's own trait dispatch. Stateless re-execution ends in a post-state-root check, so any divergence from consensus fails here. **It does not screen KZG.** Declaring `ethrex-guest-program` with -`default-features = false, features = ["lambdavm"]` is necessary but not +`default-features = false` (and no features, as the guest does) is necessary but not sufficient: the `ethrex-config` dependency (used only for `Network::get_genesis()`) pulls `ethrex-p2p`, whose `default = ["c-kzg"]` propagates down to `ethrex-crypto/c-kzg` — and `default-features = false` cannot