mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
tests: verify blob gas used
This commit is contained in:
parent
f9e7361d20
commit
b774a00b3e
1 changed files with 11 additions and 0 deletions
|
|
@ -291,6 +291,17 @@ func (t *StateTest) RunNoVerify(subtest StateSubtest, vmconfig vm.Config, snapsh
|
|||
}
|
||||
evm := vm.NewEVM(context, txContext, statedb, config, vmconfig)
|
||||
|
||||
{ // Blob transactions may be present after the Cancun fork.
|
||||
// In production,
|
||||
// - the header is verified against the max in eip4844.go:VerifyEIP4844Header
|
||||
// - the block body is verified against the header in block_validator.go:ValidateBody
|
||||
// Here, we just do this shortcut smaller fix, since state tests do not
|
||||
// utilize those codepaths
|
||||
if len(msg.BlobHashes)*params.BlobTxBlobGasPerBlob > params.MaxBlobGasPerBlock {
|
||||
return nil, nil, nil, common.Hash{}, errors.New("blob gas exceeds maximum")
|
||||
}
|
||||
}
|
||||
|
||||
// Execute the message.
|
||||
snapshot := statedb.Snapshot()
|
||||
gaspool := new(core.GasPool)
|
||||
|
|
|
|||
Loading…
Reference in a new issue