From f68e28b529ce6f3d4943c7bf90ae6997ca86a464 Mon Sep 17 00:00:00 2001 From: devopsbo3 <69951731+devopsbo3@users.noreply.github.com> Date: Fri, 10 Nov 2023 12:27:53 -0600 Subject: [PATCH] Revert "core/types: fix receipt blob fields marshaling (#27793)" This reverts commit ac8154a2486b6f1ce4e7c9f36849f57781daa48c. --- core/types/gen_receipt_json.go | 16 ++++++++-------- core/types/receipt.go | 2 -- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/core/types/gen_receipt_json.go b/core/types/gen_receipt_json.go index 4c641a972795f..a2eca9bbc10d5 100644 --- a/core/types/gen_receipt_json.go +++ b/core/types/gen_receipt_json.go @@ -26,8 +26,8 @@ func (r Receipt) MarshalJSON() ([]byte, error) { ContractAddress common.Address `json:"contractAddress"` GasUsed hexutil.Uint64 `json:"gasUsed" gencodec:"required"` EffectiveGasPrice *hexutil.Big `json:"effectiveGasPrice"` - BlobGasUsed hexutil.Uint64 `json:"blobGasUsed,omitempty"` - BlobGasPrice *hexutil.Big `json:"blobGasPrice,omitempty"` + BlobGasUsed uint64 `json:"blobGasUsed,omitempty"` + BlobGasPrice *big.Int `json:"blobGasPrice,omitempty"` BlockHash common.Hash `json:"blockHash,omitempty"` BlockNumber *hexutil.Big `json:"blockNumber,omitempty"` TransactionIndex hexutil.Uint `json:"transactionIndex"` @@ -43,8 +43,8 @@ func (r Receipt) MarshalJSON() ([]byte, error) { enc.ContractAddress = r.ContractAddress enc.GasUsed = hexutil.Uint64(r.GasUsed) enc.EffectiveGasPrice = (*hexutil.Big)(r.EffectiveGasPrice) - enc.BlobGasUsed = hexutil.Uint64(r.BlobGasUsed) - enc.BlobGasPrice = (*hexutil.Big)(r.BlobGasPrice) + enc.BlobGasUsed = r.BlobGasUsed + enc.BlobGasPrice = r.BlobGasPrice enc.BlockHash = r.BlockHash enc.BlockNumber = (*hexutil.Big)(r.BlockNumber) enc.TransactionIndex = hexutil.Uint(r.TransactionIndex) @@ -64,8 +64,8 @@ func (r *Receipt) UnmarshalJSON(input []byte) error { ContractAddress *common.Address `json:"contractAddress"` GasUsed *hexutil.Uint64 `json:"gasUsed" gencodec:"required"` EffectiveGasPrice *hexutil.Big `json:"effectiveGasPrice"` - BlobGasUsed *hexutil.Uint64 `json:"blobGasUsed,omitempty"` - BlobGasPrice *hexutil.Big `json:"blobGasPrice,omitempty"` + BlobGasUsed *uint64 `json:"blobGasUsed,omitempty"` + BlobGasPrice *big.Int `json:"blobGasPrice,omitempty"` BlockHash *common.Hash `json:"blockHash,omitempty"` BlockNumber *hexutil.Big `json:"blockNumber,omitempty"` TransactionIndex *hexutil.Uint `json:"transactionIndex"` @@ -110,10 +110,10 @@ func (r *Receipt) UnmarshalJSON(input []byte) error { r.EffectiveGasPrice = (*big.Int)(dec.EffectiveGasPrice) } if dec.BlobGasUsed != nil { - r.BlobGasUsed = uint64(*dec.BlobGasUsed) + r.BlobGasUsed = *dec.BlobGasUsed } if dec.BlobGasPrice != nil { - r.BlobGasPrice = (*big.Int)(dec.BlobGasPrice) + r.BlobGasPrice = dec.BlobGasPrice } if dec.BlockHash != nil { r.BlockHash = *dec.BlockHash diff --git a/core/types/receipt.go b/core/types/receipt.go index a96eb6b8d603b..831a07bf1d4c5 100644 --- a/core/types/receipt.go +++ b/core/types/receipt.go @@ -80,8 +80,6 @@ type receiptMarshaling struct { CumulativeGasUsed hexutil.Uint64 GasUsed hexutil.Uint64 EffectiveGasPrice *hexutil.Big - BlobGasUsed hexutil.Uint64 - BlobGasPrice *hexutil.Big BlockNumber *hexutil.Big TransactionIndex hexutil.Uint }