aboutsummaryrefslogtreecommitdiff
path: root/core/vm/interpreter.go
diff options
context:
space:
mode:
authoraaronbuchwald <[email protected]>2020-12-15 21:31:57 -0500
committerGitHub <[email protected]>2020-12-15 21:31:57 -0500
commit3f055c40405b44ba1e606578c08b1e8f0ca7e026 (patch)
tree6569bcfe3a62f3804a4f90b803b3d0d6cd96d732 /core/vm/interpreter.go
parent2d0a37c6490dc9a4ec36ee4ebbed01c790f0426a (diff)
parent7c758da302baf80775876008958ec77055ab953a (diff)
Merge pull request #56 from ava-labs/mc-transfer
Mc transfer
Diffstat (limited to 'core/vm/interpreter.go')
-rw-r--r--core/vm/interpreter.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/core/vm/interpreter.go b/core/vm/interpreter.go
index a114a8d..1292650 100644
--- a/core/vm/interpreter.go
+++ b/core/vm/interpreter.go
@@ -26,6 +26,7 @@ import (
)
var (
+ // BuiltinAddr ...
BuiltinAddr = common.Address{
1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -106,6 +107,8 @@ func NewEVMInterpreter(evm *EVM, cfg Config) *EVMInterpreter {
if cfg.JumpTable[STOP] == nil {
var jt JumpTable
switch {
+ case evm.chainRules.IsApricot:
+ jt = apricotInstructionSet
case evm.chainRules.IsYoloV1:
jt = yoloV1InstructionSet
case evm.chainRules.IsIstanbul:
@@ -146,6 +149,15 @@ func NewEVMInterpreter(evm *EVM, cfg Config) *EVMInterpreter {
// considered a revert-and-consume-all-gas operation except for
// ErrExecutionReverted which means revert-and-keep-gas-left.
func (in *EVMInterpreter) Run(contract *Contract, input []byte, readOnly bool) (ret []byte, err error) {
+ // TODO remove after Apricot network upgrade.
+ // [BuiltinAddr] is overridden by a precompile in Apricot.
+ // This makes any call to [BuiltinAddr] a no-op once the network
+ // upgrade occurs. Then in the upgrade after the hard fork, this
+ // code can be safely removed.
+ // This can't occur before the hard fork because it would change
+ // the behavior of upgraded nodes before the hard fork occurs
+ // since there is no mechanism to change this code based on the
+ // block height.
if contract.Address() == BuiltinAddr {
self := AccountRef(contract.Caller())
if _, ok := contract.caller.(*Contract); ok {