aboutsummaryrefslogtreecommitdiffstats
path: root/core/vm/jump_table.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-08-16 22:09:29 +0800
committerPéter Szilágyi <peterke@gmail.com>2017-08-17 21:50:35 +0800
commitf9fb70d2eeebfc27d3a4f8ae3ea93c67d7fb0e6b (patch)
treeea623fa39c51265de09020ead1840ba881748bc9 /core/vm/jump_table.go
parentb70a73cd3e49e249a9ab2c41c2dd268786dcd1a3 (diff)
downloadgo-tangerine-f9fb70d2eeebfc27d3a4f8ae3ea93c67d7fb0e6b.tar.gz
go-tangerine-f9fb70d2eeebfc27d3a4f8ae3ea93c67d7fb0e6b.tar.zst
go-tangerine-f9fb70d2eeebfc27d3a4f8ae3ea93c67d7fb0e6b.zip
core/vm: rework reversion to work on a higher level
Diffstat (limited to 'core/vm/jump_table.go')
-rw-r--r--core/vm/jump_table.go25
1 files changed, 10 insertions, 15 deletions
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
}