Commit 45004a72 authored by Kelvin Fichter's avatar Kelvin Fichter

fix: remove old deployment bypass

parent 2438bd00
......@@ -17,7 +17,6 @@
package vm
import (
"bytes"
"fmt"
"math/big"
"sync/atomic"
......@@ -48,26 +47,6 @@ type (
// run runs the given contract and takes care of running precompiles with a fallback to the byte code interpreter.
func run(evm *EVM, contract *Contract, input []byte, readOnly bool) ([]byte, error) {
if UsingOVM {
// Only in the case where EnableArbitraryContractDeployment is
// set, allows codepath to be skipped when it is not set
if EnableArbitraryContractDeployment != nil {
// When the address manager is called
if contract.Address() == WhitelistAddress {
// If the first four bytes match `isDeployerAllowed(address)`
if bytes.Equal(input[0:4], isDeployerAllowedSig) {
// Already checked to make sure this value is not nil
switch *EnableArbitraryContractDeployment {
case EnableArbitraryContractDeploymentTrue:
return AbiBytesTrue, nil
case EnableArbitraryContractDeploymentFalse:
return AbiBytesFalse, nil
}
}
}
}
}
if contract.CodeAddr != nil {
precompiles := PrecompiledContractsHomestead
if evm.chainRules.IsByzantium {
......
package vm
import (
"fmt"
"os"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
)
var (
// AbiBytesTrue represents the ABI encoding of "true" as a byte slice
AbiBytesTrue = common.FromHex("0x0000000000000000000000000000000000000000000000000000000000000001")
// AbiBytesFalse represents the ABI encoding of "false" as a byte slice
AbiBytesFalse = common.FromHex("0x0000000000000000000000000000000000000000000000000000000000000000")
// UsingOVM is used to enable or disable functionality necessary for the OVM.
UsingOVM bool
// EnableArbitraryContractDeployment is used to override the
// deployer whitelist
EnableArbitraryContractDeployment *bool
// These are aliases to the pointer EnableArbitraryContractDeployment
EnableArbitraryContractDeploymentTrue bool = true
EnableArbitraryContractDeploymentFalse bool = false
WhitelistAddress = common.HexToAddress("0x4200000000000000000000000000000000000002")
isDeployerAllowedSig = crypto.Keccak256([]byte("isDeployerAllowed(address)"))[:4]
)
// UsingOVM is used to enable or disable functionality necessary for the OVM.
var UsingOVM bool
func init() {
UsingOVM = os.Getenv("USING_OVM") == "true"
value := os.Getenv("ROLLUP_ENABLE_ARBITRARY_CONTRACT_DEPLOYMENT")
if value != "" {
switch value {
case "true":
EnableArbitraryContractDeployment = &EnableArbitraryContractDeploymentTrue
case "false":
EnableArbitraryContractDeployment = &EnableArbitraryContractDeploymentFalse
default:
panic(fmt.Sprintf("Unknown ROLLUP_ENABLE_ARBITRARY_CONTRACT_DEPLOYMENT value: %s", value))
}
}
}
......@@ -13,7 +13,6 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/log"
......@@ -142,10 +141,6 @@ func NewSyncService(ctx context.Context, cfg Config, txpool *core.TxPool, bc *co
cfg.MinL2GasLimit = value
}
if vm.EnableArbitraryContractDeployment != nil {
log.Info("Setting arbitrary contract deployment", "value", *vm.EnableArbitraryContractDeployment)
}
service := SyncService{
ctx: ctx,
cancel: cancel,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment