Skip to content

Commit

Permalink
chore: update submission counts
Browse files Browse the repository at this point in the history
  • Loading branch information
anomit committed Aug 22, 2024
1 parent cf72c13 commit 3a8ce4f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkgs/helpers/prost/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func processEpoch(epochId, submissionLimit *big.Int, begin *types.Block) {
log.Errorln("TriggerCollectionFlow process log error: ", err.Error())
}

updatedDay := new(big.Int).SetUint64(((epochId.Uint64() - 1) / EpochsPerDay) + 1 + pkgs.DayBuffer)
updatedDay := new(big.Int).SetUint64(((epochId.Uint64() - 1) / EpochsPerDay) + 1 + pkgs.DayBuffer) // 2828 / 10 = 282 + 1 == 283
if updatedDay.Cmp(Day) > 0 {
prev := new(big.Int).Set(Day)
Day = new(big.Int).Set(updatedDay)
Expand Down Expand Up @@ -121,6 +121,7 @@ func triggerCollectionFlow(epochID *big.Int, headers []string, day *big.Int) {
if batchSubmissions, err := merkle.BuildBatchSubmissions(epochID, headers); err != nil {
log.Debugln("Error building batched merkle tree: ", err)
} else {
UpdateSubmissionCounts(batchSubmissions, day)
txManager.CommitSubmissionBatches(batchSubmissions)
//log.Debugf("Merkle tree built, resetting db for epoch: %d", epochID)
// remove submissions as we no longer need them
Expand All @@ -140,7 +141,7 @@ func triggerCollectionFlow(epochID *big.Int, headers []string, day *big.Int) {
log.Errorln("Redis error: ", err.Error())
}
redis.Delete(context.Background(), redis.TransactionReceiptCountByEvent(epochID.String()))
UpdateSubmissionCounts(batchSubmissions, day)

txManager.EndBatchSubmissionsForEpoch(epochID)
}
}

0 comments on commit 3a8ce4f

Please sign in to comment.