From 9ad0ff960e135c182e6e423542589fe0e95f00ca Mon Sep 17 00:00:00 2001 From: arkpar Date: Wed, 19 Jul 2017 14:34:59 +0200 Subject: [PATCH] Place RETURNDATA behind block number gate --- ethcore/evm/src/interpreter/mod.rs | 1 + ethcore/evm/src/schedule.rs | 5 +++++ ethcore/res/ethereum/tests | 2 +- ethcore/src/spec/spec.rs | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ethcore/evm/src/interpreter/mod.rs b/ethcore/evm/src/interpreter/mod.rs index 885557dd3..30b431912 100644 --- a/ethcore/evm/src/interpreter/mod.rs +++ b/ethcore/evm/src/interpreter/mod.rs @@ -211,6 +211,7 @@ impl Interpreter { if (instruction == instructions::DELEGATECALL && !schedule.have_delegate_call) || (instruction == instructions::CREATE2 && !schedule.have_create2) || (instruction == instructions::STATICCALL && !schedule.have_static_call) || + ((instruction == instructions::RETURNDATACOPY || instruction == instructions::RETURNDATASIZE) && !schedule.have_return_data) || (instruction == instructions::REVERT && !schedule.have_revert) { return Err(evm::Error::BadInstruction { diff --git a/ethcore/evm/src/schedule.rs b/ethcore/evm/src/schedule.rs index a8dd09645..e721dc803 100644 --- a/ethcore/evm/src/schedule.rs +++ b/ethcore/evm/src/schedule.rs @@ -107,6 +107,8 @@ pub struct Schedule { pub blockhash_gas: usize, /// Static Call opcode enabled. pub have_static_call: bool, + /// RETURNDATA and RETURNDATASIZE opcodes enabled. + pub have_return_data: bool, /// Kill basic accounts below this balance if touched. pub kill_dust: CleanDustMode, } @@ -140,6 +142,7 @@ impl Schedule { have_delegate_call: true, have_create2: false, have_revert: false, + have_return_data: false, stack_limit: 1024, max_depth: 1024, tier_step_gas: [0, 2, 3, 5, 8, 10, 20, 0], @@ -190,6 +193,7 @@ impl Schedule { schedule.have_create2 = true; schedule.have_revert = true; schedule.have_static_call = true; + schedule.have_return_data = true; schedule.blockhash_gas = 350; schedule } @@ -200,6 +204,7 @@ impl Schedule { have_delegate_call: hdc, have_create2: false, have_revert: false, + have_return_data: false, stack_limit: 1024, max_depth: 1024, tier_step_gas: [0, 2, 3, 5, 8, 10, 20, 0], diff --git a/ethcore/res/ethereum/tests b/ethcore/res/ethereum/tests index 4e8b9be3f..ef191fdc6 160000 --- a/ethcore/res/ethereum/tests +++ b/ethcore/res/ethereum/tests @@ -1 +1 @@ -Subproject commit 4e8b9be3fba16ec32e0cdf50b8f9329826283aaa +Subproject commit ef191fdc61cf76cdb9cdc147465fb447304b0ed2 diff --git a/ethcore/src/spec/spec.rs b/ethcore/src/spec/spec.rs index 40893ad6d..7d3900f2c 100644 --- a/ethcore/src/spec/spec.rs +++ b/ethcore/src/spec/spec.rs @@ -100,6 +100,7 @@ impl CommonParams { schedule.have_create2 = block_number >= self.eip86_transition; schedule.have_revert = block_number >= self.eip140_transition; schedule.have_static_call = block_number >= self.eip214_transition; + schedule.have_return_data = block_number >= self.eip211_transition; if block_number >= self.eip210_transition { schedule.blockhash_gas = 350; }