mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-08 09:16:00 +00:00
spec: fix shuffle direction in get_crosslink_committees_at_slot
This commit is contained in:
@@ -288,7 +288,7 @@ impl EpochCrosslinkCommitteesBuilder {
|
|||||||
self.active_validator_indices,
|
self.active_validator_indices,
|
||||||
spec.shuffle_round_count,
|
spec.shuffle_round_count,
|
||||||
&self.shuffling_seed[..],
|
&self.shuffling_seed[..],
|
||||||
true,
|
false,
|
||||||
)
|
)
|
||||||
.ok_or_else(|| Error::UnableToShuffle)?
|
.ok_or_else(|| Error::UnableToShuffle)?
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ fn do_sane_cache_test(
|
|||||||
active_indices,
|
active_indices,
|
||||||
spec.shuffle_round_count,
|
spec.shuffle_round_count,
|
||||||
&expected_seed[..],
|
&expected_seed[..],
|
||||||
true,
|
false,
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ const TOTAL_SIZE: usize = SEED_SIZE + ROUND_SIZE + POSITION_WINDOW_SIZE;
|
|||||||
/// Credits to [@protolambda](https://github.com/protolambda) for defining this algorithm.
|
/// Credits to [@protolambda](https://github.com/protolambda) for defining this algorithm.
|
||||||
///
|
///
|
||||||
/// Shuffles if `forwards == true`, otherwise un-shuffles.
|
/// Shuffles if `forwards == true`, otherwise un-shuffles.
|
||||||
|
/// It holds that: shuffle_list(shuffle_list(l, r, s, true), r, s, false) == l
|
||||||
|
/// and: shuffle_list(shuffle_list(l, r, s, false), r, s, true) == l
|
||||||
///
|
///
|
||||||
/// Returns `None` under any of the following conditions:
|
/// Returns `None` under any of the following conditions:
|
||||||
/// - `list_size == 0`
|
/// - `list_size == 0`
|
||||||
|
|||||||
Reference in New Issue
Block a user