Repository navigation
Conversation
bd9565d to
eed742b
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4274 +/- ##
==========================================
- Coverage 32.83% 32.83% -0.01%
==========================================
Files 673 673
Lines 41706 41713 +7
==========================================
+ Hits 13694 13696 +2
- Misses 28012 28017 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
roman-khimov
left a comment
There was a problem hiding this comment.
Why not resetting in error handler? This seems dangerous by default (some other timers can have problems with this).
There was a problem hiding this comment.
🟡 Changes recommended
The timer can submit the epoch transaction on every block when no valid duration is available, so the active moderate-severity issue must be fixed.
1 open issue
What changed in this PR
Updates epoch timers to keep retrying epoch ticks using the configured epoch duration when NewEpoch notifications are delayed or unavailable.
Changes:
- Replaces one-shot completion state with persistent epoch-duration scheduling.
- Reschedules the next epoch tick after each attempted handler execution.
- Stores the epoch duration during timer resets.
- A moderate issue remains when
epochDuris zero: handlers may be invoked once per block instead of preserving one-shot behavior until a valid duration is available.
| File | Description |
|---|---|
pkg/timers/timer.go |
Implements recurring epoch-tick scheduling and reset duration tracking. |
Review effort: Lite
| if et.epochDur != 0 { | ||
| et.nextTickAt = curr + et.epochDur | ||
| } |
There was a problem hiding this comment.
it does not differ much from the previous behaviour: Reset is called from the beginning of IR's journey
There was a problem hiding this comment.
fixed with providing initial epoch duration for IR app
|
This looks like the timer commit from #4272, with both issues I pointed out there fixed. |
What is "error handler"? Current IR does not wait for new epoch tx inclusion, it just sends notary request, do you want it to wait for NewEpoch notification (or vub expiration)?
There are no other timers, only the new epoch will have this exclusive opportunity. If everything is ok, it will be reset likely almost immediately by the NewEpoch event. But if smth is wrong, the next tick will, at least, happen. |
If anything blocks epoch tick, do not simply try it once and wait for the next chain "NewEpoch" notification, instead, try to predict the next tick time and never stop trying. An epoch stuck is a critical error in the system, IRs must try their best. Signed-off-by: Pavel Karpy <carpawell@nspcc.io>
eed742b to
b3ceaa5
Compare
|
@roman-khimov, treat this PR like |

If anything blocks epoch tick, do not simply try it once and wait for the next chain "NewEpoch" notification, instead, try to predict the next tick time and never stop trying. An epoch stuck is a critical error in the system, IRs must try their best.