mirror of
https://gitlab.com/pulsechaincom/lighthouse-pulse.git
synced 2025-01-08 03:51:22 +00:00
Correct get_new_shuffling. Closes #25
This commit is contained in:
parent
e79a1341e9
commit
57e3f8c465
@ -1,6 +1,7 @@
|
|||||||
use super::types::{ShardAndCommittee, ValidatorRecord, ChainConfig};
|
use super::types::{ShardAndCommittee, ValidatorRecord, ChainConfig};
|
||||||
use super::TransitionError;
|
use super::TransitionError;
|
||||||
use super::shuffle;
|
use super::shuffle;
|
||||||
|
use std::cmp::min;
|
||||||
|
|
||||||
type DelegatedSlot = Vec<ShardAndCommittee>;
|
type DelegatedSlot = Vec<ShardAndCommittee>;
|
||||||
type DelegatedCycle = Vec<DelegatedSlot>;
|
type DelegatedCycle = Vec<DelegatedSlot>;
|
||||||
@ -79,7 +80,9 @@ fn generate_cycle(
|
|||||||
|
|
||||||
let (committees_per_slot, slots_per_committee) = {
|
let (committees_per_slot, slots_per_committee) = {
|
||||||
if validator_count >= cycle_length * min_committee_size {
|
if validator_count >= cycle_length * min_committee_size {
|
||||||
let committees_per_slot = validator_count / cycle_length / (min_committee_size * 2) + 1;
|
let committees_per_slot = min(validator_count / cycle_length /
|
||||||
|
(min_committee_size * 2) + 1, shard_count /
|
||||||
|
cycle_length);
|
||||||
let slots_per_committee = 1;
|
let slots_per_committee = 1;
|
||||||
(committees_per_slot, slots_per_committee)
|
(committees_per_slot, slots_per_committee)
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user