@@ -140,6 +140,7 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
140
140
rejectedTxs []* rejectedTx
141
141
includedTxs types.Transactions
142
142
gasUsed = uint64 (0 )
143
+ blobGasUsed = uint64 (0 )
143
144
receipts = make (types.Receipts , 0 )
144
145
txIndex = 0
145
146
)
@@ -189,7 +190,6 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
189
190
evm := vm .NewEVM (vmContext , vm.TxContext {}, statedb , chainConfig , vmConfig )
190
191
core .ProcessBeaconBlockRoot (* beaconRoot , evm , statedb )
191
192
}
192
- var blobGasUsed uint64
193
193
194
194
for i := 0 ; txIt .Next (); i ++ {
195
195
tx , err := txIt .Tx ()
@@ -210,15 +210,15 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
210
210
rejectedTxs = append (rejectedTxs , & rejectedTx {i , err .Error ()})
211
211
continue
212
212
}
213
+ txBlobGas := uint64 (0 )
213
214
if tx .Type () == types .BlobTxType {
214
- txBlobGas : = uint64 (params .BlobTxBlobGasPerBlob * len (tx .BlobHashes ()))
215
+ txBlobGas = uint64 (params .BlobTxBlobGasPerBlob * len (tx .BlobHashes ()))
215
216
if used , max := blobGasUsed + txBlobGas , uint64 (params .MaxBlobGasPerBlock ); used > max {
216
217
err := fmt .Errorf ("blob gas (%d) would exceed maximum allowance %d" , used , max )
217
218
log .Warn ("rejected tx" , "index" , i , "err" , err )
218
219
rejectedTxs = append (rejectedTxs , & rejectedTx {i , err .Error ()})
219
220
continue
220
221
}
221
- blobGasUsed += txBlobGas
222
222
}
223
223
tracer , err := getTracerFn (txIndex , tx .Hash ())
224
224
if err != nil {
@@ -247,6 +247,7 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
247
247
if hashError != nil {
248
248
return nil , nil , nil , NewError (ErrorMissingBlockhash , hashError )
249
249
}
250
+ blobGasUsed += txBlobGas
250
251
gasUsed += msgResult .UsedGas
251
252
252
253
// Receipt:
0 commit comments