bench: revmc aot default - #2667
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
The revmc feature pulls in llvm-sys, which requires llvm-config and static LLVM libraries at build time. Extract the install into a composite action and use it in every workflow that invokes cargo.
Exempt the revm 43 family, alloy 2.4.1, and the revmc toolchain deps (inkwell, llvm-sys, libloading, wincode, pastey, oxc_index) instead of auditing them: these are benchmark-only branches. Real audits should precede any production merge. The revmc git dependencies are marked audit-as-crates-io = false since they are pinned source snapshots with no matching crates.io release.
|
Benchmark: Git Info:
Leader Stats: Follower Stats: Plots: |
Sample revmc's pull-based counters (compiled vs interpreted executions, compilation successes/failures, cache residency, dropped hot events, JIT memory) every 5s from a dedicated reporter thread and expose them as stratus_executor_jit_* gauges labeled by mode (jit|aot). This makes it possible to tell from /metrics whether benchmarks actually execute compiled code or silently fall back to the interpreter.
|
Benchmark: Git Info:
Leader Stats: Follower Stats: Plots: |
revmc pins each code hash's first dispatch decision in a per-EVM lookup cache, so a contract first executed before its background compilation finished stays interpreted for that EVM's lifetime - with a single tx-pool EVM that meant benchmarks never ran compiled code. - periodically reinstall the JIT backend (every 250ms per worker) to reset the dispatch cache and adopt newly compiled programs - add --executor-jit-blocking to compile synchronously on the first execution of each contract instead, guaranteeing compiled execution from the second execution on - warn at startup when AOT is enabled but cc/ld.lld are missing, since every AOT compilation would fail and execution stays interpreted - reword executor_jit lookup metrics: they count dispatches (once per code hash per EVM), not executions
|
Benchmark: Git Info:
Leader Stats: Follower Stats: Plots: |
|
Benchmark: Git Info:
Leader Stats: Follower Stats: Plots: |
The conversion hardcoded code_hash as KECCAK_EMPTY while attaching the real bytecode. revm <= 42 never consumed code_hash on the execution path (the interpreter ran code bytes directly), so the bug was latent. revm 43 propagates the account's code_hash into the call frame's precomputed bytecode hash (known_bytecode), which consumers now dispatch on: - revmc JIT/AOT keyed every contract's compiled code under the empty hash, so the first contract compiled was executed for every contract (reverts, wrong results, hangs); compile logs showed only KECCAK_EMPTY (0xc5d246...) - EXTCODEHASH returned the empty hash instead of the real code hash for accounts loaded from storage Compute the real keccak via Bytecode::hash_slow (OnceLock-cached) so dispatch hashes match the executed bytecode.
|
Benchmark: Git Info:
Leader Stats: Follower Stats: Plots: |
|
Benchmark: Git Info:
Leader Stats: Follower Stats: Plots: |
|
Benchmark: Git Info:
Leader Stats: Follower Stats: Plots: |
PR Type
Enhancement, Tests
Description
Integrate
revmcJIT/AOT support by defaultAdd executor config flags for JIT/AOT
Wrap EVM with
JitHandlefor compiled executionBump dependencies, enable
revmcfeature by defaultUpdate RPC tests with new gas/refund fields and fixtures
Diagram Walkthrough
File Walkthrough
2 files
Emit `__revmc_builtin_*` symbols when revmc feature enabledAdd JIT/AOT executor command-line flags4 files
Implement revmc JIT/AOT integration and artifact storeExpose `JitHandle` and `ExecutorRevm` in modDefine `ExecutorRevm` alias for JIT-wrapped EVMDistribute `JitHandle` to EVM worker threads4 files
Add gas/refund fields to `CallFrame` in testsUpdate numeric fields and add `blockTimestamp`Refresh fixture values and add `blockTimestamp`Adjust transaction fields and include `blockTimestamp`2 files
Bump dependencies and enable `revmc` featureUpdate `syn` and `proc-macro2` versions