From f9fb70d2eeebfc27d3a4f8ae3ea93c67d7fb0e6b Mon Sep 17 00:00:00 2001 From: Péter Szilágyi Date: Wed, 16 Aug 2017 17:09:29 +0300 Subject: core/vm: rework reversion to work on a higher level --- core/vm/jump_table.go | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'core/vm/jump_table.go') diff --git a/core/vm/jump_table.go b/core/vm/jump_table.go index 2d7697e9c..f0a922912 100644 --- a/core/vm/jump_table.go +++ b/core/vm/jump_table.go @@ -41,20 +41,13 @@ type operation struct { validateStack stackValidationFunc // memorySize returns the memory size required for the operation memorySize memorySizeFunc - // halts indicates whether the operation shoult halt further execution - // and return - halts bool - // jumps indicates whether operation made a jump. This prevents the program - // counter from further incrementing. - jumps bool - // writes determines whether this a state modifying operation - writes bool - // valid is used to check whether the retrieved operation is valid and known - valid bool - // reverts determined whether the operation reverts state - reverts bool - // returns determines whether the opertions sets the return data - returns bool + + halts bool // indicates whether the operation shoult halt further execution + jumps bool // indicates whether the program counter should not increment + writes bool // determines whether this a state modifying operation + valid bool // indication whether the retrieved operation is valid and known + reverts bool // determines whether the operation reverts state (implicitly halts) + returns bool // determines whether the opertions sets the return data content } var ( @@ -91,10 +84,12 @@ func NewMetropolisInstructionSet() [256]operation { } instructionSet[REVERT] = operation{ execute: opRevert, - gasCost: constGasFunc(GasFastestStep), + gasCost: gasRevert, validateStack: makeStackFunc(2, 0), + memorySize: memoryRevert, valid: true, reverts: true, + returns: true, } return instructionSet } -- cgit