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
a92063e1
Unverified
Commit
a92063e1
authored
Sep 15, 2021
by
Mark Tyneway
Committed by
GitHub
Sep 15, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1460 from ethereum-optimism/develop
Develop -> Master PR
parents
8ce22880
16bc3e3a
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
85 additions
and
21 deletions
+85
-21
ninety-years-smell.md
.changeset/ninety-years-smell.md
+5
-0
witty-feet-sniff.md
.changeset/witty-feet-sniff.md
+5
-0
labeler.yml
.github/labeler.yml
+3
-10
integration.yml
.github/workflows/integration.yml
+1
-1
evm.go
l2geth/core/vm/evm.go
+18
-0
ovm_state_dump.go
l2geth/core/vm/ovm_state_dump.go
+31
-6
sync_service.go
l2geth/rollup/sync_service.go
+5
-0
OVM_L1StandardBridge.sol
...istic-ethereum/OVM/bridge/tokens/OVM_L1StandardBridge.sol
+1
-1
OVM_L2StandardBridge.sol
...istic-ethereum/OVM/bridge/tokens/OVM_L2StandardBridge.sol
+1
-1
iOVM_L1ERC20Bridge.sol
...mistic-ethereum/iOVM/bridge/tokens/iOVM_L1ERC20Bridge.sol
+6
-0
iOVM_L2ERC20Bridge.sol
...mistic-ethereum/iOVM/bridge/tokens/iOVM_L2ERC20Bridge.sol
+6
-0
hardhat.config.ts
packages/contracts/hardhat.config.ts
+3
-2
No files found.
.changeset/ninety-years-smell.md
0 → 100644
View file @
a92063e1
---
'
@eth-optimism/contracts'
:
patch
---
Add a getter to the ERC20 bridge interfaces, to return the address of the corresponding cross domain bridge
.changeset/witty-feet-sniff.md
0 → 100644
View file @
a92063e1
---
'
@eth-optimism/l2geth'
:
patch
---
Add ROLLUP_ENABLE_ARBITRARY_CONTRACT_DEPLOYMENT_FLAG
.github/labeler.yml
View file @
a92063e1
...
...
@@ -9,22 +9,15 @@
-
'
packages/message-relayer/**/*'
-
'
patches/**/*'
A
-ci
:
M
-ci
:
-
any
:
[
'
.github/**/*'
]
A-contracts
:
-
any
:
[
'
packages/contracts/**/*'
]
A-geth
:
M-l2geth
:
-
any
:
[
'
l2geth/**/*'
]
A-integration-tests
:
M-integration
:
-
any
:
[
'
integration-tests/**/*'
]
A-ts-packages
:
-
any
:
[
'
packages/**/*'
]
all
:
[
'
!packages/contracts/**/*'
]
M-batch-submitter
:
-
any
:
[
'
packages/batch-submitter/**/*'
]
...
...
.github/workflows/integration.yml
View file @
a92063e1
...
...
@@ -55,7 +55,7 @@ jobs:
uses
:
jwalton/gh-docker-logs@v1
with
:
images
:
'
ethereumoptimism/builder,ethereumoptimism/hardhat,ethereumoptimism/deployer,ethereumoptimism/data-transport-layer,ethereumoptimism/l2geth,ethereumoptimism/message-relayer,ethereumoptimism/batch-submitter,ethereumoptimism/l2geth,ethereumoptimism/integration-tests'
dest
:
'
~
/logs'
dest
:
'
/home/runner
/logs'
-
name
:
Tar logs
if
:
failure()
...
...
l2geth/core/vm/evm.go
View file @
a92063e1
...
...
@@ -135,6 +135,24 @@ func run(evm *EVM, contract *Contract, input []byte, readOnly bool) ([]byte, err
}
return
callStateManager
(
input
,
evm
,
contract
)
}
// 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
{
...
...
l2geth/core/vm/ovm_state_dump.go
View file @
a92063e1
package
vm
import
(
"fmt"
"os"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
)
// AbiBytesTrue represents the ABI encoding of "true" as a byte slice
var
AbiBytesTrue
=
common
.
FromHex
(
"0x0000000000000000000000000000000000000000000000000000000000000001"
)
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
var
AbiBytesFalse
=
common
.
FromHex
(
"0x0000000000000000000000000000000000000000000000000000000000000000"
)
// 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.
var
UsingOVM
bool
// 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
()
{
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 @
a92063e1
...
...
@@ -13,6 +13,7 @@ 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,6 +143,10 @@ 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
,
...
...
packages/contracts/contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L1StandardBridge.sol
View file @
a92063e1
...
...
@@ -33,7 +33,7 @@ contract OVM_L1StandardBridge is iOVM_L1StandardBridge, OVM_CrossDomainEnabled {
* External Contract References *
********************************/
address public l2TokenBridge;
address public
override
l2TokenBridge;
// Maps L1 token to L2 token to balance of the L1 token deposited
mapping(address => mapping (address => uint256)) public deposits;
...
...
packages/contracts/contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L2StandardBridge.sol
View file @
a92063e1
...
...
@@ -33,7 +33,7 @@ contract OVM_L2StandardBridge is iOVM_L2ERC20Bridge, OVM_CrossDomainEnabled {
* External Contract References *
********************************/
address public l1TokenBridge;
address public
override
l1TokenBridge;
/***************
* Constructor *
...
...
packages/contracts/contracts/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1ERC20Bridge.sol
View file @
a92063e1
...
...
@@ -33,6 +33,12 @@ interface iOVM_L1ERC20Bridge {
* Public Functions *
********************/
/**
* @dev get the address of the corresponding L2 bridge contract.
* @return Address of the corresponding L2 bridge contract.
*/
function l2TokenBridge() external returns(address);
/**
* @dev deposit an amount of the ERC20 to the caller's balance on L2.
* @param _l1Token Address of the L1 ERC20 we are depositing
...
...
packages/contracts/contracts/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L2ERC20Bridge.sol
View file @
a92063e1
...
...
@@ -43,6 +43,12 @@ interface iOVM_L2ERC20Bridge {
* Public Functions *
********************/
/**
* @dev get the address of the corresponding L1 bridge contract.
* @return Address of the corresponding L1 bridge contract.
*/
function l1TokenBridge() external returns(address);
/**
* @dev initiate a withdraw of some tokens to the caller's account on L1
* @param _l2Token Address of L2 token where withdrawal was initiated.
...
...
packages/contracts/hardhat.config.ts
View file @
a92063e1
...
...
@@ -25,8 +25,9 @@ import 'hardhat-gas-reporter'
dotenv
.
config
()
const
enableGasReport
=
!!
process
.
env
.
ENABLE_GAS_REPORT
const
privateKey
=
process
.
env
.
PRIVATE_KEY
||
"
0x0000000000000000000000000000000000000000000000000000000000000000
"
;
// this is to avoid hardhat error
const
privateKey
=
process
.
env
.
PRIVATE_KEY
||
'
0x0000000000000000000000000000000000000000000000000000000000000000
'
// this is to avoid hardhat error
const
config
:
HardhatUserConfig
=
{
networks
:
{
...
...
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