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
9a4f9ad2
Unverified
Commit
9a4f9ad2
authored
Feb 28, 2022
by
Matthew Slipper
Committed by
GitHub
Feb 28, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2077 from ethereum-optimism/feat/non-blocking-sync
l2geth: don't block read rpc when doing initial sync
parents
db81b8e3
1187dc9a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
11 deletions
+22
-11
nasty-boats-type.md
.changeset/nasty-boats-type.md
+5
-0
api.go
l2geth/internal/ethapi/api.go
+7
-0
sync_service.go
l2geth/rollup/sync_service.go
+10
-11
No files found.
.changeset/nasty-boats-type.md
0 → 100644
View file @
9a4f9ad2
---
'
@eth-optimism/l2geth'
:
patch
---
Don't block read rpc requests when syncing
l2geth/internal/ethapi/api.go
View file @
9a4f9ad2
...
@@ -52,6 +52,7 @@ import (
...
@@ -52,6 +52,7 @@ import (
var
(
var
(
errNoSequencerURL
=
errors
.
New
(
"sequencer transaction forwarding not configured"
)
errNoSequencerURL
=
errors
.
New
(
"sequencer transaction forwarding not configured"
)
errStillSyncing
=
errors
.
New
(
"sequencer still syncing, cannot accept transactions"
)
)
)
const
(
const
(
...
@@ -1611,6 +1612,12 @@ func (args *SendTxArgs) toTransaction() *types.Transaction {
...
@@ -1611,6 +1612,12 @@ func (args *SendTxArgs) toTransaction() *types.Transaction {
// SubmitTransaction is a helper function that submits tx to txPool and logs a message.
// SubmitTransaction is a helper function that submits tx to txPool and logs a message.
func
SubmitTransaction
(
ctx
context
.
Context
,
b
Backend
,
tx
*
types
.
Transaction
)
(
common
.
Hash
,
error
)
{
func
SubmitTransaction
(
ctx
context
.
Context
,
b
Backend
,
tx
*
types
.
Transaction
)
(
common
.
Hash
,
error
)
{
// Do not accept transactions if running as the sequencer and
// the node is still syncing.
if
!
b
.
IsVerifier
()
&&
b
.
IsSyncing
()
{
return
common
.
Hash
{},
errStillSyncing
}
if
err
:=
b
.
SendTx
(
ctx
,
tx
);
err
!=
nil
{
if
err
:=
b
.
SendTx
(
ctx
,
tx
);
err
!=
nil
{
return
common
.
Hash
{},
err
return
common
.
Hash
{},
err
}
}
...
...
l2geth/rollup/sync_service.go
View file @
9a4f9ad2
...
@@ -245,17 +245,16 @@ func (s *SyncService) Start() error {
...
@@ -245,17 +245,16 @@ func (s *SyncService) Start() error {
if
s
.
verifier
{
if
s
.
verifier
{
go
s
.
VerifierLoop
()
go
s
.
VerifierLoop
()
}
else
{
}
else
{
// The sequencer must sync the transactions to the tip and the
go
func
()
{
// pending queue transactions on start before setting sync status
if
err
:=
s
.
syncTransactionsToTip
();
err
!=
nil
{
// to false and opening up the RPC to accept transactions.
log
.
Crit
(
"Sequencer cannot sync transactions to tip: %w"
,
err
)
if
err
:=
s
.
syncTransactionsToTip
();
err
!=
nil
{
}
return
fmt
.
Errorf
(
"Sequencer cannot sync transactions to tip: %w"
,
err
)
if
err
:=
s
.
syncQueueToTip
();
err
!=
nil
{
}
log
.
Crit
(
"Sequencer cannot sync queue to tip: %w"
,
err
)
if
err
:=
s
.
syncQueueToTip
();
err
!=
nil
{
}
return
fmt
.
Errorf
(
"Sequencer cannot sync queue to tip: %w"
,
err
)
s
.
setSyncStatus
(
false
)
}
go
s
.
SequencerLoop
()
s
.
setSyncStatus
(
false
)
}()
go
s
.
SequencerLoop
()
}
}
return
nil
return
nil
}
}
...
...
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