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
a7c3e832
Unverified
Commit
a7c3e832
authored
Mar 21, 2023
by
protolambda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
op-node: fix sync-client ctx error check, and handle concurrent requests read better
parent
fbe13302
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
sync_client.go
op-node/sources/sync_client.go
+8
-4
No files found.
op-node/sources/sync_client.go
View file @
a7c3e832
...
...
@@ -91,7 +91,11 @@ func (s *SyncClient) Close() error {
func
(
s
*
SyncClient
)
RequestL2Range
(
ctx
context
.
Context
,
start
,
end
uint64
)
error
{
// Drain previous requests now that we have new information
for
len
(
s
.
requests
)
>
0
{
<-
s
.
requests
select
{
// in case requests is being read at the same time, don't block on draining it.
case
<-
s
.
requests
:
default
:
break
}
}
// TODO(CLI-3635): optimize the by-range fetching with the Engine API payloads-by-range method.
...
...
@@ -132,10 +136,10 @@ func (s *SyncClient) eventLoop() {
// We are only fetching one block at a time here.
return
s
.
fetchUnsafeBlockFromRpc
(
ctx
,
reqNum
)
})
if
err
==
s
.
resCtx
.
Err
()
{
return
}
if
err
!=
nil
{
if
err
==
s
.
resCtx
.
Err
()
{
return
}
s
.
log
.
Error
(
"failed syncing L2 block via RPC"
,
"err"
,
err
,
"num"
,
reqNum
)
// Reschedule at end of queue
select
{
...
...
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