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
3aa56171
Unverified
Commit
3aa56171
authored
Apr 06, 2023
by
mergify[bot]
Committed by
GitHub
Apr 06, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into specs/challenger
parents
82950170
36c999c7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
10 deletions
+36
-10
main.go
op-chain-ops/cmd/op-migrate/main.go
+9
-4
config.go
op-chain-ops/genesis/config.go
+15
-0
system_test.go
op-e2e/system_test.go
+11
-5
bridges.md
specs/bridges.md
+1
-1
No files found.
op-chain-ops/cmd/op-migrate/main.go
View file @
3aa56171
...
@@ -3,6 +3,7 @@ package main
...
@@ -3,6 +3,7 @@ package main
import
(
import
(
"context"
"context"
"encoding/json"
"encoding/json"
"errors"
"fmt"
"fmt"
"math/big"
"math/big"
"os"
"os"
...
@@ -168,10 +169,14 @@ func main() {
...
@@ -168,10 +169,14 @@ func main() {
var
block
*
types
.
Block
var
block
*
types
.
Block
tag
:=
config
.
L1StartingBlockTag
tag
:=
config
.
L1StartingBlockTag
if
tag
.
BlockNumber
!=
nil
{
if
tag
==
nil
{
block
,
err
=
l1Client
.
BlockByNumber
(
context
.
Background
(),
big
.
NewInt
(
tag
.
BlockNumber
.
Int64
()))
return
errors
.
New
(
"l1StartingBlockTag cannot be nil"
)
}
else
if
tag
.
BlockHash
!=
nil
{
}
block
,
err
=
l1Client
.
BlockByHash
(
context
.
Background
(),
*
tag
.
BlockHash
)
log
.
Info
(
"Using L1 Starting Block Tag"
,
"tag"
,
tag
.
String
())
if
number
,
isNumber
:=
tag
.
Number
();
isNumber
{
block
,
err
=
l1Client
.
BlockByNumber
(
context
.
Background
(),
big
.
NewInt
(
number
.
Int64
()))
}
else
if
hash
,
isHash
:=
tag
.
Hash
();
isHash
{
block
,
err
=
l1Client
.
BlockByHash
(
context
.
Background
(),
hash
)
}
else
{
}
else
{
return
fmt
.
Errorf
(
"invalid l1StartingBlockTag in deploy config: %v"
,
tag
)
return
fmt
.
Errorf
(
"invalid l1StartingBlockTag in deploy config: %v"
,
tag
)
}
}
...
...
op-chain-ops/genesis/config.go
View file @
3aa56171
...
@@ -498,3 +498,18 @@ func (m *MarshalableRPCBlockNumberOrHash) UnmarshalJSON(b []byte) error {
...
@@ -498,3 +498,18 @@ func (m *MarshalableRPCBlockNumberOrHash) UnmarshalJSON(b []byte) error {
*
m
=
asMarshalable
*
m
=
asMarshalable
return
nil
return
nil
}
}
// Number wraps the rpc.BlockNumberOrHash Number method.
func
(
m
*
MarshalableRPCBlockNumberOrHash
)
Number
()
(
rpc
.
BlockNumber
,
bool
)
{
return
(
*
rpc
.
BlockNumberOrHash
)(
m
)
.
Number
()
}
// Hash wraps the rpc.BlockNumberOrHash Hash method.
func
(
m
*
MarshalableRPCBlockNumberOrHash
)
Hash
()
(
common
.
Hash
,
bool
)
{
return
(
*
rpc
.
BlockNumberOrHash
)(
m
)
.
Hash
()
}
// String wraps the rpc.BlockNumberOrHash String method.
func
(
m
*
MarshalableRPCBlockNumberOrHash
)
String
()
string
{
return
(
*
rpc
.
BlockNumberOrHash
)(
m
)
.
String
()
}
op-e2e/system_test.go
View file @
3aa56171
...
@@ -589,9 +589,10 @@ func TestSystemMockP2P(t *testing.T) {
...
@@ -589,9 +589,10 @@ func TestSystemMockP2P(t *testing.T) {
}
}
cfg
:=
DefaultSystemConfig
(
t
)
cfg
:=
DefaultSystemConfig
(
t
)
// slow down L1 blocks so we can see the L2 blocks arrive well before the L1 blocks do.
// Disable batcher, so we don't sync from L1
// Keep the seq window small so the L2 chain is started quick
cfg
.
DisableBatcher
=
true
cfg
.
DeployConfig
.
L1BlockTime
=
10
// disable at the start, so we don't miss any gossiped blocks.
cfg
.
Nodes
[
"sequencer"
]
.
Driver
.
SequencerStopped
=
true
// connect the nodes
// connect the nodes
cfg
.
P2PTopology
=
map
[
string
][]
string
{
cfg
.
P2PTopology
=
map
[
string
][]
string
{
...
@@ -613,6 +614,11 @@ func TestSystemMockP2P(t *testing.T) {
...
@@ -613,6 +614,11 @@ func TestSystemMockP2P(t *testing.T) {
require
.
Nil
(
t
,
err
,
"Error starting up system"
)
require
.
Nil
(
t
,
err
,
"Error starting up system"
)
defer
sys
.
Close
()
defer
sys
.
Close
()
// Enable the sequencer now that everyone is ready to receive payloads.
rollupRPCClient
,
err
:=
rpc
.
DialContext
(
context
.
Background
(),
sys
.
RollupNodes
[
"sequencer"
]
.
HTTPEndpoint
())
require
.
Nil
(
t
,
err
)
require
.
NoError
(
t
,
rollupRPCClient
.
Call
(
nil
,
"admin_startSequencer"
,
sys
.
L2GenesisCfg
.
ToBlock
()
.
Hash
()))
l2Seq
:=
sys
.
Clients
[
"sequencer"
]
l2Seq
:=
sys
.
Clients
[
"sequencer"
]
l2Verif
:=
sys
.
Clients
[
"verifier"
]
l2Verif
:=
sys
.
Clients
[
"verifier"
]
...
@@ -634,11 +640,11 @@ func TestSystemMockP2P(t *testing.T) {
...
@@ -634,11 +640,11 @@ func TestSystemMockP2P(t *testing.T) {
require
.
Nil
(
t
,
err
,
"Sending L2 tx to sequencer"
)
require
.
Nil
(
t
,
err
,
"Sending L2 tx to sequencer"
)
// Wait for tx to be mined on the L2 sequencer chain
// Wait for tx to be mined on the L2 sequencer chain
receiptSeq
,
err
:=
waitForTransaction
(
tx
.
Hash
(),
l2Seq
,
6
*
time
.
Duration
(
sys
.
RollupConfig
.
BlockTime
)
*
time
.
Second
)
receiptSeq
,
err
:=
waitForTransaction
(
tx
.
Hash
(),
l2Seq
,
10
*
time
.
Duration
(
sys
.
RollupConfig
.
BlockTime
)
*
time
.
Second
)
require
.
Nil
(
t
,
err
,
"Waiting for L2 tx on sequencer"
)
require
.
Nil
(
t
,
err
,
"Waiting for L2 tx on sequencer"
)
// Wait until the block it was first included in shows up in the safe chain on the verifier
// Wait until the block it was first included in shows up in the safe chain on the verifier
receiptVerif
,
err
:=
waitForTransaction
(
tx
.
Hash
(),
l2Verif
,
6
*
time
.
Duration
(
sys
.
RollupConfig
.
BlockTime
)
*
time
.
Second
)
receiptVerif
,
err
:=
waitForTransaction
(
tx
.
Hash
(),
l2Verif
,
10
*
time
.
Duration
(
sys
.
RollupConfig
.
BlockTime
)
*
time
.
Second
)
require
.
Nil
(
t
,
err
,
"Waiting for L2 tx on verifier"
)
require
.
Nil
(
t
,
err
,
"Waiting for L2 tx on verifier"
)
require
.
Equal
(
t
,
receiptSeq
,
receiptVerif
)
require
.
Equal
(
t
,
receiptSeq
,
receiptVerif
)
...
...
specs/bridges.md
View file @
3aa56171
...
@@ -35,7 +35,7 @@ interface StandardBridge {
...
@@ -35,7 +35,7 @@ interface StandardBridge {
function finalizeBridgeERC20(address _localToken, address _remoteToken, address _from, address _to, uint256 _amount, bytes memory _extraData) external;
function finalizeBridgeERC20(address _localToken, address _remoteToken, address _from, address _to, uint256 _amount, bytes memory _extraData) external;
function finalizeBridgeETH(address _from, address _to, uint256 _amount, bytes memory _extraData) payable external;
function finalizeBridgeETH(address _from, address _to, uint256 _amount, bytes memory _extraData) payable external;
function messenger() view external returns (address);
function messenger() view external returns (address);
function
otherBridge
() view external returns (address);
function
OTHER_BRIDGE
() view external returns (address);
}
}
```
```
...
...
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