mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
miner: improve comment about blob gas limit check
This commit is contained in:
parent
d3814eb23e
commit
2179c43eac
1 changed files with 6 additions and 1 deletions
|
|
@ -749,10 +749,15 @@ func (w *worker) commitTransaction(env *environment, tx *types.Transaction) ([]*
|
||||||
snap = env.state.Snapshot()
|
snap = env.state.Snapshot()
|
||||||
gp = env.gasPool.Gas()
|
gp = env.gasPool.Gas()
|
||||||
)
|
)
|
||||||
// TODO (MariusVanDerWijden): Move this check
|
|
||||||
|
// Checking against blob gas limit: It's kind of ugly to perform this check here, but there
|
||||||
|
// isn't really a better place right now. The blob gas limit is checked at block validation time
|
||||||
|
// and not during execution. This means core.ApplyTransaction will not return an error if the
|
||||||
|
// tx has too many blobs. So we have to explicitly check it here.
|
||||||
if (env.blobs+len(tx.BlobHashes()))*params.BlobTxBlobGasPerBlob > params.MaxBlobGasPerBlock {
|
if (env.blobs+len(tx.BlobHashes()))*params.BlobTxBlobGasPerBlob > params.MaxBlobGasPerBlock {
|
||||||
return nil, errors.New("max data blobs reached")
|
return nil, errors.New("max data blobs reached")
|
||||||
}
|
}
|
||||||
|
|
||||||
receipt, err := core.ApplyTransaction(w.chainConfig, w.chain, &env.coinbase, env.gasPool, env.state, env.header, tx, &env.header.GasUsed, *w.chain.GetVMConfig())
|
receipt, err := core.ApplyTransaction(w.chainConfig, w.chain, &env.coinbase, env.gasPool, env.state, env.header, tx, &env.header.GasUsed, *w.chain.GetVMConfig())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
env.state.RevertToSnapshot(snap)
|
env.state.RevertToSnapshot(snap)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue