aboutsummaryrefslogtreecommitdiffstats
path: root/core/vm/jump_table.go
diff options
context:
space:
mode:
Diffstat (limited to 'core/vm/jump_table.go')
-rw-r--r--core/vm/jump_table.go50
1 files changed, 34 insertions, 16 deletions
diff --git a/core/vm/jump_table.go b/core/vm/jump_table.go
index f6e8dae66..7fb11021f 100644
--- a/core/vm/jump_table.go
+++ b/core/vm/jump_table.go
@@ -53,6 +53,8 @@ type operation struct {
valid bool
// reverts determined whether the operation reverts state
reverts bool
+ // clearsReturndata determines whether the opertions clears the return data
+ clearsReturndata bool
}
var (
@@ -73,6 +75,19 @@ func NewMetropolisInstructionSet() [256]operation {
memorySize: memoryStaticCall,
valid: true,
}
+ instructionSet[RETURNDATASIZE] = operation{
+ execute: opReturnDataSize,
+ gasCost: constGasFunc(GasQuickStep),
+ validateStack: makeStackFunc(0, 1),
+ valid: true,
+ }
+ instructionSet[RETURNDATACOPY] = operation{
+ execute: opReturnDataCopy,
+ gasCost: gasReturnDataCopy,
+ validateStack: makeStackFunc(3, 0),
+ memorySize: memoryReturnDataCopy,
+ valid: true,
+ }
return instructionSet
}
@@ -861,26 +876,29 @@ func NewFrontierInstructionSet() [256]operation {
writes: true,
},
CREATE: {
- execute: opCreate,
- gasCost: gasCreate,
- validateStack: makeStackFunc(3, 1),
- memorySize: memoryCreate,
- valid: true,
- writes: true,
+ execute: opCreate,
+ gasCost: gasCreate,
+ validateStack: makeStackFunc(3, 1),
+ memorySize: memoryCreate,
+ valid: true,
+ writes: true,
+ clearsReturndata: true,
},
CALL: {
- execute: opCall,
- gasCost: gasCall,
- validateStack: makeStackFunc(7, 1),
- memorySize: memoryCall,
- valid: true,
+ execute: opCall,
+ gasCost: gasCall,
+ validateStack: makeStackFunc(7, 1),
+ memorySize: memoryCall,
+ valid: true,
+ clearsReturndata: true,
},
CALLCODE: {
- execute: opCallCode,
- gasCost: gasCallCode,
- validateStack: makeStackFunc(7, 1),
- memorySize: memoryCall,
- valid: true,
+ execute: opCallCode,
+ gasCost: gasCallCode,
+ validateStack: makeStackFunc(7, 1),
+ memorySize: memoryCall,
+ valid: true,
+ clearsReturndata: true,
},
RETURN: {
execute: opReturn,