We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 85d3c12 commit efaa176Copy full SHA for efaa176
src/lib.rs
@@ -58,7 +58,15 @@ async fn generate_commit(
58
let tempo_plus_one = tempo + 1;
59
let netuid_plus_one = (netuid as u64) + 1;
60
let block_with_offset = current_block + netuid_plus_one;
61
- let current_epoch = block_with_offset / tempo_plus_one;
+
62
+ // If at an exact epoch boundary, treat this as the new epoch start.
63
+ let is_epoch_boundary = (block_with_offset % tempo_plus_one) == 0;
64
+ let base_epoch = block_with_offset / tempo_plus_one;
65
+ let current_epoch = if is_epoch_boundary {
66
+ base_epoch + 1
67
+ } else {
68
+ base_epoch
69
+ };
70
71
// Compute the reveal epoch
72
let reveal_epoch = current_epoch + subnet_reveal_period_epochs;
0 commit comments