feat(l1): skip receipt validation during full sync batch execution#6489
feat(l1): skip receipt validation during full sync batch execution#6489azteca1998 wants to merge 2 commits intomainfrom
Conversation
…ution (#6482) During full sync, `add_blocks_in_batch()` recomputes the receipt trie root for every block via `validate_receipts_root()`. This is unnecessary because blocks are downloaded from trusted peers with a verified header chain, and the state root validation at the end of each batch already ensures correctness. Add a `skip_receipt_validation` flag to `execute_block_from_state()` and pass `true` when called from `add_blocks_in_batch()`. All other code paths (CL block processing, pipeline execution) continue to validate receipts as before.
🤖 Kimi Code ReviewReview of PR #6489 - Receipt validation bypass Security & Correctness
Code Quality
Verification Needed
If line 2214 is indeed in the block production pipeline, the approach is valid but dangerous. Consider splitting into two methods ( Automated review by Kimi (Moonshot AI) · kimi-k2.5 · custom prompt |
🤖 Codex Code ReviewFindings
No other findings in this small diff. Automated review by OpenAI Codex · gpt-5.4 · custom prompt |
🤖 Claude Code ReviewNow I have enough context for a thorough review. PR Review:
|
| Area | Assessment |
|---|---|
| Correctness | Mostly sound; receipts_root from header is trusted. Logs not covered by state root validation — minor gap. |
| Security | Acceptable for full sync with verified headers; removes one validation layer. |
| API design | bool flag is a code smell — prefer an enum. |
| Test coverage | No automated tests added. |
| Blast radius | Limited by private function visibility. |
Recommendation: Address the bool → enum refactor before merging; it's a small change that significantly improves readability and safety. A doc comment at the call site explaining the trust model would also be valuable. Consider whether a test covering the skip=false path catching mismatches is feasible to add.
Automated review by Claude (Anthropic) · sonnet · custom prompt
Lines of code reportTotal lines added: Detailed view |
Summary
skip_receipt_validationparameter toexecute_block_from_state()validate_receipts_root()only in theadd_blocks_in_batch()path (full sync)Closes #6482
Test plan
FULL_SYNC_BLOCK_LIMIT=50000and verify it completes without errors