Skip to content

Commit e1f8da4

Browse files
committed
remove comment about shuffling miners. we do not need to do this as we are giving them each a proportion of the daily rewards available instead of first processed first served
1 parent b2a5167 commit e1f8da4

File tree

1 file changed

+0
-21
lines changed
  • pallets/mining/rewards-allowance/src

1 file changed

+0
-21
lines changed

pallets/mining/rewards-allowance/src/lib.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -411,27 +411,6 @@ pub mod pallet {
411411
return 0;
412412
};
413413
let mut miner_count = 0;
414-
// TODO - iterate through the registered miners in random order, otherwise the same miners get the rewards each day
415-
// and possibly the same miners miss out. if the miners at the start of the list have large rewards they
416-
// could possibly exhaust the daily allocation of rewards just by themselves each day
417-
//
418-
// Kian Enigma - you can't use (arbitrary) randomness in the runtime, that simply does not add
419-
// up to how a distributed consensus system works. How can you make sure everyone executes the
420-
// same code when there's something random in it.
421-
//
422-
// TODO - Immanuel John - you can maintain another binding to check whether rewards is shared to that account or not
423-
424-
// let mut reg_dhx_miners_to_shuffle = reg_dhx_miners.clone();
425-
// let test = reg_dhx_miners
426-
// .as_slice()
427-
// // FIXME - this causes error `duplicate lang item in crate`
428-
// // .choose(&mut rand::thread_rng())
429-
// .into_iter()
430-
// .collect::<Vec<_>>();
431-
432-
// reg_dhx_miners_to_shuffle.shuffle(&mut rand::thread_rng());
433-
// log::info!("reg_dhx_miners: {:#?}", &reg_dhx_miners);
434-
// log::info!("shuffled_reg_dhx_miners: {:#?}", reg_dhx_miners_to_shuffle.clone());
435414

436415
for (index, miner) in reg_dhx_miners.iter().enumerate() {
437416
miner_count += 1;

0 commit comments

Comments
 (0)