Improve the application of EIP150 for create2

When EIP150 is enabled, gas constraints on sub contracts are only applied. This fix is to ensure consistency with create and to correctly interpret EIP150
This commit is contained in:
xiyang 2024-04-02 10:40:38 +08:00 committed by GitHub
parent 8c5576b1ac
commit fd37a18347
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -628,7 +628,9 @@ func opCreate2(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]
gas = scope.Contract.Gas gas = scope.Contract.Gas
) )
// Apply EIP150 // Apply EIP150
gas -= gas / 64 if interpreter.evm.chainRules.IsEIP150 {
gas -= gas / 64
}
scope.Contract.UseGas(gas, interpreter.evm.Config.Tracer, tracing.GasChangeCallContractCreation2) scope.Contract.UseGas(gas, interpreter.evm.Config.Tracer, tracing.GasChangeCallContractCreation2)
// reuse size int for stackvalue // reuse size int for stackvalue
stackvalue := size stackvalue := size