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 4, 2023
1 parent d1138c6 commit 7a5f8ef
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.Debug("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.Debug("start estimation collection", zap.Uint64("epoch", estimationEpoch))

err = np.containerWrp.StartEstimation(prm)

if err != nil {
Expand Down

0 comments on commit 7a5f8ef

Please sign in to comment.