You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: only attempt to refresh the signer during the next prepare phase
This handles the case where for the first block in a cycle (height %
cycle_length == 0), it will report that it is in cycle N, but it will
also report that it is in the prepare phase. This was resulting in
refreshing the signer config too early. For example, with a cycle length
of 20, at block 160, we would see a log:
```
Received a new burnchain block height (160) in the prepare phase of the
next reward cycle (9). Checking for signer registration...
```
This is incorrect, because block 160 is not in the prepare phase for
cycle 9.
let current_reward_cycle = reward_cycle_info.reward_cycle;
301
309
// We should only attempt to refresh the signer if we are not configured for the next reward cycle yet and we received a new burn block for its prepare phase
302
-
if reward_cycle_info.is_in_prepare_phase(current_burn_block_height){
310
+
if reward_cycle_info.is_in_next_prepare_phase(current_burn_block_height){
303
311
let next_reward_cycle = current_reward_cycle.saturating_add(1);
0 commit comments