Skip to content

Commit b82aa15

Browse files
committed
catchpoint: handle loadFromDisk/recoverFromCrash during first stage correctly (algorand#6290)
1 parent 13de28e commit b82aa15

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ledger/catchpointtracker.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,10 +326,12 @@ func (ct *catchpointTracker) finishFirstStageAfterCrash(dbRound basics.Round, bl
326326
return err
327327
}
328328

329-
// pass dbRound+1-maxBalLookback as the onlineAccountsForgetBefore parameter: since we can't be sure whether
329+
// pass 0 as the onlineAccountsForgetBefore parameter: since we can't be sure whether
330330
// there are more than 320 rounds of history in the online accounts tables, this ensures the catchpoint
331331
// will only contain the most recent 320 rounds.
332-
onlineAccountsForgetBefore := catchpointLookbackHorizonForNextRound(dbRound, config.Consensus[blockProto])
332+
// Inside finishFirstStage, this has the same effect as the voters tracker returning a "lowestRound" of 0,
333+
// which causes finishFirstStage to calculate the correct horizon and filter out data older than dbround+1-320.
334+
onlineAccountsForgetBefore := basics.Round(0)
333335
return ct.finishFirstStage(context.Background(), dbRound, onlineAccountsForgetBefore, blockProto, 0)
334336
}
335337

0 commit comments

Comments
 (0)