-
Notifications
You must be signed in to change notification settings - Fork 110
feat(flashblocks): add UnifiedReceiptBuilder for seamless deposit receipt handling #345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
✅ Heimdall Review Status
|
refcell
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few changes + nits
|
@refcell Ready to review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much better. A couple of nits. Will add @meyer9 as a reviewer to get another pair of eyes since this addresses a ticket he wrote.
You'll also need to resolve conflicts with trunk
meyer9
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LG other than the comments @refcell left! Will let them approve once comments are addressed!
…eipt handling Add a new UnifiedReceiptBuilder that handles both deposit and non-deposit transactions seamlessly without requiring error handling at the call site. The builder wraps OpRethReceiptBuilder and automatically handles the deposit receipt case internally, eliminating the need for callers to implement the try-catch pattern typically required when using build_receipt followed by build_deposit_receipt. Changes: - Add receipt_builder module with UnifiedReceiptBuilder - Update PendingStateBuilder to use UnifiedReceiptBuilder - Simplify execute_with_evm method by removing manual deposit handling - Remove receipt_builder parameter from PendingStateBuilder::new() Closes base#309
Removed wrapper around OpRethReceiptBuilder and implemented direct receipt building logic. This fixes type mismatches between OpTxEnvelope and OpTransactionSigned that prevented compilation. - Use direct OpTxType matching instead of build_receipt/build_deposit_receipt pattern - Accept ExecutionResult<E::HaltReason> for proper generic type handling - Remove unused alloy-op-evm dependency
- Add From<ReceiptBuildError> for ExecutionError and StateProcessorError - Remove unused _state parameter from build() - Replace .unwrap() with proper error handling - Add comprehensive tests for receipt building logic
- Add EVM-based tests that directly test build() method - Test legacy receipt building - Test deposit receipt building - Test Canyon hardfork activation (deposit_receipt_version) - Test failed transaction receipt
- Use RpcReceiptBuild error variant in From<ReceiptBuildError> impl - Remove no-op tests (test_legacy_receipt_type, test_deposit_receipt_type, test_tx_type_to_receipt_mapping)
090c618 to
a24dbfe
Compare
|
@refcell I think it's ready now |
|
Fixed formatting issues. |
refcell
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM
Summary
Introduces
UnifiedReceiptBuilder- a wrapper that handles both deposit and non-deposit transaction receipts seamlessly, eliminating the try-catch pattern required byOpReceiptBuilder.Changes
receipt_builder.rswithUnifiedReceiptBuilder<C>structbuild()method handles both tx types internallystate_builder.rs- removed ~40 lines of manual deposit handlingalloy-op-evmdependencyCloses #309