alloy-rs / op-alloy

Apache License 2.0
34 stars 26 forks source link

[Bug] OP fields missing from `op_alloy_rpc_types::OpTransactionReceipt` #54

Closed emhane closed 1 month ago

emhane commented 1 month ago

Component

consensus, eips, genesis, rpc

Describe the feature you would like

To add OP fields, either make new variants of OpReceiptEnvelope, e.g. OpReceiptEnvelope::Ecotone type OpEcotoneReceipt for blob fields, or re-define type OpTransactionReceipt. Implement decoding of OpTransactionReceipt with OP fields. Adding directly to OpTransactionReceipt may make sense for some op fields, for others not.

Ref https://github.com/ethereum-optimism/op-geth/blob/f2e69450c6eec9c35d56af91389a1c47737206ca/core/types/receipt.go#L87-L87

Additional context

Deposit tx envelope has fields for deposit nonce, and so does OptimismTransactionReceiptFields, so OptimismTransactionReceiptFields cannot be added to OpTransactionReceipt as is.

emhane commented 1 month ago

cannot make new variant OpReceiptEnvelope::Ecotone due to same tx type as eip4844 (ty = 3). hence, must change type wrapped in OpReceiptEnvelope::Eip4844, but leave fields as option to allow for eip4844 and ecotone receipts for tx type 3.

https://github.com/alloy-rs/op-alloy/blob/f9514d5914abc6d2f4979db59d6081a60e8adfc7/crates/consensus/src/receipt/envelope.rs#L241

emhane commented 1 month ago

good call @refcell