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
4d0bb35f
Commit
4d0bb35f
authored
Mar 09, 2023
by
Andreas Bigger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more test fixing
parent
69af4e5d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
10 deletions
+38
-10
geth.go
op-e2e/geth.go
+2
-2
system_test.go
op-e2e/system_test.go
+36
-8
No files found.
op-e2e/geth.go
View file @
4d0bb35f
...
@@ -53,7 +53,7 @@ func waitForL1OriginOnL2(l1BlockNum uint64, client *ethclient.Client, timeout ti
...
@@ -53,7 +53,7 @@ func waitForL1OriginOnL2(l1BlockNum uint64, client *ethclient.Client, timeout ti
}
}
case
err
:=
<-
headSub
.
Err
()
:
case
err
:=
<-
headSub
.
Err
()
:
return
nil
,
fmt
.
Errorf
(
"
E
rror in head subscription: %w"
,
err
)
return
nil
,
fmt
.
Errorf
(
"
e
rror in head subscription: %w"
,
err
)
case
<-
timeoutCh
:
case
<-
timeoutCh
:
return
nil
,
errors
.
New
(
"timeout"
)
return
nil
,
errors
.
New
(
"timeout"
)
}
}
...
@@ -101,7 +101,7 @@ func waitForBlock(number *big.Int, client *ethclient.Client, timeout time.Durati
...
@@ -101,7 +101,7 @@ func waitForBlock(number *big.Int, client *ethclient.Client, timeout time.Durati
return
client
.
BlockByNumber
(
ctx
,
number
)
return
client
.
BlockByNumber
(
ctx
,
number
)
}
}
case
err
:=
<-
headSub
.
Err
()
:
case
err
:=
<-
headSub
.
Err
()
:
return
nil
,
fmt
.
Errorf
(
"
E
rror in head subscription: %w"
,
err
)
return
nil
,
fmt
.
Errorf
(
"
e
rror in head subscription: %w"
,
err
)
case
<-
timeoutCh
:
case
<-
timeoutCh
:
return
nil
,
errors
.
New
(
"timeout"
)
return
nil
,
errors
.
New
(
"timeout"
)
}
}
...
...
op-e2e/system_test.go
View file @
4d0bb35f
...
@@ -28,8 +28,10 @@ import (
...
@@ -28,8 +28,10 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/predeploys"
"github.com/ethereum-optimism/optimism/op-bindings/predeploys"
"github.com/ethereum-optimism/optimism/op-node/client"
"github.com/ethereum-optimism/optimism/op-node/client"
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/eth"
rollupNode
"github.com/ethereum-optimism/optimism/op-node/node"
"github.com/ethereum-optimism/optimism/op-node/p2p"
"github.com/ethereum-optimism/optimism/op-node/p2p"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-node/rollup/driver"
"github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-node/withdrawals"
"github.com/ethereum-optimism/optimism/op-node/withdrawals"
...
@@ -591,7 +593,7 @@ func TestSystemMockP2P(t *testing.T) {
...
@@ -591,7 +593,7 @@ func TestSystemMockP2P(t *testing.T) {
// connect the nodes
// connect the nodes
cfg
.
P2PTopology
=
map
[
string
][]
string
{
cfg
.
P2PTopology
=
map
[
string
][]
string
{
"verifier"
:
[]
string
{
"sequencer"
},
"verifier"
:
{
"sequencer"
},
}
}
var
published
,
received
[]
common
.
Hash
var
published
,
received
[]
common
.
Hash
...
@@ -660,6 +662,26 @@ func TestSystemMockPeerScoring(t *testing.T) {
...
@@ -660,6 +662,26 @@ func TestSystemMockPeerScoring(t *testing.T) {
// Keep the seq window small so the L2 chain is started quick
// Keep the seq window small so the L2 chain is started quick
cfg
.
DeployConfig
.
L1BlockTime
=
10
cfg
.
DeployConfig
.
L1BlockTime
=
10
// Append additional nodes to the system to construct a dense p2p network
cfg
.
Nodes
[
"verifier2"
]
=
&
rollupNode
.
Config
{
Driver
:
driver
.
Config
{
VerifierConfDepth
:
0
,
SequencerConfDepth
:
0
,
SequencerEnabled
:
false
,
},
L1EpochPollInterval
:
time
.
Second
*
4
,
}
cfg
.
Nodes
[
"verifier3"
]
=
&
rollupNode
.
Config
{
Driver
:
driver
.
Config
{
VerifierConfDepth
:
0
,
SequencerConfDepth
:
0
,
SequencerEnabled
:
false
,
},
L1EpochPollInterval
:
time
.
Second
*
4
,
}
cfg
.
Loggers
[
"verifier2"
]
=
testlog
.
Logger
(
t
,
log
.
LvlInfo
)
.
New
(
"role"
,
"verifier"
)
cfg
.
Loggers
[
"verifier3"
]
=
testlog
.
Logger
(
t
,
log
.
LvlInfo
)
.
New
(
"role"
,
"verifier"
)
// connect the nodes
// connect the nodes
cfg
.
P2PTopology
=
map
[
string
][]
string
{
cfg
.
P2PTopology
=
map
[
string
][]
string
{
"verifier"
:
{
"sequencer"
,
"verifier2"
,
"verifier3"
},
"verifier"
:
{
"sequencer"
,
"verifier2"
,
"verifier3"
},
...
@@ -677,19 +699,19 @@ func TestSystemMockPeerScoring(t *testing.T) {
...
@@ -677,19 +699,19 @@ func TestSystemMockPeerScoring(t *testing.T) {
}
}
}
}
var
published
,
received
[]
common
.
Hash
var
published
,
received
1
,
received2
,
received3
[]
common
.
Hash
seqTracer
,
verifTracer
,
verifTracer2
,
verifTracer3
:=
new
(
FnTracer
),
new
(
FnTracer
),
new
(
FnTracer
),
new
(
FnTracer
)
seqTracer
,
verifTracer
,
verifTracer2
,
verifTracer3
:=
new
(
FnTracer
),
new
(
FnTracer
),
new
(
FnTracer
),
new
(
FnTracer
)
seqTracer
.
OnPublishL2PayloadFn
=
func
(
ctx
context
.
Context
,
payload
*
eth
.
ExecutionPayload
)
{
seqTracer
.
OnPublishL2PayloadFn
=
func
(
ctx
context
.
Context
,
payload
*
eth
.
ExecutionPayload
)
{
published
=
append
(
published
,
payload
.
BlockHash
)
published
=
append
(
published
,
payload
.
BlockHash
)
}
}
verifTracer
.
OnUnsafeL2PayloadFn
=
func
(
ctx
context
.
Context
,
from
peer
.
ID
,
payload
*
eth
.
ExecutionPayload
)
{
verifTracer
.
OnUnsafeL2PayloadFn
=
func
(
ctx
context
.
Context
,
from
peer
.
ID
,
payload
*
eth
.
ExecutionPayload
)
{
received
=
append
(
received
,
payload
.
BlockHash
)
received
1
=
append
(
received1
,
payload
.
BlockHash
)
}
}
verifTracer2
.
OnUnsafeL2PayloadFn
=
func
(
ctx
context
.
Context
,
from
peer
.
ID
,
payload
*
eth
.
ExecutionPayload
)
{
verifTracer2
.
OnUnsafeL2PayloadFn
=
func
(
ctx
context
.
Context
,
from
peer
.
ID
,
payload
*
eth
.
ExecutionPayload
)
{
received
=
append
(
received
,
payload
.
BlockHash
)
received
2
=
append
(
received2
,
payload
.
BlockHash
)
}
}
verifTracer3
.
OnUnsafeL2PayloadFn
=
func
(
ctx
context
.
Context
,
from
peer
.
ID
,
payload
*
eth
.
ExecutionPayload
)
{
verifTracer3
.
OnUnsafeL2PayloadFn
=
func
(
ctx
context
.
Context
,
from
peer
.
ID
,
payload
*
eth
.
ExecutionPayload
)
{
received
=
append
(
received
,
payload
.
BlockHash
)
received
3
=
append
(
received3
,
payload
.
BlockHash
)
}
}
cfg
.
Nodes
[
"sequencer"
]
.
Tracer
=
seqTracer
cfg
.
Nodes
[
"sequencer"
]
.
Tracer
=
seqTracer
cfg
.
Nodes
[
"verifier"
]
.
Tracer
=
verifTracer
cfg
.
Nodes
[
"verifier"
]
.
Tracer
=
verifTracer
...
@@ -740,11 +762,17 @@ func TestSystemMockPeerScoring(t *testing.T) {
...
@@ -740,11 +762,17 @@ func TestSystemMockPeerScoring(t *testing.T) {
require
.
Equal
(
t
,
receiptSeq
,
receiptVerif
)
require
.
Equal
(
t
,
receiptSeq
,
receiptVerif
)
// Verify that everything that was received was published
// Verify that everything that was received was published
require
.
GreaterOrEqual
(
t
,
len
(
published
),
len
(
received
))
require
.
GreaterOrEqual
(
t
,
len
(
published
),
len
(
received1
))
require
.
ElementsMatch
(
t
,
received
,
published
[
:
len
(
received
)])
require
.
GreaterOrEqual
(
t
,
len
(
published
),
len
(
received2
))
require
.
GreaterOrEqual
(
t
,
len
(
published
),
len
(
received3
))
require
.
ElementsMatch
(
t
,
received1
,
published
[
:
len
(
received1
)])
require
.
ElementsMatch
(
t
,
received2
,
published
[
:
len
(
received2
)])
require
.
ElementsMatch
(
t
,
received3
,
published
[
:
len
(
received3
)])
// Verify that the tx was received via p2p
// Verify that the tx was received via p2p
require
.
Contains
(
t
,
received
,
receiptVerif
.
BlockHash
)
require
.
Contains
(
t
,
received1
,
receiptVerif
.
BlockHash
)
require
.
Contains
(
t
,
received2
,
receiptVerif
.
BlockHash
)
require
.
Contains
(
t
,
received3
,
receiptVerif
.
BlockHash
)
}
}
func
TestL1InfoContract
(
t
*
testing
.
T
)
{
func
TestL1InfoContract
(
t
*
testing
.
T
)
{
...
...
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