Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,12 @@ 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
ETHREX_REAL_BLOCK_FIXTURE_SHA256 := 61eba49b6b254f4a05def5a47b08a21ae3eee56f0d37bcd7b3a24b0cc1e4a300
# 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).
ETHREX_REAL_BLOCK_CACHE_URL := https://github.com/yetanotherco/lambda_vm/releases/download/bench-fixtures-v1/cache_mainnet_25368371.json
Expand Down Expand Up @@ -499,7 +503,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:
Expand Down
68 changes: 2 additions & 66 deletions crypto/ethrex-crypto/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crypto/ethrex-crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
46 changes: 27 additions & 19 deletions executor/programs/rust/ethrex/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions executor/programs/rust/ethrex/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
22 changes: 17 additions & 5 deletions executor/tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ merges to `main`):

```text
https://github.com/lambdaclass/ethrex.git
156cb8d6a3974f411d71622eecd1b249ee37ff1c
4f658c2b3d10e3f21d35ce546870f55ca3f940fc
```

### Generation
Expand All @@ -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
Expand All @@ -41,24 +48,29 @@ 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

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

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
Expand Down
Binary file modified executor/tests/ethrex_10_transfers.bin
Binary file not shown.
Binary file modified executor/tests/ethrex_bench_4.bin
Binary file not shown.
Binary file modified executor/tests/ethrex_empty_block.bin
Binary file not shown.
Binary file modified executor/tests/ethrex_simple_tx.bin
Binary file not shown.
Loading
Loading