diff --git a/api/service/stagedstreamsync/staged_stream_sync.go b/api/service/stagedstreamsync/staged_stream_sync.go index a4e04dff3..03340eb15 100644 --- a/api/service/stagedstreamsync/staged_stream_sync.go +++ b/api/service/stagedstreamsync/staged_stream_sync.go @@ -266,7 +266,7 @@ func New( logger zerolog.Logger, ) *StagedStreamSync { - forwardStages := make([]*Stage, len(stagesList)) + forwardStages := make([]*Stage, len(StagesForwardOrder)) for i, stageIndex := range StagesForwardOrder { for _, s := range stagesList { if s.ID == stageIndex { @@ -276,7 +276,7 @@ func New( } } - revertStages := make([]*Stage, len(stagesList)) + revertStages := make([]*Stage, len(StagesRevertOrder)) for i, stageIndex := range StagesRevertOrder { for _, s := range stagesList { if s.ID == stageIndex { @@ -286,7 +286,7 @@ func New( } } - pruneStages := make([]*Stage, len(stagesList)) + pruneStages := make([]*Stage, len(StagesCleanUpOrder)) for i, stageIndex := range StagesCleanUpOrder { for _, s := range stagesList { if s.ID == stageIndex { diff --git a/api/service/stagedstreamsync/syncing.go b/api/service/stagedstreamsync/syncing.go index d2457a526..03043525b 100644 --- a/api/service/stagedstreamsync/syncing.go +++ b/api/service/stagedstreamsync/syncing.go @@ -118,22 +118,11 @@ 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, mainDB, - stages, + defaultStages, isBeaconNode, protocol, isBeaconNode,