Skip to content

Commit

Permalink
ethapi: Set post Ecotone receipt fields (#314)
Browse files Browse the repository at this point in the history
  • Loading branch information
trianglesphere authored May 10, 2024
1 parent ef178f2 commit 3653ceb
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion internal/ethapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -1910,9 +1910,20 @@ func marshalReceipt(receipt *types.Receipt, blockHash common.Hash, blockNumber u
fields["l1GasPrice"] = (*hexutil.Big)(receipt.L1GasPrice)
fields["l1GasUsed"] = (*hexutil.Big)(receipt.L1GasUsed)
fields["l1Fee"] = (*hexutil.Big)(receipt.L1Fee)
if receipt.FeeScalar != nil { // removed in Ecotone
// Fields removed with Ecotone
if receipt.FeeScalar != nil {
fields["l1FeeScalar"] = receipt.FeeScalar.String()
}
// Fields added in Ecotone
if receipt.L1BlobBaseFee != nil {
fields["l1BlobBaseFee"] = (*hexutil.Big)(receipt.L1BlobBaseFee)
}
if receipt.L1BaseFeeScalar != nil {
fields["l1BaseFeeScalar"] = hexutil.Uint64(*receipt.L1BaseFeeScalar)
}
if receipt.L1BlobBaseFeeScalar != nil {
fields["l1BlobBaseFeeScalar"] = hexutil.Uint64(*receipt.L1BlobBaseFeeScalar)
}
}
if chainConfig.Optimism != nil && tx.IsDepositTx() && receipt.DepositNonce != nil {
fields["depositNonce"] = hexutil.Uint64(*receipt.DepositNonce)
Expand Down

0 comments on commit 3653ceb

Please sign in to comment.