refactor: migrate engine validation to reth main hooks#140
Conversation
validate_payload already registered an expectation in convert_payload_to_block; clearing it on the early L1-index reject path matches the inner-failure cleanup and avoids a stale cache entry until LRU eviction.
There was a problem hiding this comment.
Claude Code Review
Claude Code Review is paused for this repository. To reconnect it, an admin of this repository's GitHub organization (or the account owner, for personal repositories) who can also manage your Claude organization's Code Review settings needs to re-link GitHub in Code Review settings. This is a one-time step.
Tip: disable this comment in your organization's Code Review settings.
📝 WalkthroughWalkthroughThe workspace now targets Rust 1.95 and newer Reth, Revm, Alloy, and Vergen APIs. Morph engine-tree validation is implemented locally, payload building uses state-root handles, custom EVM instructions return execution results, and RPC and consensus integrations are updated. ChangesWorkspace and API upgrade
Tree validator migration
Payload and state-root flow
EVM execution compatibility
RPC and hardfork updates
Estimated code review effort: 5 (Critical) | ~120 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Format the L1-index cleanup path, upgrade crossbeam-epoch to 0.9.20, and drop advisory ignores that no longer match after the reth main bump.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/node/src/validator.rs`:
- Around line 225-240: Update the L1 message validation loop in the block
validation method around expected so the first transaction’s queue_index must
equal parent.next_l1_msg_index before advancing expected; continue requiring
each subsequent queue index to match the current expected value, then increment
it with checked_add. Add a regression case covering a first queue index that
differs from the parent index and ensure validation rejects it.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 498f00c1-6109-49e9-859e-f7eb7c9ddf3c
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (28)
Cargo.tomlcrates/chainspec/src/hardfork.rscrates/consensus/src/validation.rscrates/engine-api/src/builder.rscrates/engine-tree-ext/Cargo.tomlcrates/engine-tree-ext/src/gate.rscrates/engine-tree-ext/src/lib.rscrates/engine-tree-ext/src/payload_validator.rscrates/engine-tree-ext/src/trie_updates.rscrates/engine-tree-ext/tests/jade_boundary.rscrates/evm/Cargo.tomlcrates/evm/src/block/mod.rscrates/evm/src/context.rscrates/evm/src/evm.rscrates/node/Cargo.tomlcrates/node/build.rscrates/node/src/node.rscrates/node/src/test_utils.rscrates/node/src/validator.rscrates/node/tests/it/engine.rscrates/node/tests/it/helpers.rscrates/payload/builder/src/builder.rscrates/payload/types/src/attributes.rscrates/payload/types/src/lib.rscrates/revm/src/evm.rscrates/revm/src/precompiles.rscrates/rpc/src/eth/call.rscrates/rpc/src/eth/mod.rs
💤 Files with no reviewable changes (6)
- crates/engine-tree-ext/src/lib.rs
- crates/engine-tree-ext/src/gate.rs
- crates/engine-tree-ext/tests/jade_boundary.rs
- crates/engine-tree-ext/Cargo.toml
- crates/engine-tree-ext/src/trie_updates.rs
- crates/engine-tree-ext/src/payload_validator.rs
There was a problem hiding this comment.
🧹 Nitpick comments (1)
Cargo.toml (1)
102-161: 🩺 Stability & Availability | 🔵 TrivialEnsure thorough historical replay testing for the revm/reth upgrade.
The upgraded
rethv2.4.0and underlyingrevmdependencies introduce changes to core execution APIs. As highlighted by the provided context snippets, downstream paths—such asExecutionResultlog handling in receipt building,EvmFactorytype bounds, and RPC gas allowance error mapping—rely closely on the specific semantics of these upgraded traits.As per the PR objectives, full mainnet historical replay remains pending. It is critical to complete this replay to verify that the new dependency APIs do not introduce subtle consensus or runtime deviations before release.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@Cargo.toml` around lines 102 - 161, Complete full mainnet historical replay testing for the reth v2.4.0/revm upgrade, covering receipt construction through ExecutionResult log handling, EvmFactory trait-bound paths, and RPC gas-allowance error mapping. Validate replayed results against expected consensus behavior and resolve any compatibility or runtime deviations before release.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@Cargo.toml`:
- Around line 102-161: Complete full mainnet historical replay testing for the
reth v2.4.0/revm upgrade, covering receipt construction through ExecutionResult
log handling, EvmFactory trait-bound paths, and RPC gas-allowance error mapping.
Validate replayed results against expected consensus behavior and resolve any
compatibility or runtime deviations before release.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 9b6edf28-c7f4-42a4-8a6f-8f2033f2191a
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (3)
Cargo.tomlcrates/node/src/validator.rsdeny.toml
💤 Files with no reviewable changes (1)
- deny.toml
🚧 Files skipped from review as they are similar to previous changes (1)
- crates/node/src/validator.rs
Summary
f0a41795(post-v2.3.0) and removemorph-engine-tree-ext, replacing the vendored payload validator with officialStateRootStrategy+ a thinMorphTreeEngineValidatorwrapper.validate_payloadso failed payloads do not leave stale cache entries until LRU eviction.Test plan
cargo check --workspacecargo clippy --all --all-targets -- -D warningscargo nextest run --workspace(598 passed)cargo nextest run -p morph-node --features test-utils -E 'binary(it)'(97 passed)cargo test -p morph-node --lib validator::testsSummary by CodeRabbit
New Features
Bug Fixes
Compatibility