all: rename dataGas to blobGas (#27789)

This commit is contained in:
Péter Szilágyi
2023-07-27 16:53:28 +03:00
committed by GitHub
parent 0f4b21feac
commit 57268f7e6c
32 changed files with 224 additions and 225 deletions
+1 -1
View File
@@ -450,7 +450,7 @@ func (api *ConsensusAPI) NewPayloadV3(params engine.ExecutableData, versionedHas
return engine.PayloadStatusV1{Status: engine.INVALID}, engine.InvalidParams.With(errors.New("newPayloadV3 called pre-cancun"))
}
if params.ExcessDataGas == nil {
if params.ExcessBlobGas == nil {
return engine.PayloadStatusV1{Status: engine.INVALID}, engine.InvalidParams.With(fmt.Errorf("nil excessDataGas post-cancun"))
}
var hashes []common.Hash
+3 -3
View File
@@ -801,7 +801,7 @@ func (q *queue) DeliverBodies(id string, txLists [][]*types.Transaction, txListH
// and zero before the Cancun hardfork
var blobs int
for _, tx := range txLists[index] {
// Count the number of blobs to validate against the header's dataGasUsed
// Count the number of blobs to validate against the header's blobGasUsed
blobs += len(tx.BlobHashes())
// Validate the data blobs individually too
@@ -816,8 +816,8 @@ func (q *queue) DeliverBodies(id string, txLists [][]*types.Transaction, txListH
}
}
}
if header.DataGasUsed != nil {
if want := *header.DataGasUsed / params.BlobTxDataGasPerBlob; uint64(blobs) != want { // div because the header is surely good vs the body might be bloated
if header.BlobGasUsed != nil {
if want := *header.BlobGasUsed / params.BlobTxBlobGasPerBlob; uint64(blobs) != want { // div because the header is surely good vs the body might be bloated
return errInvalidBody
}
} else {