Add enough blob gas for block building (EIP-4844) (#8001)

This commit is contained in:
Andrew Ashikhmin 2023-08-11 16:09:03 +02:00 committed by GitHub
parent 03927d3e27
commit f854a73185
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -331,7 +331,7 @@ func (rw *ReconWorker) runTxTask(txTask *exec22.TxTask) error {
rw.engine.Initialize(rw.chainConfig, rw.chain, txTask.Header, ibs, syscall)
} else {
gp := new(core.GasPool).AddGas(txTask.Tx.GetGas())
gp := new(core.GasPool).AddGas(txTask.Tx.GetGas()).AddBlobGas(txTask.Tx.GetBlobGas())
vmConfig := vm.Config{NoReceipts: true, SkipAnalysis: txTask.SkipAnalysis}
ibs.SetTxContext(txTask.Tx.Hash(), txTask.BlockHash, txTask.TxIndex)
msg := txTask.TxAsMessage

View File

@ -367,6 +367,9 @@ func addTransactionsToMiningBlock(logPrefix string, current *MiningBlock, chainC
header := current.Header
tcount := 0
gasPool := new(core.GasPool).AddGas(header.GasLimit - header.GasUsed)
if header.BlobGasUsed != nil {
gasPool.AddBlobGas(fixedgas.MaxBlobGasPerBlock - *header.BlobGasUsed)
}
signer := types.MakeSigner(&chainConfig, header.Number.Uint64(), header.Time)
var coalescedLogs types.Logs