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
a38522d1
Unverified
Commit
a38522d1
authored
Apr 17, 2023
by
OptimismBot
Committed by
GitHub
Apr 17, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5471 from ethereum-optimism/fix-test-e2e-gossip
op-e2e: fix TestSystemMockP2P - wait for peers to mesh
parents
fdaa95b8
177ec1f5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
system_test.go
op-e2e/system_test.go
+20
-0
No files found.
op-e2e/system_test.go
View file @
a38522d1
...
@@ -23,6 +23,7 @@ import (
...
@@ -23,6 +23,7 @@ import (
"github.com/ethereum/go-ethereum/rpc"
"github.com/ethereum/go-ethereum/rpc"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
"golang.org/x/exp/slices"
"github.com/ethereum-optimism/optimism/op-bindings/bindings"
"github.com/ethereum-optimism/optimism/op-bindings/bindings"
"github.com/ethereum-optimism/optimism/op-bindings/predeploys"
"github.com/ethereum-optimism/optimism/op-bindings/predeploys"
...
@@ -36,6 +37,7 @@ import (
...
@@ -36,6 +37,7 @@ import (
"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"
"github.com/ethereum-optimism/optimism/op-service/backoff"
oppprof
"github.com/ethereum-optimism/optimism/op-service/pprof"
oppprof
"github.com/ethereum-optimism/optimism/op-service/pprof"
)
)
...
@@ -619,6 +621,24 @@ func TestSystemMockP2P(t *testing.T) {
...
@@ -619,6 +621,24 @@ func TestSystemMockP2P(t *testing.T) {
// Enable the sequencer now that everyone is ready to receive payloads.
// Enable the sequencer now that everyone is ready to receive payloads.
rollupRPCClient
,
err
:=
rpc
.
DialContext
(
context
.
Background
(),
sys
.
RollupNodes
[
"sequencer"
]
.
HTTPEndpoint
())
rollupRPCClient
,
err
:=
rpc
.
DialContext
(
context
.
Background
(),
sys
.
RollupNodes
[
"sequencer"
]
.
HTTPEndpoint
())
require
.
Nil
(
t
,
err
)
require
.
Nil
(
t
,
err
)
verifierPeerID
:=
sys
.
RollupNodes
[
"verifier"
]
.
P2P
()
.
Host
()
.
ID
()
check
:=
func
()
bool
{
sequencerBlocksTopicPeers
:=
sys
.
RollupNodes
[
"sequencer"
]
.
P2P
()
.
GossipOut
()
.
BlocksTopicPeers
()
return
slices
.
Contains
[
peer
.
ID
](
sequencerBlocksTopicPeers
,
verifierPeerID
)
}
// poll to see if the verifier node is connected & meshed on gossip.
// Without this verifier, we shouldn't start sending blocks around, or we'll miss them and fail the test.
backOffStrategy
:=
backoff
.
Exponential
()
for
i
:=
0
;
i
<
10
;
i
++
{
if
check
()
{
break
}
time
.
Sleep
(
backOffStrategy
.
Duration
(
i
))
}
require
.
True
(
t
,
check
(),
"verifier must be meshed with sequencer for gossip test to proceed"
)
require
.
NoError
(
t
,
rollupRPCClient
.
Call
(
nil
,
"admin_startSequencer"
,
sys
.
L2GenesisCfg
.
ToBlock
()
.
Hash
()))
require
.
NoError
(
t
,
rollupRPCClient
.
Call
(
nil
,
"admin_startSequencer"
,
sys
.
L2GenesisCfg
.
ToBlock
()
.
Hash
()))
l2Seq
:=
sys
.
Clients
[
"sequencer"
]
l2Seq
:=
sys
.
Clients
[
"sequencer"
]
...
...
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