diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-08-23 19:39:37 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-23 19:39:37 +0800 |
commit | 3c48a25762dfab9382791c33a2f5832466077ac3 (patch) | |
tree | 648c275563b46ba45e289774a40a0a761d16fc66 /core/vm | |
parent | 286ec5df40d3707a7a2c98d49c8d324372ed29c2 (diff) | |
parent | 4ee92f2d193225e70c190194d005a6ce80e70236 (diff) | |
download | go-tangerine-3c48a25762dfab9382791c33a2f5832466077ac3.tar go-tangerine-3c48a25762dfab9382791c33a2f5832466077ac3.tar.gz go-tangerine-3c48a25762dfab9382791c33a2f5832466077ac3.tar.bz2 go-tangerine-3c48a25762dfab9382791c33a2f5832466077ac3.tar.lz go-tangerine-3c48a25762dfab9382791c33a2f5832466077ac3.tar.xz go-tangerine-3c48a25762dfab9382791c33a2f5832466077ac3.tar.zst go-tangerine-3c48a25762dfab9382791c33a2f5832466077ac3.zip |
Merge pull request #15014 from rjl493456442/metropolis-eip658
core: add status as a consensus field in receipt
Diffstat (limited to 'core/vm')
-rw-r--r-- | core/vm/evm.go | 6 | ||||
-rw-r--r-- | core/vm/instructions.go | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/core/vm/evm.go b/core/vm/evm.go index 8d654c666..34933a1dc 100644 --- a/core/vm/evm.go +++ b/core/vm/evm.go @@ -158,7 +158,7 @@ func (evm *EVM) Call(caller ContractRef, addr common.Address, input []byte, gas evm.Transfer(evm.StateDB, caller.Address(), to.Address(), value) // initialise a new contract and set the code that is to be used by the - // E The contract is a scoped evmironment for this execution context + // E The contract is a scoped environment for this execution context // only. contract := NewContract(caller, to, value, gas) contract.SetCallCode(&addr, evm.StateDB.GetCodeHash(addr), evm.StateDB.GetCode(addr)) @@ -351,6 +351,10 @@ func (evm *EVM) Create(caller ContractRef, code []byte, gas uint64, value *big.I contract.UseGas(contract.Gas) } } + // Assign err if contract code size exceeds the max while the err is still empty. + if maxCodeSizeExceeded && err == nil { + err = errMaxCodeSizeExceeded + } return ret, contractAddr, contract.Gas, err } diff --git a/core/vm/instructions.go b/core/vm/instructions.go index ece4d2229..b6d6e22c4 100644 --- a/core/vm/instructions.go +++ b/core/vm/instructions.go @@ -33,6 +33,7 @@ var ( errWriteProtection = errors.New("evm: write protection") errReturnDataOutOfBounds = errors.New("evm: return data out of bounds") errExecutionReverted = errors.New("evm: execution reverted") + errMaxCodeSizeExceeded = errors.New("evm: max code size exceeded") ) func opAdd(pc *uint64, evm *EVM, contract *Contract, memory *Memory, stack *Stack) ([]byte, error) { @@ -619,7 +620,6 @@ func opCall(pc *uint64, evm *EVM, contract *Contract, memory *Memory, stack *Sta if value.Sign() != 0 { gas += params.CallStipend } - ret, returnGas, err := evm.Call(contract, address, args, gas, value) if err != nil { stack.push(new(big.Int)) |