[#355] innerring: Produce container size estimation notifications

There are two notifications:
- start estimation notification produced at the beginning of the
  epoch,
- stop estimation notifications should be produced before
  basic audit settlement starts.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2021-01-29 10:48:47 +03:00 committed by Alex Vanin
parent 6848a816f9
commit 5b550bff22
5 changed files with 62 additions and 7 deletions

View file

@ -25,6 +25,15 @@ func (np *Processor) processNewEpoch(epoch uint64) {
return
}
if epoch > 0 { // estimates are invalid in genesis epoch
err = np.containerWrp.StartEstimation(epoch - 1)
if err != nil {
np.log.Warn("can't start container size estimation",
zap.Uint64("epoch", epoch),
zap.String("error", err.Error()))
}
}
np.netmapSnapshot.update(snapshot, epoch)
np.handleCleanupTick(netmapCleanupTick{epoch: epoch})
np.handleNewAudit(audit.NewAuditStartEvent(epoch))