|
|
@ -56,10 +56,26 @@ type operation struct { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var ( |
|
|
|
var ( |
|
|
|
frontierInstructionSet = NewFrontierInstructionSet() |
|
|
|
frontierInstructionSet = NewFrontierInstructionSet() |
|
|
|
homesteadInstructionSet = NewHomesteadInstructionSet() |
|
|
|
homesteadInstructionSet = NewHomesteadInstructionSet() |
|
|
|
|
|
|
|
metropolisInstructionSet = NewMetropolisInstructionSet() |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// NewMetropolisInstructionSet returns the frontier, homestead and
|
|
|
|
|
|
|
|
// metropolis instructions.
|
|
|
|
|
|
|
|
func NewMetropolisInstructionSet() [256]operation { |
|
|
|
|
|
|
|
// instructions that can be executed during the homestead phase.
|
|
|
|
|
|
|
|
instructionSet := NewHomesteadInstructionSet() |
|
|
|
|
|
|
|
instructionSet[STATICCALL] = operation{ |
|
|
|
|
|
|
|
execute: opStaticCall, |
|
|
|
|
|
|
|
gasCost: gasStaticCall, |
|
|
|
|
|
|
|
validateStack: makeStackFunc(6, 1), |
|
|
|
|
|
|
|
memorySize: memoryStaticCall, |
|
|
|
|
|
|
|
valid: true, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return instructionSet |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// NewHomesteadInstructionSet returns the frontier and homestead
|
|
|
|
// NewHomesteadInstructionSet returns the frontier and homestead
|
|
|
|
// instructions that can be executed during the homestead phase.
|
|
|
|
// instructions that can be executed during the homestead phase.
|
|
|
|
func NewHomesteadInstructionSet() [256]operation { |
|
|
|
func NewHomesteadInstructionSet() [256]operation { |
|
|
@ -810,6 +826,7 @@ func NewFrontierInstructionSet() [256]operation { |
|
|
|
validateStack: makeStackFunc(2, 0), |
|
|
|
validateStack: makeStackFunc(2, 0), |
|
|
|
memorySize: memoryLog, |
|
|
|
memorySize: memoryLog, |
|
|
|
valid: true, |
|
|
|
valid: true, |
|
|
|
|
|
|
|
writes: true, |
|
|
|
}, |
|
|
|
}, |
|
|
|
LOG1: { |
|
|
|
LOG1: { |
|
|
|
execute: makeLog(1), |
|
|
|
execute: makeLog(1), |
|
|
@ -817,6 +834,7 @@ func NewFrontierInstructionSet() [256]operation { |
|
|
|
validateStack: makeStackFunc(3, 0), |
|
|
|
validateStack: makeStackFunc(3, 0), |
|
|
|
memorySize: memoryLog, |
|
|
|
memorySize: memoryLog, |
|
|
|
valid: true, |
|
|
|
valid: true, |
|
|
|
|
|
|
|
writes: true, |
|
|
|
}, |
|
|
|
}, |
|
|
|
LOG2: { |
|
|
|
LOG2: { |
|
|
|
execute: makeLog(2), |
|
|
|
execute: makeLog(2), |
|
|
@ -824,6 +842,7 @@ func NewFrontierInstructionSet() [256]operation { |
|
|
|
validateStack: makeStackFunc(4, 0), |
|
|
|
validateStack: makeStackFunc(4, 0), |
|
|
|
memorySize: memoryLog, |
|
|
|
memorySize: memoryLog, |
|
|
|
valid: true, |
|
|
|
valid: true, |
|
|
|
|
|
|
|
writes: true, |
|
|
|
}, |
|
|
|
}, |
|
|
|
LOG3: { |
|
|
|
LOG3: { |
|
|
|
execute: makeLog(3), |
|
|
|
execute: makeLog(3), |
|
|
@ -831,6 +850,7 @@ func NewFrontierInstructionSet() [256]operation { |
|
|
|
validateStack: makeStackFunc(5, 0), |
|
|
|
validateStack: makeStackFunc(5, 0), |
|
|
|
memorySize: memoryLog, |
|
|
|
memorySize: memoryLog, |
|
|
|
valid: true, |
|
|
|
valid: true, |
|
|
|
|
|
|
|
writes: true, |
|
|
|
}, |
|
|
|
}, |
|
|
|
LOG4: { |
|
|
|
LOG4: { |
|
|
|
execute: makeLog(4), |
|
|
|
execute: makeLog(4), |
|
|
@ -838,6 +858,7 @@ func NewFrontierInstructionSet() [256]operation { |
|
|
|
validateStack: makeStackFunc(6, 0), |
|
|
|
validateStack: makeStackFunc(6, 0), |
|
|
|
memorySize: memoryLog, |
|
|
|
memorySize: memoryLog, |
|
|
|
valid: true, |
|
|
|
valid: true, |
|
|
|
|
|
|
|
writes: true, |
|
|
|
}, |
|
|
|
}, |
|
|
|
CREATE: { |
|
|
|
CREATE: { |
|
|
|
execute: opCreate, |
|
|
|
execute: opCreate, |
|
|
|