From 073bb183da446849cf223a68bd02c48cf938ee16 Mon Sep 17 00:00:00 2001 From: Arpit Temani Date: Fri, 10 Nov 2023 14:22:14 +0530 Subject: [PATCH] make blobgas nil --- cmd/evm/internal/t8ntool/execution.go | 16 ++-------------- core/blockchain.go | 3 +-- core/genesis.go | 4 ++-- core/rawdb/accessors_chain.go | 3 +-- core/types/block.go | 4 ++-- 5 files changed, 8 insertions(+), 22 deletions(-) diff --git a/cmd/evm/internal/t8ntool/execution.go b/cmd/evm/internal/t8ntool/execution.go index 518f2da564..245f6a46bf 100644 --- a/cmd/evm/internal/t8ntool/execution.go +++ b/cmd/evm/internal/t8ntool/execution.go @@ -24,7 +24,6 @@ import ( "github.com/ethereum/go-ethereum/common/math" "github.com/ethereum/go-ethereum/consensus/ethash" "github.com/ethereum/go-ethereum/consensus/misc" - "github.com/ethereum/go-ethereum/consensus/misc/eip4844" "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core/rawdb" "github.com/ethereum/go-ethereum/core/state" @@ -167,19 +166,8 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig, rnd := common.BigToHash(pre.Env.Random) vmContext.Random = &rnd } - // If excessBlobGas is defined, add it to the vmContext. - if pre.Env.ExcessBlobGas != nil { - vmContext.ExcessBlobGas = pre.Env.ExcessBlobGas - } else { - // If it is not explicitly defined, but we have the parent values, we try - // to calculate it ourselves. - parentExcessBlobGas := pre.Env.ParentExcessBlobGas - parentBlobGasUsed := pre.Env.ParentBlobGasUsed - if parentExcessBlobGas != nil && parentBlobGasUsed != nil { - excessBlobGas := eip4844.CalcExcessBlobGas(*parentExcessBlobGas, *parentBlobGasUsed) - vmContext.ExcessBlobGas = &excessBlobGas - } - } + + vmContext.ExcessBlobGas = nil // If DAO is supported/enabled, we need to handle it here. In geth 'proper', it's // done in StateProcessor.Process(block, ...), right before transactions are applied. if chainConfig.DAOForkSupport && diff --git a/core/blockchain.go b/core/blockchain.go index 3f77ef9d4b..36d5635065 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -43,7 +43,6 @@ import ( "github.com/ethereum/go-ethereum/common/prque" "github.com/ethereum/go-ethereum/common/tracing" "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/consensus/misc/eip4844" "github.com/ethereum/go-ethereum/core/blockstm" "github.com/ethereum/go-ethereum/core/rawdb" "github.com/ethereum/go-ethereum/core/state" @@ -2525,7 +2524,7 @@ func (bc *BlockChain) collectLogs(b *types.Block, removed bool) []*types.Log { var blobGasPrice *big.Int excessBlobGas := b.ExcessBlobGas() if excessBlobGas != nil { - blobGasPrice = eip4844.CalcBlobFee(*excessBlobGas) + blobGasPrice = nil } receipts := rawdb.ReadRawReceipts(bc.db, b.Hash(), b.NumberU64()) diff --git a/core/genesis.go b/core/genesis.go index 06da410bf7..f3409bbbff 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -534,10 +534,10 @@ func (g *Genesis) ToBlock() *types.Block { head.ExcessBlobGas = g.ExcessBlobGas head.BlobGasUsed = g.BlobGasUsed if head.ExcessBlobGas == nil { - head.ExcessBlobGas = new(uint64) + head.ExcessBlobGas = nil } if head.BlobGasUsed == nil { - head.BlobGasUsed = new(uint64) + head.BlobGasUsed = nil } } } diff --git a/core/rawdb/accessors_chain.go b/core/rawdb/accessors_chain.go index 50f418471b..ee81d02d78 100644 --- a/core/rawdb/accessors_chain.go +++ b/core/rawdb/accessors_chain.go @@ -24,7 +24,6 @@ import ( "math/big" "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/misc/eip4844" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/ethdb" @@ -717,7 +716,7 @@ func ReadReceipts(db ethdb.Reader, hash common.Hash, number uint64, time uint64, // Compute effective blob gas price. var blobGasPrice *big.Int if header != nil && header.ExcessBlobGas != nil { - blobGasPrice = eip4844.CalcBlobFee(*header.ExcessBlobGas) + blobGasPrice = nil } if err := receipts.DeriveFields(config, hash, number, time, baseFee, blobGasPrice, body.Transactions); err != nil { log.Error("Failed to derive block receipts fields", "hash", hash, "number", number, "err", err) diff --git a/core/types/block.go b/core/types/block.go index b3b8eea59d..1ffaea554c 100644 --- a/core/types/block.go +++ b/core/types/block.go @@ -489,7 +489,7 @@ func (b *Block) ExcessBlobGas() *uint64 { excessBlobGas = new(uint64) *excessBlobGas = *b.header.ExcessBlobGas } - return excessBlobGas + return nil } func (b *Block) BlobGasUsed() *uint64 { @@ -498,7 +498,7 @@ func (b *Block) BlobGasUsed() *uint64 { blobGasUsed = new(uint64) *blobGasUsed = *b.header.BlobGasUsed } - return blobGasUsed + return nil } // Size returns the true RLP encoded storage size of the block, either by encoding