feat: vendor op-revm into pevm and bump revm to v39 - #507
Conversation
There was a problem hiding this comment.
Code Review
This pull request upgrades the project to use revm version 39.0.0 and its associated crates. Due to version incompatibilities with the external op-revm crate, several Optimism-specific EVM types have been vendored and simplified into a new op_revm module within crates/pevm. This includes custom implementations for the EVM, handler, precompiles, and transaction types, specifically tailored for the RISE chain by disabling L1 and operator fee arithmetic. The review identified several critical issues where the vendored code failed to account for the new generic requirements and API changes in revm 39, particularly regarding the OpPrecompiles type and the need for mutable context references in the OpHandler methods.
0fdf133 to
7d295b5
Compare
There was a problem hiding this comment.
When update sha3-asm to 0.1.7, performance regressed 15% on bench mainnet, root caused:
- 0.1.6: SHA3_absorb — loads keccak state into GP registers (x0-x28), runs scalar keccak
- 0.1.7: SHA3_absorb_cext — loads state into FP/NEON registers (d0-d24), runs using eor3/rax1/xar/bcax SHA3 crypto extension instructions
Despite SHA3 instructions being faster per-round on paper, scalar version wins on Graviton. Likely reasons:
- EVM keccak calls are short (32-byte hash), setup overhead of NEON register loads dominates
- Graviton3 has better scalar pipeline utilization for this access pattern
- GP register file avoids FP register bank crossing penalty
Worth reporting to crate author
|
benchmark |
|
✅ Gigagas benchmark for commit 7d295b5 Detail |
|
✅ Mainnet benchmark for commit 7d295b5 This pr: Detail |
|
benchmark |
|
✅ Gigagas benchmark for commit 7d295b5 Detail |
|
✅ Mainnet benchmark for commit 7d295b5 This pr: Detail |
7d295b5 to
1409b1e
Compare
op-revm <=20.0.0 pins revm = "^38" which is semver-incompatible with revm 39. Vendor the ~dozen types RISE actually needs into crates/pevm/src/op_revm/, stripped of all L1/DA/operator fee arithmetic (RISE zeroes these). Update for revm 39 API changes: Gas::new_spent_with_reservoir, last_frame_result reservoir param, PrecompileProvider::warm_addresses returning &AddressSet, unsafe Bytecode::new_analyzed. Patch five yanked revm subcrates via git tag v108. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> chore: rename op_revm → rise_revm and simplify for RISE-only - Rename module op_revm → rise_revm (no op-revm dependency remains) - Remove OpSpecId; RISE always runs SpecId::PRAGUE (JOVIAN) - Collapse all is_enabled_in(REGOLITH/ISTHMUS) branches (always true on RISE) - Stub L1BlockInfo, precompiles set_spec, and all fee methods to zero/no-op - Delete dead spec.rs Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> clean up cargo update simplify precompile simplify handler simplify evm.rs pin simplify code
1409b1e to
e1ab815
Compare
f841c94 to
8d1a9cb
Compare
|
benchmark |
|
✅ Gigagas benchmark for commit 8d1a9cb Detail |
|
✅ Mainnet benchmark for commit 8d1a9cb This pr: Detail |
|
benchmark |
|
✅ Gigagas benchmark for commit 8d1a9cb Detail |
|
✅ Mainnet benchmark for commit 8d1a9cb This pr: Detail |
|
benchmark |
|
✅ Gigagas benchmark for commit 4ed5e6c Detail |
4ed5e6c to
579b6fc
Compare
|
benchmark |
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
|
✅ Mainnet benchmark for commit 4ed5e6c This pr: Detail |
|
✅ Gigagas benchmark for commit 080d37b Detail |
|
benchmark |
|
✅ Mainnet benchmark for commit 080d37b This pr: Detail |
|
✅ Gigagas benchmark for commit 080d37b Detail |
|
✅ Mainnet benchmark for commit 080d37b This pr: Detail |
Uh oh!
There was an error while loading. Please reload this page.