Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set workers only from one sync #13284

Merged
merged 1 commit into from
Dec 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions eth/stagedsync/exec3.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ func ExecV3(ctx context.Context,
initialCycle bool,
isMining bool,
) error {
inMemExec := txc.Doms != nil

// TODO: e35 doesn't support parallel-exec yet
parallel = false //nolint
if parallel && cfg.chainConfig.ChainName == networkname.Gnosis {
Expand Down Expand Up @@ -237,16 +239,17 @@ func ExecV3(ctx context.Context,
}
}
agg := cfg.db.(state2.HasAgg).Agg().(*state2.Aggregator)
if initialCycle {
agg.SetCollateAndBuildWorkers(min(2, estimate.StateV3Collate.Workers()))
agg.SetCompressWorkers(estimate.CompressSnapshot.Workers())
} else {
agg.SetCompressWorkers(1)
agg.SetCollateAndBuildWorkers(1)
if !inMemExec && !isMining {
if initialCycle {
agg.SetCollateAndBuildWorkers(min(2, estimate.StateV3Collate.Workers()))
agg.SetCompressWorkers(estimate.CompressSnapshot.Workers())
} else {
agg.SetCompressWorkers(1)
agg.SetCollateAndBuildWorkers(1)
}
}

var err error
inMemExec := txc.Doms != nil
var doms *state2.SharedDomains
if inMemExec {
doms = txc.Doms
Expand Down
Loading