Skip to content
This repository was archived by the owner on Dec 23, 2024. It is now read-only.

Commit 1efd12f

Browse files
authored
core: fix calculation of blob gasprice in tx receipt (#28082)
This fixes the derived value BlobGasPrice on the receipt of EIP-4844 transactions, which was previously erroneously set to the price cap.
1 parent 5cf53f5 commit 1efd12f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

core/state_processor.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424
"github.com/ethereum/go-ethereum/common"
2525
"github.com/ethereum/go-ethereum/consensus"
2626
"github.com/ethereum/go-ethereum/consensus/misc"
27+
"github.com/ethereum/go-ethereum/consensus/misc/eip4844"
2728
"github.com/ethereum/go-ethereum/core/state"
2829
"github.com/ethereum/go-ethereum/core/types"
2930
"github.com/ethereum/go-ethereum/core/vm"
@@ -135,8 +136,10 @@ func applyTransaction(msg *Message, config *params.ChainConfig, gp *GasPool, sta
135136
receipt.TxHash = tx.Hash()
136137
receipt.GasUsed = result.UsedGas
137138

138-
receipt.BlobGasUsed = uint64(len(tx.BlobHashes()) * params.BlobTxBlobGasPerBlob)
139-
receipt.BlobGasPrice = tx.BlobGasFeeCap()
139+
if tx.Type() == types.BlobTxType {
140+
receipt.BlobGasUsed = uint64(len(tx.BlobHashes()) * params.BlobTxBlobGasPerBlob)
141+
receipt.BlobGasPrice = eip4844.CalcBlobFee(*evm.Context.ExcessBlobGas)
142+
}
140143

141144
// If the transaction created a contract, store the creation address in the receipt.
142145
if msg.To == nil {

0 commit comments

Comments
 (0)