Skip to content

Commit

Permalink
all: fix review comments
Browse files Browse the repository at this point in the history
Co-authored-by: lightclient <[email protected]>
Co-authored-by: Marius van der Wijden <[email protected]>
  • Loading branch information
lightclient and MariusVanDerWijden committed Jan 10, 2025
1 parent 23ba4bf commit 45409ae
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/evm/internal/t8ntool/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
txBlobGas := uint64(0)
if tx.Type() == types.BlobTxType {
txBlobGas = uint64(params.BlobTxBlobGasPerBlob * len(tx.BlobHashes()))
if used, max := uint64(len(tx.BlobHashes())+1), chainConfig.MaxBlobsPerBlock(pre.Env.Number); used > max {
if used, max := blobGasUsed+txBlobGas, chainConfig.MaxBlobsPerBlock(pre.Env.Number)*params.BlobTxBlobGasPerBlob; used > max {
err := fmt.Errorf("blob gas (%d) would exceed maximum allowance %d", used, max)
log.Warn("rejected tx", "index", i, "err", err)
rejectedTxs = append(rejectedTxs, &rejectedTx{i, err.Error()})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"target": 3,
"max": 6
},
"prauge": {
"prague": {
"target": 3,
"max": 6
}
Expand Down
4 changes: 2 additions & 2 deletions miner/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,8 @@ func (miner *Miner) commitTransactions(env *environment, plainTxs, blobTxs *tran
// blobs or not, however the max check panics when called on a chain without
// a defined schedule, so we need to verify it's safe to call.
if miner.chainConfig.IsCancun(env.header.Number, env.header.Time) {
if left := miner.chainConfig.MaxBlobsPerBlock(env.header.Time) - uint64(env.blobs); left < ltx.BlobGas {
log.Trace("Not enough blob space left for transaction", "hash", ltx.Hash, "left", left, "needed", ltx.BlobGas)
if left := int(miner.chainConfig.MaxBlobsPerBlock(env.header.Time)) - env.blobs; left < len(ltx.Tx.BlobHashes()) {
log.Trace("Not enough blob space left for transaction", "hash", ltx.Hash, "left", left, "needed", len(ltx.Tx.BlobHashes()))
txs.Pop()
continue
}
Expand Down

0 comments on commit 45409ae

Please sign in to comment.