|
|
|
@ -94,7 +94,10 @@ func CreateStagedSync(ctx context.Context, |
|
|
|
|
lastMileCfg := NewStageLastMileCfg(ctx, bc, mainDB) |
|
|
|
|
stageFinishCfg := NewStageFinishCfg(mainDB) |
|
|
|
|
|
|
|
|
|
stages := DefaultStages(ctx, |
|
|
|
|
// init stages order based on sync mode
|
|
|
|
|
initStagesOrder(config.SyncMode) |
|
|
|
|
|
|
|
|
|
defaultStages := DefaultStages(ctx, |
|
|
|
|
stageHeadsCfg, |
|
|
|
|
stageSyncEpochCfg, |
|
|
|
|
stageShortRangeCfg, |
|
|
|
@ -115,6 +118,17 @@ func CreateStagedSync(ctx context.Context, |
|
|
|
|
Int("minStreams", config.MinStreams). |
|
|
|
|
Msg(WrapStagedSyncMsg("staged sync created successfully")) |
|
|
|
|
|
|
|
|
|
var stages []*Stage |
|
|
|
|
// if any of the default stages doesn't exist in forward order, delete it from the list of stages
|
|
|
|
|
for _, stg := range defaultStages { |
|
|
|
|
for _, stageID := range StagesForwardOrder { |
|
|
|
|
if stg.ID == stageID { |
|
|
|
|
stages = append(stages, stg) |
|
|
|
|
break |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return New( |
|
|
|
|
bc, |
|
|
|
|
consensus, |
|
|
|
|