Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
45004a72
Unverified
Commit
45004a72
authored
Sep 21, 2021
by
Kelvin Fichter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: remove old deployment bypass
parent
2438bd00
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
61 deletions
+2
-61
evm.go
l2geth/core/vm/evm.go
+0
-21
ovm_state_dump.go
l2geth/core/vm/ovm_state_dump.go
+2
-35
sync_service.go
l2geth/rollup/sync_service.go
+0
-5
No files found.
l2geth/core/vm/evm.go
View file @
45004a72
...
@@ -17,7 +17,6 @@
...
@@ -17,7 +17,6 @@
package
vm
package
vm
import
(
import
(
"bytes"
"fmt"
"fmt"
"math/big"
"math/big"
"sync/atomic"
"sync/atomic"
...
@@ -48,26 +47,6 @@ type (
...
@@ -48,26 +47,6 @@ type (
// run runs the given contract and takes care of running precompiles with a fallback to the byte code interpreter.
// 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
)
{
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
{
if
contract
.
CodeAddr
!=
nil
{
precompiles
:=
PrecompiledContractsHomestead
precompiles
:=
PrecompiledContractsHomestead
if
evm
.
chainRules
.
IsByzantium
{
if
evm
.
chainRules
.
IsByzantium
{
...
...
l2geth/core/vm/ovm_state_dump.go
View file @
45004a72
package
vm
package
vm
import
(
import
(
"fmt"
"os"
"os"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
)
)
var
(
// UsingOVM is used to enable or disable functionality necessary for the OVM.
// AbiBytesTrue represents the ABI encoding of "true" as a byte slice
var
UsingOVM
bool
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
]
)
func
init
()
{
func
init
()
{
UsingOVM
=
os
.
Getenv
(
"USING_OVM"
)
==
"true"
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
))
}
}
}
}
l2geth/rollup/sync_service.go
View file @
45004a72
...
@@ -13,7 +13,6 @@ import (
...
@@ -13,7 +13,6 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/state"
"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/ethdb"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
...
@@ -142,10 +141,6 @@ func NewSyncService(ctx context.Context, cfg Config, txpool *core.TxPool, bc *co
...
@@ -142,10 +141,6 @@ func NewSyncService(ctx context.Context, cfg Config, txpool *core.TxPool, bc *co
cfg
.
MinL2GasLimit
=
value
cfg
.
MinL2GasLimit
=
value
}
}
if
vm
.
EnableArbitraryContractDeployment
!=
nil
{
log
.
Info
(
"Setting arbitrary contract deployment"
,
"value"
,
*
vm
.
EnableArbitraryContractDeployment
)
}
service
:=
SyncService
{
service
:=
SyncService
{
ctx
:
ctx
,
ctx
:
ctx
,
cancel
:
cancel
,
cancel
:
cancel
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment