Skip to content

Commit

Permalink
update comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
algoidan committed Mar 23, 2023
1 parent 150efa2 commit 30da8b6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 3 additions & 3 deletions ledger/catchpointtracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,11 @@ type catchpointTracker struct {
// roundDigest stores the digest of the block for every round starting with dbRound+1 and every round after it.
roundDigest []crypto.Digest

// reenableCatchpointsRound is a round where the EnableOnlineAccountCatchpoints feature was enabled via the consensus.
// reenableCatchpointsRound is a round where the EnableCatchpointsWithSPContexts feature was enabled via the consensus.
// we avoid generating catchpoints before that round in order to ensure the network remain consistent in the catchpoint
// label being produced. This variable could be "wrong" in two cases -
// 1. It's zero, meaning that the EnableOnlineAccountCatchpoints has yet to be seen.
// 2. It's non-zero meaning that it the given round is after the EnableOnlineAccountCatchpoints was enabled ( it might be exact round
// 1. It's zero, meaning that the EnableCatchpointsWithSPContexts has yet to be seen.
// 2. It's non-zero meaning that it the given round is after the EnableCatchpointsWithSPContexts was enabled ( it might be exact round
// but that's only if newBlock was called with that round ), plus the lookback.
reenableCatchpointsRound basics.Round

Expand Down
6 changes: 5 additions & 1 deletion stateproof/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,11 @@ func (spw *Worker) deleteBuildData(proto *config.ConsensusParams, stateProofNext
return
}

// Delete from memory (already stored on disk)
// Delete from memory (already stored on disk). Practically, There are two scenarios where builders gets removed from memory
// 1. When a state proof is committed, the earliest will get removed and later on will be removed from disk.
// (when calling deleteStaleBuilders)
// 2. If state proofs are stalled, and consensus is moving forward, a new latest builder will be created and
// the older builder will be swapped out from memory. (i.e will be removed from memory but stays on disk).
spw.trimBuildersCache(proto, stateProofNextRound)

if spw.lastCleanupRound == stateProofNextRound {
Expand Down

0 comments on commit 30da8b6

Please sign in to comment.