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
758d561a
Unverified
Commit
758d561a
authored
Jun 26, 2023
by
mergify[bot]
Committed by
GitHub
Jun 26, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into jm/rm-sum-defs
parents
c2056ddb
dc3922cf
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
932 additions
and
739 deletions
+932
-739
config.yml
.circleci/config.yml
+4
-9
main.go
op-chain-ops/cmd/check-l2/main.go
+748
-0
helpers.go
op-chain-ops/genesis/helpers.go
+1
-1
layer_two.go
op-chain-ops/genesis/layer_two.go
+1
-1
util.go
op-chain-ops/util/util.go
+178
-0
check-l2.ts
packages/contracts-bedrock/tasks/check-l2.ts
+0
-727
index.ts
packages/contracts-bedrock/tasks/index.ts
+0
-1
No files found.
.circleci/config.yml
View file @
758d561a
...
...
@@ -861,8 +861,8 @@ jobs:
make devnet-up-deploy
-
run
:
name
:
Check L2 config
command
:
npx hardhat check-l2 --network devnetL1
--l2-rpc-url http://localhost:9545 --l1-rpc-url http://localhost:8545
working_directory
:
packages/contracts-bedrock
command
:
go run cmd/check-l2/main.go
--l2-rpc-url http://localhost:9545 --l1-rpc-url http://localhost:8545
working_directory
:
op-chain-ops
-
run
:
name
:
Deposit ERC20 through the bridge
command
:
timeout 8m npx hardhat deposit-erc20 --network devnetL1 --l1-contracts-json-path ../../.devnet/sdk-addresses.json
...
...
@@ -907,13 +907,8 @@ jobs:
make devnet-up
-
run
:
name
:
Check L2 config
command
:
|
npx hardhat check-l2 \
--network devnetL1 \
--l2-rpc-url http://localhost:9545 \
--l1-rpc-url http://localhost:8545 \
--l2-output-oracle-address 0x6900000000000000000000000000000000000000
working_directory
:
packages/contracts-bedrock
command
:
go run cmd/check-l2/main.go --l2-rpc-url http://localhost:9545 --l1-rpc-url http://localhost:8545
working_directory
:
op-chain-ops
-
run
:
name
:
Deposit ERC20 through the bridge
command
:
timeout 10m npx hardhat deposit-erc20 --network devnetL1
...
...
op-chain-ops/cmd/check-l2/main.go
0 → 100644
View file @
758d561a
This diff is collapsed.
Click to expand it.
op-chain-ops/genesis/helpers.go
View file @
758d561a
...
...
@@ -21,7 +21,7 @@ var (
// l1PredeployNamespace represents the namespace of L1 predeploys
l1PredeployNamespace
=
common
.
HexToAddress
(
"0x6900000000000000000000000000000000000000"
)
// bigL2PredeployNamespace represents the predeploy namespace as a big.Int
b
igL2PredeployNamespace
=
new
(
big
.
Int
)
.
SetBytes
(
l2PredeployNamespace
.
Bytes
())
B
igL2PredeployNamespace
=
new
(
big
.
Int
)
.
SetBytes
(
l2PredeployNamespace
.
Bytes
())
// bigL1PredeployNamespace represents the predeploy namespace as a big.Int
bigL1PredeployNamespace
=
new
(
big
.
Int
)
.
SetBytes
(
l1PredeployNamespace
.
Bytes
())
// bigCodeNamespace represents the predeploy namespace as a big.Int
...
...
op-chain-ops/genesis/layer_two.go
View file @
758d561a
...
...
@@ -36,7 +36,7 @@ func BuildL2Genesis(config *DeployConfig, l1StartBlock *types.Block) (*core.Gene
}
// Set up the proxies
err
=
setProxies
(
db
,
predeploys
.
ProxyAdminAddr
,
b
igL2PredeployNamespace
,
2048
)
err
=
setProxies
(
db
,
predeploys
.
ProxyAdminAddr
,
B
igL2PredeployNamespace
,
2048
)
if
err
!=
nil
{
return
nil
,
err
}
...
...
op-chain-ops/util/util.go
0 → 100644
View file @
758d561a
package
util
import
(
"context"
"fmt"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/ethclient/gethclient"
"github.com/ethereum/go-ethereum/rpc"
"github.com/urfave/cli/v2"
)
var
(
// EIP1976ImplementationSlot
EIP1967ImplementationSlot
=
common
.
HexToHash
(
"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc"
)
// EIP1967AdminSlot
EIP1967AdminSlot
=
common
.
HexToHash
(
"0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103"
)
)
// clients represents a set of initialized RPC clients
type
Clients
struct
{
L1Client
*
ethclient
.
Client
L2Client
*
ethclient
.
Client
L1RpcClient
*
rpc
.
Client
L2RpcClient
*
rpc
.
Client
L1GethClient
*
gethclient
.
Client
L2GethClient
*
gethclient
.
Client
}
// NewClients will create new RPC clients from a CLI context
func
NewClients
(
ctx
*
cli
.
Context
)
(
*
Clients
,
error
)
{
clients
:=
Clients
{}
l1RpcURL
:=
ctx
.
String
(
"l1-rpc-url"
)
if
l1RpcURL
!=
""
{
l1Client
,
l1RpcClient
,
l1GethClient
,
err
:=
newClients
(
l1RpcURL
)
if
err
!=
nil
{
return
nil
,
err
}
clients
.
L1Client
=
l1Client
clients
.
L1RpcClient
=
l1RpcClient
clients
.
L1GethClient
=
l1GethClient
}
l2RpcURL
:=
ctx
.
String
(
"l2-rpc-url"
)
if
l2RpcURL
!=
""
{
l2Client
,
l2RpcClient
,
l2GethClient
,
err
:=
newClients
(
l2RpcURL
)
if
err
!=
nil
{
return
nil
,
err
}
clients
.
L2Client
=
l2Client
clients
.
L2RpcClient
=
l2RpcClient
clients
.
L2GethClient
=
l2GethClient
}
return
&
clients
,
nil
}
// newClients will create new clients from a given URL
func
newClients
(
url
string
)
(
*
ethclient
.
Client
,
*
rpc
.
Client
,
*
gethclient
.
Client
,
error
)
{
ethClient
,
err
:=
ethclient
.
Dial
(
url
)
if
err
!=
nil
{
return
nil
,
nil
,
nil
,
fmt
.
Errorf
(
"cannot dial ethclient: %w"
,
err
)
}
rpcClient
,
err
:=
rpc
.
DialContext
(
context
.
Background
(),
url
)
if
err
!=
nil
{
return
nil
,
nil
,
nil
,
fmt
.
Errorf
(
"cannot dial rpc client: %w"
,
err
)
}
return
ethClient
,
rpcClient
,
gethclient
.
New
(
rpcClient
),
nil
}
// ClientsFlags represent the flags associated with creating RPC clients.
var
ClientsFlags
=
[]
cli
.
Flag
{
&
cli
.
StringFlag
{
Name
:
"l1-rpc-url"
,
Required
:
true
,
Usage
:
"L1 RPC URL"
,
EnvVars
:
[]
string
{
"L1_RPC_URL"
},
},
&
cli
.
StringFlag
{
Name
:
"l2-rpc-url"
,
Required
:
true
,
Usage
:
"L2 RPC URL"
,
EnvVars
:
[]
string
{
"L2_RPC_URL"
},
},
}
// Addresses represents the address values of various contracts. The values can
// be easily populated via a [cli.Context].
type
Addresses
struct
{
AddressManager
common
.
Address
OptimismPortal
common
.
Address
L1StandardBridge
common
.
Address
L1CrossDomainMessenger
common
.
Address
CanonicalTransactionChain
common
.
Address
StateCommitmentChain
common
.
Address
}
// AddressesFlags represent the flags associated with address parsing.
var
AddressesFlags
=
[]
cli
.
Flag
{
&
cli
.
StringFlag
{
Name
:
"address-manager-address"
,
Usage
:
"AddressManager address"
,
EnvVars
:
[]
string
{
"ADDRESS_MANAGER_ADDRESS"
},
},
&
cli
.
StringFlag
{
Name
:
"optimism-portal-address"
,
Usage
:
"OptimismPortal address"
,
EnvVars
:
[]
string
{
"OPTIMISM_PORTAL_ADDRESS"
},
},
&
cli
.
StringFlag
{
Name
:
"l1-standard-bridge-address"
,
Usage
:
"L1StandardBridge address"
,
EnvVars
:
[]
string
{
"L1_STANDARD_BRIDGE_ADDRESS"
},
},
&
cli
.
StringFlag
{
Name
:
"l1-crossdomain-messenger-address"
,
Usage
:
"L1CrossDomainMessenger address"
,
EnvVars
:
[]
string
{
"L1_CROSSDOMAIN_MESSENGER_ADDRESS"
},
},
&
cli
.
StringFlag
{
Name
:
"canonical-transaction-chain-address"
,
Usage
:
"CanonicalTransactionChain address"
,
EnvVars
:
[]
string
{
"CANONICAL_TRANSACTION_CHAIN_ADDRESS"
},
},
&
cli
.
StringFlag
{
Name
:
"state-commitment-chain-address"
,
Usage
:
"StateCommitmentChain address"
,
EnvVars
:
[]
string
{
"STATE_COMMITMENT_CHAIN_ADDRESS"
},
},
}
// NewAddresses populates an Addresses struct given a [cli.Context].
// This is useful for writing scripts that interact with smart contracts.
func
NewAddresses
(
ctx
*
cli
.
Context
)
(
*
Addresses
,
error
)
{
var
addresses
Addresses
var
err
error
addresses
.
AddressManager
,
err
=
parseAddress
(
ctx
,
"address-manager-address"
)
if
err
!=
nil
{
return
nil
,
err
}
addresses
.
OptimismPortal
,
err
=
parseAddress
(
ctx
,
"optimism-portal-address"
)
if
err
!=
nil
{
return
nil
,
err
}
addresses
.
L1StandardBridge
,
err
=
parseAddress
(
ctx
,
"l1-standard-bridge-address"
)
if
err
!=
nil
{
return
nil
,
err
}
addresses
.
L1CrossDomainMessenger
,
err
=
parseAddress
(
ctx
,
"l1-crossdomain-messenger-address"
)
if
err
!=
nil
{
return
nil
,
err
}
addresses
.
CanonicalTransactionChain
,
err
=
parseAddress
(
ctx
,
"canonical-transaction-chain-address"
)
if
err
!=
nil
{
return
nil
,
err
}
addresses
.
StateCommitmentChain
,
err
=
parseAddress
(
ctx
,
"state-commitment-chain-address"
)
if
err
!=
nil
{
return
nil
,
err
}
return
&
addresses
,
nil
}
// parseAddress will parse a [common.Address] from a [cli.Context] and return
// an error if the configured address is not correct.
func
parseAddress
(
ctx
*
cli
.
Context
,
name
string
)
(
common
.
Address
,
error
)
{
value
:=
ctx
.
String
(
name
)
if
value
==
""
{
return
common
.
Address
{},
nil
}
if
!
common
.
IsHexAddress
(
value
)
{
return
common
.
Address
{},
fmt
.
Errorf
(
"invalid address: %s"
,
value
)
}
return
common
.
HexToAddress
(
value
),
nil
}
packages/contracts-bedrock/tasks/check-l2.ts
deleted
100644 → 0
View file @
c2056ddb
This diff is collapsed.
Click to expand it.
packages/contracts-bedrock/tasks/index.ts
View file @
758d561a
import
'
./solidity
'
import
'
./check-l2
'
import
'
./generate-deploy-config
'
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