Epoch is every 361 blocks, while it seems it should be 360
The actual length of an epoch is Tempo + 1 because of how blocks_until_next_epoch is implemented:
pub fn blocks_until_next_epoch(netuid: u16, tempo: u16, block_number: u64) -> u64 {
if tempo == 0 {
return u64::MAX;
}
let netuid_plus_one = (netuid as u64).saturating_add(1);
let tempo_plus_one = (tempo as u64).saturating_add(1);
let adjusted_block = block_number.wrapping_add(netuid_plus_one);
let remainder = adjusted_block.checked_rem(tempo_plus_one).unwrap_or(0);
(tempo as u64).saturating_sub(remainder)
}
The fix is easy, but the real task is to investigate whether this fix will have any impactful side-effects and mitigate if needed.
Initial thought is to leave it as it is. Changing the calculation would require refactors all over the place. Is this causing any problems now?
This was discussed a while ago and the conclusion was that we should leave it as it is until dynamic tempo duration is implemented. The gain of changing it by one block is none, but it'll will upset a number of things in the entire community. Slow us down... and for what?
Dynamic tempo will upset everything anyway and people will need to adjust everything for it. That's when we'll fix it.
@gztensor please close it if you agree - I doubt we'll forget about this one ha ha
Please don't change this, we already work around it. I think I discussed it with somebody at OTF ages ago.