Skip to content

Commit

Permalink
remove pre-AP2 handling of genesis contract (#658)
Browse files Browse the repository at this point in the history
  • Loading branch information
darioush authored Sep 23, 2024
1 parent 3ff98f1 commit 20fc944
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions core/vm/interpreter.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ import (
"github.com/ethereum/go-ethereum/log"
)

var BuiltinAddr = common.Address{
1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
}

// Config are the configuration options for the Interpreter
type Config struct {
Tracer EVMLogger // Opcode logger
Expand Down Expand Up @@ -121,18 +116,6 @@ func NewEVMInterpreter(evm *EVM) *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) {
// Deprecate special handling of [BuiltinAddr] as of ApricotPhase2.
// In ApricotPhase2, the contract deployed in the genesis is overridden by a deprecated precompiled
// contract which will return an error immediately if its ever called. Therefore, this function should
// never be called after ApricotPhase2 with [BuiltinAddr] as the contract address.
if !in.evm.chainRules.IsApricotPhase2 && contract.Address() == BuiltinAddr {
self := AccountRef(contract.Caller())
if _, ok := contract.caller.(*Contract); ok {
contract = contract.AsDelegate()
}
contract.self = self
}

// Increment the call depth which is restricted to 1024
in.evm.depth++
defer func() { in.evm.depth-- }()
Expand Down

0 comments on commit 20fc944

Please sign in to comment.