Skip to content

fix(node): treat zero withdraw trie root as unspecified#127

Merged
panos-xyz merged 2 commits into
mainfrom
fix/withdraw-root-zero-skip
Jun 10, 2026
Merged

fix(node): treat zero withdraw trie root as unspecified#127
panos-xyz merged 2 commits into
mainfrom
fix/withdraw-root-zero-skip

Conversation

@panos-xyz

@panos-xyz panos-xyz commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Treat a zero CL-supplied withdraw trie root as unspecified, matching morph-geth's compatibility behavior.
  • Keep strict withdraw-trie cross-check validation for non-zero supplied roots.
  • Add a regression test for the sync-path case where the actual withdraw-trie slot updates but the CL payload carries zero.

Test plan

  • cargo test -p morph-node validate_block_post_execution_treats_zero_expected_root_as_skip_validation
  • cargo test -p morph-node validator::tests
  • cargo fmt --all -- --check

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Validator now correctly interprets zero withdraw-trie root values as skip validation instead of treating them as explicit verification.
  • Tests

    • Added unit test confirming validator properly handles zero withdraw-trie root values and skips cross-checks as expected.

Align the reth payload validator with morph-geth's zero-value compatibility semantics so blocks from sync paths that omit the optional withdraw-trie cross-check are not rejected as expecting an actual zero root.

Constraint: Preserve strict validation for non-zero CL-supplied withdraw trie roots
Confidence: high
Scope-risk: narrow
@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: bf8989ae-eb03-4ee9-9673-998d1977d023

📥 Commits

Reviewing files that changed from the base of the PR and between 7730d99 and d69264e.

📒 Files selected for processing (1)
  • crates/node/src/validator.rs

📝 Walkthrough

Walkthrough

The validator's payload-to-block conversion logic is updated to treat an expected withdraw-trie root of B256::ZERO as a skip-validation directive rather than an explicit verification target, aligning with morph-geth behavior. A new test confirms the updated behavior executes successfully without consuming a verify expectation.

Changes

Withdraw-Trie Root Validation

Layer / File(s) Summary
Zero-root withdraw trie expectation handling
crates/node/src/validator.rs
The expectation selection logic in convert_payload_to_block is rewritten from an Option mapping to a match statement: when the provided expected root is B256::ZERO, the validator sets SkipValidation; otherwise, it sets Verify(root). A new test confirms that a payload with with_expected_withdraw_trie_root(..., B256::ZERO) skips verification and post-execution validation succeeds.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • morph-l2/morph-reth#47: Both PRs modify MorphEngineValidator's payload/block post-execution validation path, specifically affecting how withdraw-trie-root expectations and B256::ZERO-driven skip behavior are handled.

Suggested reviewers

  • chengwenxi
  • anylots

Poem

🐰 A zero root hops past the check with glee,
Matching morph-geth's design so free,
No verify dance when the root is null,
The test hops along—one logical full!
Skip, don't verify, the validator declares,
And the withdraw root logic now fairly shares! 🌿

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: treating zero withdraw trie root as unspecified in the validator logic.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/withdraw-root-zero-skip

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@panos-xyz panos-xyz merged commit b6c47fb into main Jun 10, 2026
12 checks passed
@panos-xyz panos-xyz deleted the fix/withdraw-root-zero-skip branch June 10, 2026 02:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants