@@ -86,15 +86,16 @@ type Receipt struct {
8686 TransactionIndex uint `json:"transactionIndex"`
8787
8888 // Optimism: extend receipts with L1 and operator fee info
89- L1GasPrice * big.Int `json:"l1GasPrice,omitempty"` // Present from pre-bedrock. L1 Basefee after Bedrock
90- L1BlobBaseFee * big.Int `json:"l1BlobBaseFee,omitempty"` // Always nil prior to the Ecotone hardfork
91- L1GasUsed * big.Int `json:"l1GasUsed,omitempty"` // Present from pre-bedrock, deprecated as of Fjord
92- L1Fee * big.Int `json:"l1Fee,omitempty"` // Present from pre-bedrock
93- FeeScalar * big.Float `json:"l1FeeScalar,omitempty"` // Present from pre-bedrock to Ecotone. Nil after Ecotone
94- L1BaseFeeScalar * uint64 `json:"l1BaseFeeScalar,omitempty"` // Always nil prior to the Ecotone hardfork
95- L1BlobBaseFeeScalar * uint64 `json:"l1BlobBaseFeeScalar,omitempty"` // Always nil prior to the Ecotone hardfork
96- OperatorFeeScalar * uint64 `json:"operatorFeeScalar,omitempty"` // Always nil prior to the Isthmus hardfork
97- OperatorFeeConstant * uint64 `json:"operatorFeeConstant,omitempty"` // Always nil prior to the Isthmus hardfork
89+ L1GasPrice * big.Int `json:"l1GasPrice,omitempty"` // Present from pre-bedrock. L1 Basefee after Bedrock
90+ L1BlobBaseFee * big.Int `json:"l1BlobBaseFee,omitempty"` // Always nil prior to the Ecotone hardfork
91+ L1GasUsed * big.Int `json:"l1GasUsed,omitempty"` // Present from pre-bedrock, deprecated as of Fjord
92+ L1Fee * big.Int `json:"l1Fee,omitempty"` // Present from pre-bedrock
93+ FeeScalar * big.Float `json:"l1FeeScalar,omitempty"` // Present from pre-bedrock to Ecotone. Nil after Ecotone
94+ L1BaseFeeScalar * uint64 `json:"l1BaseFeeScalar,omitempty"` // Always nil prior to the Ecotone hardfork
95+ L1BlobBaseFeeScalar * uint64 `json:"l1BlobBaseFeeScalar,omitempty"` // Always nil prior to the Ecotone hardfork
96+ OperatorFeeScalar * uint64 `json:"operatorFeeScalar,omitempty"` // Always nil prior to the Isthmus hardfork
97+ OperatorFeeConstant * uint64 `json:"operatorFeeConstant,omitempty"` // Always nil prior to the Isthmus hardfork
98+ DAFootprintGasScalar * uint64 `json:"daFootprintGasScalar,omitempty"` // Always nil prior to the Jovian hardfork
9899}
99100
100101type receiptMarshaling struct {
@@ -121,6 +122,7 @@ type receiptMarshaling struct {
121122 DepositReceiptVersion * hexutil.Uint64
122123 OperatorFeeScalar * hexutil.Uint64
123124 OperatorFeeConstant * hexutil.Uint64
125+ DAFootprintGasScalar * hexutil.Uint64
124126}
125127
126128// receiptRLP is the consensus encoding of a receipt.
@@ -612,26 +614,8 @@ func (rs Receipts) DeriveFields(config *params.ChainConfig, blockHash common.Has
612614 logIndex += uint (len (rs [i ].Logs ))
613615 }
614616
615- if config .Optimism != nil && len (txs ) >= 2 && config .IsBedrock (new (big.Int ).SetUint64 (blockNumber )) {
616- gasParams , err := extractL1GasParams (config , blockTime , txs [0 ].Data ())
617- if err != nil {
618- return err
619- }
620- for i := 0 ; i < len (rs ); i ++ {
621- if txs [i ].IsDepositTx () {
622- continue
623- }
624- rs [i ].L1GasPrice = gasParams .l1BaseFee
625- rs [i ].L1BlobBaseFee = gasParams .l1BlobBaseFee
626- rs [i ].L1Fee , rs [i ].L1GasUsed = gasParams .costFunc (txs [i ].RollupCostData ())
627- rs [i ].FeeScalar = gasParams .feeScalar
628- rs [i ].L1BaseFeeScalar = u32ptrTou64ptr (gasParams .l1BaseFeeScalar )
629- rs [i ].L1BlobBaseFeeScalar = u32ptrTou64ptr (gasParams .l1BlobBaseFeeScalar )
630- if gasParams .operatorFeeScalar != nil && gasParams .operatorFeeConstant != nil && (* gasParams .operatorFeeScalar != 0 || * gasParams .operatorFeeConstant != 0 ) {
631- rs [i ].OperatorFeeScalar = u32ptrTou64ptr (gasParams .operatorFeeScalar )
632- rs [i ].OperatorFeeConstant = gasParams .operatorFeeConstant
633- }
634- }
617+ if config .IsOptimismBedrock (new (big.Int ).SetUint64 (blockNumber )) && len (txs ) >= 2 {
618+ return rs .deriveOPStackFields (config , blockTime , txs )
635619 }
636620 return nil
637621}
0 commit comments