Skip to content
This repository was archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Place RETURNDATA behind block number gate (#6095)
Browse files Browse the repository at this point in the history
  • Loading branch information
arkpar authored Jul 19, 2017
1 parent 2d7aecf commit 6a564f3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions ethcore/evm/src/interpreter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ impl<Cost: CostType> Interpreter<Cost> {
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 {
Expand Down
5 changes: 5 additions & 0 deletions ethcore/evm/src/schedule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down Expand Up @@ -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],
Expand Down Expand Up @@ -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
}
Expand All @@ -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],
Expand Down
1 change: 1 addition & 0 deletions ethcore/src/spec/spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 6a564f3

Please sign in to comment.