Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove pre-AP2 handling of genesis contract #658

Merged
merged 1 commit into from
Sep 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading