fix: decode payload transactions with EIP-2718 exact format#219
fix: decode payload transactions with EIP-2718 exact format#219
Conversation
Engine API specifies transactions as opaque EIP-2718 encoded bytes, not devp2p wire format. Using network_decode here could silently drop typed transactions (EIP-1559, EIP-2930, EvNode 0x76/0x78) whose bytes are valid EIP-2718 but lack the wire-format RLP string wrapping. The executor already uses decode_2718_exact when validating the same transactions via ExecutionData. This aligns the payload builder with executor semantics, closing a potential consensus mismatch where build-time acceptance diverges from validation-time rules.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA method call in the payload service was updated from Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
|
Claude finished @randygrok's task —— View job Pull Request ReviewTodo List:
Review SummaryThis is a well-executed fix that addresses a critical consensus vulnerability in the Engine API payload builder. The change is minimal, targeted, and aligns with existing validation logic. ✅ Code Quality & Best PracticesExcellent alignment with existing patterns:
✅ Critical Bug FixResolves consensus divergence:
✅ Performance ConsiderationsPositive performance impact:
✅ Security ConsiderationsStrengthens consensus security:
✅ Test CoverageExisting test provides good coverage:
Recommendation: Consider adding a specific test case with valid EIP-1559/EIP-2930 transactions to verify they are no longer dropped. Minor Observations
ConclusionThis is a high-quality fix that resolves a significant consensus issue with minimal code change. The alignment with executor logic and existing test coverage provide confidence in the change. Recommendation: ✅ Approve and merge |
Summary
TransactionSigned::network_decodewithTransactionSigned::decode_2718_exactin the Engine API payload builder pathdecode_2718_exactwhen processingExecutionDataBackground
Engine API (
engine_newPayload*) specifies transactions as opaque EIP-2718 encoded bytes. The previousnetwork_decodeexpects the devp2p wire format, which wraps typed transactions in an RLP string header (length prefix + opaque payload). On EIP-2718 bytes, this wrapping is absent — so typed transactions (EIP-1559, EIP-2930, and the EvNode types0x76/0x78) were silently dropped by thefilter_map, logging a warning and continuing to build without them.The executor uses
TxTy::<EvPrimitives>::decode_2718_exactwhen processing the same transactions viaExecutionData(crates/node/src/executor.rs:387). Build-time acceptance must match validation-time acceptance to avoid consensus divergence.Addresses the CodeRabbit review comment on #207.
Summary by CodeRabbit