good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
Erigon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
a
Erigon
Commits
84da57f6
Unverified
Commit
84da57f6
authored
3 years ago
by
Alex Sharov
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
revert run only stage.Headers at first cycle (#2879)
parent
810c004d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
eth/stagedsync/sync.go
+1
-0
1 addition, 0 deletions
eth/stagedsync/sync.go
turbo/stages/stageloop.go
+2
-34
2 additions, 34 deletions
turbo/stages/stageloop.go
with
3 additions
and
34 deletions
eth/stagedsync/sync.go
+
1
−
0
View file @
84da57f6
...
...
@@ -389,6 +389,7 @@ func (s *Sync) pruneStage(firstCycle bool, stage *Stage, db kv.RwDB, tx kv.RwTx)
return
nil
}
// DisableAllStages - including their unwinds
func
(
s
*
Sync
)
DisableAllStages
()
[]
stages
.
SyncStage
{
var
backupEnabledIds
[]
stages
.
SyncStage
for
i
:=
range
s
.
stages
{
...
...
This diff is collapsed.
Click to expand it.
turbo/stages/stageloop.go
+
2
−
34
View file @
84da57f6
...
...
@@ -52,18 +52,7 @@ func StageLoop(
start
:=
time
.
Now
()
// Estimate the current top height seen from the peer
height
,
err
:=
TopSeenHeight
(
db
,
sync
,
initialCycle
,
hd
)
if
err
!=
nil
{
if
errors
.
Is
(
err
,
libcommon
.
ErrStopped
)
||
errors
.
Is
(
err
,
context
.
Canceled
)
{
return
}
log
.
Error
(
"Staged Sync"
,
"error"
,
err
)
if
recoveryErr
:=
hd
.
RecoverFromDb
(
db
);
recoveryErr
!=
nil
{
log
.
Error
(
"Failed to recover header downloader"
,
"error"
,
recoveryErr
)
}
continue
}
height
:=
hd
.
TopSeenHeight
()
if
err
:=
StageLoopStep
(
ctx
,
db
,
sync
,
height
,
notifications
,
initialCycle
,
updateHead
,
nil
);
err
!=
nil
{
if
errors
.
Is
(
err
,
libcommon
.
ErrStopped
)
||
errors
.
Is
(
err
,
context
.
Canceled
)
{
return
...
...
@@ -92,27 +81,6 @@ func StageLoop(
}
}
// TopSeenHeight - returns hd.TopSeenHeight() or run stages.Header once to set correct hd.TopSeenHeight()
// because headers downloading process happening in the background - means if hd.TopSeenHeight() > 0 is a
// good estimation for sync step size
func
TopSeenHeight
(
db
kv
.
RwDB
,
sync
*
stagedsync
.
Sync
,
initialCycle
bool
,
hd
*
headerdownload
.
HeaderDownload
)
(
uint64
,
error
)
{
height
:=
hd
.
TopSeenHeight
()
if
height
>
0
{
return
height
,
nil
}
if
!
initialCycle
{
return
height
,
nil
}
stagesBackup
:=
sync
.
DisableAllStages
()
defer
sync
.
EnableStages
(
stagesBackup
...
)
sync
.
EnableStages
(
stages
.
Headers
)
if
err
:=
sync
.
Run
(
db
,
nil
,
true
);
err
!=
nil
{
return
0
,
err
}
return
hd
.
TopSeenHeight
(),
nil
}
func
StageLoopStep
(
ctx
context
.
Context
,
db
kv
.
RwDB
,
...
...
@@ -144,7 +112,7 @@ func StageLoopStep(
return
err
}
canRunCycleInOneTransaction
:=
highestSeenHeader
-
origin
<
8096
&&
highestSeenHeader
-
finishProgressBefore
<
8096
canRunCycleInOneTransaction
:=
!
initialCycle
&&
highestSeenHeader
-
origin
<
8096
&&
highestSeenHeader
-
finishProgressBefore
<
8096
var
tx
kv
.
RwTx
// on this variable will run sync cycle.
if
canRunCycleInOneTransaction
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment