Skip to content

Conversation

@Himess
Copy link
Contributor

@Himess Himess commented Jan 10, 2026

Summary

Introduces UnifiedReceiptBuilder - a wrapper that handles both deposit and non-deposit transaction receipts seamlessly, eliminating the try-catch pattern required by OpReceiptBuilder.

Changes

  • Added receipt_builder.rs with UnifiedReceiptBuilder<C> struct
  • Single build() method handles both tx types internally
  • Simplified state_builder.rs - removed ~40 lines of manual deposit handling
  • Removed unused alloy-op-evm dependency

Closes #309

@cb-heimdall
Copy link
Collaborator

cb-heimdall commented Jan 10, 2026

✅ Heimdall Review Status

Requirement Status More Info
Reviews 1/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@Himess Himess marked this pull request as draft January 10, 2026 21:58
@Himess Himess marked this pull request as ready for review January 10, 2026 22:53
Copy link
Contributor

@refcell refcell left a 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

@Himess
Copy link
Contributor Author

Himess commented Jan 12, 2026

@refcell Ready to review

@Himess Himess requested a review from refcell January 12, 2026 10:53
Copy link
Contributor

@refcell refcell left a 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

@refcell refcell requested a review from meyer9 January 12, 2026 15:10
Copy link
Contributor

@meyer9 meyer9 left a 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!

@danyalprout danyalprout added this to the v0.4.0 milestone Jan 12, 2026
Himess and others added 9 commits January 13, 2026 17:09
…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)
@Himess Himess force-pushed the feat/unified-receipt-builder branch from 090c618 to a24dbfe Compare January 13, 2026 14:28
@Himess
Copy link
Contributor Author

Himess commented Jan 13, 2026

@refcell I think it's ready now

@Himess Himess requested a review from refcell January 13, 2026 18:50
@Himess
Copy link
Contributor Author

Himess commented Jan 13, 2026

Fixed formatting issues.

@Himess Himess marked this pull request as draft January 13, 2026 19:59
@Himess Himess marked this pull request as ready for review January 13, 2026 20:02
Copy link
Contributor

@refcell refcell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM

@refcell refcell added this pull request to the merge queue Jan 14, 2026
Merged via the queue into base:main with commit ab40b94 Jan 14, 2026
15 checks passed
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.

Create a new ReceiptBuilder builds deposit receipts

5 participants