Skip to content
Closed
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
20 changes: 19 additions & 1 deletion .github/workflows/pr_main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,33 @@ jobs:
run: |
cargo test --release -p executor test_ckzg -- --ignored

# The real-block fixture (~1 MB) is gitignored and generated on demand;
# test_ethrex_real_block_native below needs it present. This also
# downloads the ethrex-replay cache the converter's own tests read.
- name: Generate ethrex real-block fixture
run: make ethrex-real-block-fixture

# Detached workspace. Executes the block through `LambdaVmEcsmCrypto`, the
# guest's own `Crypto` impl, and pins the fixture's sha256. Note it does NOT
# screen KZG (its graph links c-kzg via ethrex-config — see that crate's
# Cargo.toml); the ethrex-tests step below is what covers 0x0a.
- name: Run ethrex real-block converter tests (detached workspace)
run: |
cd tooling/ethrex-real-block && cargo test --release

# ethrex host-reference tests live in the detached `tooling/ethrex-tests`
# workspace (ethrex pins rkyv's `unaligned` feature, which must not
# feature-unify with the main workspace's aligned proof format), so run
# them from that directory to use its isolated Cargo.lock. The guest ELF
# and committed fixtures are already present from the steps above.
# --include-ignored also runs the heavier synthetic-block test.
# `test_ethrex_real_block_vm` is skipped: it drives a real block through
# the VM and its runtime is not yet measured, so it stays opt-in rather
# than sitting in the PR gate. Run it manually on a build server.
- name: Run ethrex host-reference tests (detached workspace)
run: |
cd tooling/ethrex-tests && cargo test --release -- --include-ignored
cd tooling/ethrex-tests && \
cargo test --release -- --include-ignored --skip test_ethrex_real_block_vm

test-cli:
name: CLI tests
Expand Down
43 changes: 39 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
.PHONY: deps deps-linux deps-macos compile-programs-asm compile-programs-rust compile-bench \
compile-programs compile-recursion-elfs clean-asm clean-rust clean-bench clean-shared \
clean-recursion-elfs clean test test-asm \
test-rust test-ethrex test-executor test-syscalls test-flamegraph flamegraph-prover test-profile-recursion test-profile-recursion-single test-profile-recursion-multi \
test-rust test-ethrex test-ethrex-offline test-executor test-syscalls test-flamegraph flamegraph-prover test-profile-recursion test-profile-recursion-single test-profile-recursion-multi \
test-profile-recursion-block recursion-profile-block-input \
test-fast test-prover test-prover-all test-prover-debug test-disk-spill test-math-cuda test-cuda-integration test-cuda-fallback \
test-prover-cuda test-prover-comprehensive-cuda \
bench-math-cuda bench-prover bench-prover-cuda build check clippy fmt lint regen-ethrex-fixtures \
update-ethrex-fixture-checksums check-ethrex-fixture-checksums
update-ethrex-fixture-checksums check-ethrex-fixture-checksums ethrex-real-block-fixture

UNAME := $(shell uname)

Expand Down Expand Up @@ -271,10 +271,45 @@ test-asm: compile-programs-asm
test-rust: compile-programs-rust
cargo test -p executor --test rust

# Real-block fixture: a genuine Hoodi block (4.4M gas, 11 txs, ~124 KB of
# contract bytecode, 1705 state-trie nodes), as opposed to the synthetic
# N-plain-transfer blocks from tooling/ethrex-fixtures. ~1 MB, so it is
# generated on demand and gitignored rather than committed.
#
# The source is ethrex-replay's cache JSON, not that tool's own rkyv output:
# ethrex-replay tracks ethrex `main`, where `ProgramInput` has diverged from the
# rev our guest pins, so only the JSON is safe to read across the two.
ETHREX_REAL_BLOCK := 1265656
# Pinned by immutable `rev`, as the guest pins ethrex itself: a branch ref would
# let the benchmark's input change under a fixed fixture name, silently breaking
# comparability across runs. Re-pin deliberately when adopting a new block.
ETHREX_REPLAY_REV := 2693e0182a8734117151d8ea2891eda5afc60383
ETHREX_REAL_BLOCK_CACHE := tooling/ethrex-real-block/caches/cache_hoodi_$(ETHREX_REAL_BLOCK).json
ETHREX_REAL_BLOCK_FIXTURE := executor/tests/ethrex_hoodi_$(ETHREX_REAL_BLOCK).bin

ethrex-real-block-fixture: $(ETHREX_REAL_BLOCK_FIXTURE)

$(ETHREX_REAL_BLOCK_CACHE):
mkdir -p $(dir $@)
curl -fsSL --retry 3 --retry-delay 2 --retry-all-errors -o $@.tmp \
https://raw.githubusercontent.com/lambdaclass/ethrex-replay/$(ETHREX_REPLAY_REV)/caches/cache_hoodi_$(ETHREX_REAL_BLOCK).json
Comment thread
nicole-graus marked this conversation as resolved.
mv $@.tmp $@

$(ETHREX_REAL_BLOCK_FIXTURE): $(ETHREX_REAL_BLOCK_CACHE) tooling/ethrex-real-block/src/main.rs tooling/ethrex-real-block/Cargo.toml tooling/ethrex-real-block/Cargo.lock
cd tooling/ethrex-real-block && \
cargo run --release -- ../../$(ETHREX_REAL_BLOCK_CACHE) ../../$@

# ethrex host-reference tests live in the detached `tooling/ethrex-tests`
# workspace (ethrex pins rkyv's `unaligned` feature; isolated Cargo.lock).
test-ethrex: compile-programs-rust
cd tooling/ethrex-tests && cargo test --release -- --include-ignored
test-ethrex: compile-programs-rust $(ETHREX_REAL_BLOCK_FIXTURE)
Comment thread
nicole-graus marked this conversation as resolved.
cd tooling/ethrex-tests && cargo test --release -- --include-ignored --skip test_ethrex_real_block_vm

# Offline variant: no network. `--skip test_ethrex_real_block` is a substring
# match, so it drops both real-block tests — the `_vm` one and the `_native` one,
# which reads the downloaded fixture and would 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

test-flamegraph:
cargo test -p executor --test flamegraph
Expand Down
4 changes: 3 additions & 1 deletion executor/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/target
/program_artifacts/rust
/tests/ethrex_hoodi.bin
# Real-block fixtures (~1 MB): generated by `make ethrex-real-block-fixture`
# from an ethrex-replay cache, never committed. See tooling/ethrex-real-block.
/tests/ethrex_hoodi*.bin
/tests/ethrex_bench_*.bin
# _4 is committed (~17 KB): used by `make recursion-profile-block-input` and
# scripts/bench_recursion_scaling.sh. Other sizes stay ignored — scaling.sh
Expand Down
10 changes: 10 additions & 0 deletions executor/tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,13 @@ ethrex_10_transfers.bin
sha256: 38901ee4d40b99cf0aa7f642a92f0fc8db76d974bf43033a1673839020c3c28e
contents: stateless ethrex block with ten plain ETH transfer transactions
```

## 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` generates
`ethrex_hoodi_1265656.bin` from an ethrex-replay cache. It is ~1 MB, so it is
gitignored and generated on demand rather than committed, and its checksum is
pinned in `tooling/ethrex-real-block/README.md` rather than above (the
checksum script only covers committed fixtures).
4 changes: 4 additions & 0 deletions tooling/ethrex-real-block/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/target
# Downloaded ethrex-replay cache JSONs (~1.5 MB each), fetched on demand by
# `make ethrex-real-block-fixture`.
/caches/
Loading
Loading