Skip to content

Commit

Permalink
Set workers only from one sync (#13284)
Browse files Browse the repository at this point in the history
  • Loading branch information
AskAlexSharov authored Dec 31, 2024
1 parent dd3663a commit c72c0be
Showing 1 changed file with 10 additions and 7 deletions.
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

0 comments on commit c72c0be

Please sign in to comment.