Skip to content

Commit

Permalink
ir: Improve estimations logs
Browse files Browse the repository at this point in the history
For debug purposes. May be dropped in the future.

Signed-off-by: Pavel Karpy <[email protected]>
  • Loading branch information
carpawell committed Aug 9, 2023
1 parent 07a69b8 commit f1969a8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion pkg/innerring/blocktimer.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,11 @@ func newEpochTimer(args *epochTimerArgs) *timer.BlockTimer {
return
}

estimationEpoch := epochN - 1
args.l.Info("stop estimation collections", zap.Uint64("epoch", estimationEpoch))

prm := container.StopEstimationPrm{}
prm.SetEpoch(epochN - 1)
prm.SetEpoch(estimationEpoch)

err := args.cnrWrapper.StopEstimation(prm)
if err != nil {
Expand Down
6 changes: 5 additions & 1 deletion pkg/innerring/processors/netmap/process_epoch.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,16 @@ func (np *Processor) processNewEpoch(ev netmapEvent.NewEpoch) {
return
}

estimationEpoch := epoch - 1

prm := cntClient.StartEstimationPrm{}

prm.SetEpoch(epoch - 1)
prm.SetEpoch(estimationEpoch)
prm.SetHash(ev.TxHash())

if epoch > 0 { // estimates are invalid in genesis epoch
np.log.Info("start estimation collection", zap.Uint64("epoch", estimationEpoch))

err = np.containerWrp.StartEstimation(prm)

if err != nil {
Expand Down

0 comments on commit f1969a8

Please sign in to comment.