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
637ee207
Unverified
Commit
637ee207
authored
Feb 05, 2024
by
Joshua Gutow
Committed by
GitHub
Feb 06, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
op-e2e: Try to make TestELSync more stable (#9370)
parent
a09c0068
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
4 deletions
+18
-4
l2_engine.go
op-e2e/actions/l2_engine.go
+4
-0
sync_test.go
op-e2e/actions/sync_test.go
+13
-3
l2_engine_api.go
op-program/client/l2/engineapi/l2_engine_api.go
+1
-1
No files found.
op-e2e/actions/l2_engine.go
View file @
637ee207
...
@@ -142,6 +142,10 @@ func (s *L2Engine) AddPeers(peers ...*enode.Node) {
...
@@ -142,6 +142,10 @@ func (s *L2Engine) AddPeers(peers ...*enode.Node) {
}
}
}
}
func
(
s
*
L2Engine
)
PeerCount
()
int
{
return
s
.
node
.
Server
()
.
PeerCount
()
}
func
(
s
*
L2Engine
)
EthClient
()
*
ethclient
.
Client
{
func
(
s
*
L2Engine
)
EthClient
()
*
ethclient
.
Client
{
cl
:=
s
.
node
.
Attach
()
cl
:=
s
.
node
.
Attach
()
return
ethclient
.
NewClient
(
cl
)
return
ethclient
.
NewClient
(
cl
)
...
...
op-e2e/actions/sync_test.go
View file @
637ee207
...
@@ -174,9 +174,6 @@ func TestELSync(gt *testing.T) {
...
@@ -174,9 +174,6 @@ func TestELSync(gt *testing.T) {
// Enable engine P2P sync
// Enable engine P2P sync
verEng
,
verifier
:=
setupVerifier
(
t
,
sd
,
log
,
miner
.
L1Client
(
t
,
sd
.
RollupCfg
),
miner
.
BlobStore
(),
&
sync
.
Config
{
SyncMode
:
sync
.
ELSync
})
verEng
,
verifier
:=
setupVerifier
(
t
,
sd
,
log
,
miner
.
L1Client
(
t
,
sd
.
RollupCfg
),
miner
.
BlobStore
(),
&
sync
.
Config
{
SyncMode
:
sync
.
ELSync
})
seqEng
.
AddPeers
(
verEng
.
Enode
())
verEng
.
AddPeers
(
seqEng
.
Enode
())
seqEngCl
,
err
:=
sources
.
NewEngineClient
(
seqEng
.
RPCClient
(),
log
,
nil
,
sources
.
EngineClientDefaultConfig
(
sd
.
RollupCfg
))
seqEngCl
,
err
:=
sources
.
NewEngineClient
(
seqEng
.
RPCClient
(),
log
,
nil
,
sources
.
EngineClientDefaultConfig
(
sd
.
RollupCfg
))
require
.
NoError
(
t
,
err
)
require
.
NoError
(
t
,
err
)
...
@@ -189,6 +186,10 @@ func TestELSync(gt *testing.T) {
...
@@ -189,6 +186,10 @@ func TestELSync(gt *testing.T) {
sequencer
.
ActL2EndBlock
(
t
)
sequencer
.
ActL2EndBlock
(
t
)
}
}
// Wait longer to peer. This tests flakes or takes a long time when the op-geth instances are not able to peer.
seqEng
.
AddPeers
(
verEng
.
Enode
())
verEng
.
AddPeers
(
seqEng
.
Enode
())
// Insert it on the verifier
// Insert it on the verifier
seqHead
,
err
:=
seqEngCl
.
PayloadByLabel
(
t
.
Ctx
(),
eth
.
Unsafe
)
seqHead
,
err
:=
seqEngCl
.
PayloadByLabel
(
t
.
Ctx
(),
eth
.
Unsafe
)
require
.
NoError
(
t
,
err
)
require
.
NoError
(
t
,
err
)
...
@@ -196,6 +197,14 @@ func TestELSync(gt *testing.T) {
...
@@ -196,6 +197,14 @@ func TestELSync(gt *testing.T) {
require
.
NoError
(
t
,
err
)
require
.
NoError
(
t
,
err
)
verifier
.
ActL2InsertUnsafePayload
(
seqHead
)(
t
)
verifier
.
ActL2InsertUnsafePayload
(
seqHead
)(
t
)
require
.
Eventually
(
t
,
func
()
bool
{
return
seqEng
.
PeerCount
()
>
0
&&
verEng
.
PeerCount
()
>
0
},
60
*
time
.
Second
,
1500
*
time
.
Millisecond
,
"Sequencer & Verifier must peer with each other for snap sync to work"
,
)
// Expect snap sync to download & execute the entire chain
// Expect snap sync to download & execute the entire chain
// Verify this by checking that the verifier has the correct value for block 1
// Verify this by checking that the verifier has the correct value for block 1
require
.
Eventually
(
t
,
require
.
Eventually
(
t
,
...
@@ -207,6 +216,7 @@ func TestELSync(gt *testing.T) {
...
@@ -207,6 +216,7 @@ func TestELSync(gt *testing.T) {
return
seqStart
.
ExecutionPayload
.
BlockHash
==
block
.
Hash
return
seqStart
.
ExecutionPayload
.
BlockHash
==
block
.
Hash
},
},
60
*
time
.
Second
,
1500
*
time
.
Millisecond
,
60
*
time
.
Second
,
1500
*
time
.
Millisecond
,
"verifier did not snap sync"
,
)
)
}
}
...
...
op-program/client/l2/engineapi/l2_engine_api.go
View file @
637ee207
...
@@ -350,7 +350,7 @@ func (ea *L2EngineAPI) forkchoiceUpdated(ctx context.Context, state *eth.Forkcho
...
@@ -350,7 +350,7 @@ func (ea *L2EngineAPI) forkchoiceUpdated(ctx context.Context, state *eth.Forkcho
return
STATUS_SYNCING
,
nil
return
STATUS_SYNCING
,
nil
}
}
ea
.
log
.
Info
(
"Forkchoice requested sync to new head"
,
"number"
,
header
.
Number
,
"hash"
,
header
.
Hash
())
ea
.
log
.
Info
(
"Forkchoice requested sync to new head"
,
"number"
,
header
.
Number
()
,
"hash"
,
header
.
Hash
())
if
err
:=
ea
.
downloader
.
BeaconSync
(
downloader
.
SnapSync
,
header
.
Header
(),
nil
);
err
!=
nil
{
if
err
:=
ea
.
downloader
.
BeaconSync
(
downloader
.
SnapSync
,
header
.
Header
(),
nil
);
err
!=
nil
{
return
STATUS_SYNCING
,
err
return
STATUS_SYNCING
,
err
}
}
...
...
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