bench: revmc jit default - #2668
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: |
|
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
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: |
PR Type
Enhancement, Dependencies, Tests
Description
Default-enable revmc feature and upgrade dependencies
Add executor JIT/AOT CLI options and configuration
Integrate JitHandle into EVM executor and worker pool
Implement filesystem artifact store for AOT; update tests and fixtures
Diagram Walkthrough
File Walkthrough
2 files
Emit revmc builtin symbols when enabledAdd JIT/AOT executor configuration options4 files
Implement revmc JIT/AOT integration backendIntegrate JitHandle in EVM instantiationDefine ExecutorRevm type alias for JIT wrapperPass JitHandle to EVM worker pool threads4 files
Add new gas fields in CallFrame testsAdjust ExternalBlock fixture data fieldsUpdate ExternalBlockWithReceipts fixture fieldsRevise ExternalTransaction fixture parameters2 files
Upgrade dependencies and add revmc featureUpdate macro crate dependencies versions