File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
toolkit/committee-selection/authority-selection-inherents/src Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -143,7 +143,11 @@ where
143143 // The genesis committee epoch is initialized with 0, so in the very first block we need to provide
144144 // the epoch number based on the current timestamp
145145 if next_unset_epoch == ScEpochNumber ( 1 ) {
146- timestamp_millis
146+ // We first convert the timestamp to PC epoch number and then use the starting time of this
147+ // to ensure that all timestamps within a PC epoch produce the same candidates. This is
148+ // necessary in case the boundaries of PC epochs and MC epochs do not align.
149+ let current_pc_epoch = ( timestamp_millis / sc_epoch_duration_millis) ;
150+ current_pc_epoch / sc_epoch_duration_millis
147151 } else {
148152 next_unset_epoch. 0 * sc_epoch_duration_millis
149153 }
You can’t perform that action at this time.
0 commit comments