Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Use a more typesafe approach for managing indexed data #6150

Merged
merged 46 commits into from
Oct 22, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
b5c02e8
Fix for issue #2403
tifecool Oct 13, 2022
954d392
Merge branch 'paritytech:master' into fix2403
tifecool Oct 13, 2022
ce8aba9
Nightly fmt
tifecool Oct 13, 2022
b5a7bfc
Quick documentation fixes
tifecool Oct 14, 2022
5da6693
Default Implementation
tifecool Oct 14, 2022
b90fc1e
iter() function integrated
tifecool Oct 14, 2022
557eebb
Implemented iter functionalities
tifecool Oct 15, 2022
09cc765
Fmt
tifecool Oct 15, 2022
3a6e327
small change
tifecool Oct 15, 2022
aba5837
updates node-network
tifecool Oct 15, 2022
dbac388
updates in dispute-coordinator
tifecool Oct 16, 2022
f1b8b4f
Updates
tifecool Oct 18, 2022
8696f93
benchmarking fix
tifecool Oct 18, 2022
4d10ca1
minor fix
tifecool Oct 18, 2022
95a3881
test fixes in runtime api
tifecool Oct 18, 2022
71fc436
Merge branch 'paritytech:master' into fix2403
tifecool Oct 18, 2022
4951b54
Update primitives/src/v2/mod.rs
tifecool Oct 19, 2022
35c1304
Update primitives/src/v2/mod.rs
tifecool Oct 19, 2022
a0edab4
Update primitives/src/v2/mod.rs
tifecool Oct 19, 2022
3823be1
Update primitives/src/v2/mod.rs
tifecool Oct 19, 2022
5714ad4
Update primitives/src/v2/mod.rs
tifecool Oct 19, 2022
7a8be34
Removal of [index], shorting of FromIterator, Renaming of GroupValida…
tifecool Oct 19, 2022
c3a1e72
Merge remote-tracking branch 'origin/fix2403' into fix2403
tifecool Oct 19, 2022
56b3904
Removal of ops import
tifecool Oct 19, 2022
a0bb41b
documentation fixes for spell check
tifecool Oct 19, 2022
ef5438c
implementation of generic type
tifecool Oct 20, 2022
4e825d0
Refactoring
tifecool Oct 21, 2022
f127cb4
Test and documentation fixes
tifecool Oct 21, 2022
06ecd6a
minor test fix
tifecool Oct 21, 2022
efa2278
minor test fix
tifecool Oct 21, 2022
cfca9b4
minor test fix
tifecool Oct 21, 2022
e6f685f
Update node/network/statement-distribution/src/lib.rs
tifecool Oct 21, 2022
33e3102
Update primitives/src/v2/mod.rs
tifecool Oct 21, 2022
e4d548b
Update primitives/src/v2/mod.rs
tifecool Oct 21, 2022
dee6396
removed IterMut
tifecool Oct 21, 2022
956a62e
Update node/core/dispute-coordinator/src/import.rs
tifecool Oct 21, 2022
1aba477
Update node/core/dispute-coordinator/src/initialized.rs
tifecool Oct 21, 2022
9025b12
Merge remote-tracking branch 'origin/fix2403' into fix2403
tifecool Oct 21, 2022
37cccf6
Update primitives/src/v2/mod.rs
tifecool Oct 21, 2022
f03adc0
fmt
tifecool Oct 21, 2022
bdc316c
IterMut
tifecool Oct 21, 2022
5ca768f
documentation update
tifecool Oct 21, 2022
2ee57d4
minor adjustments and new TypeIndex trait
tifecool Oct 21, 2022
be785f9
Merge remote-tracking branch 'origin/fix2403' into fix2403
tifecool Oct 21, 2022
6d87954
spelling fix
tifecool Oct 21, 2022
a2ae881
TypeIndex fix
tifecool Oct 21, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Removal of [index], shorting of FromIterator, Renaming of GroupValida…
…tors to ValidatorGroups
  • Loading branch information
tifecool committed Oct 19, 2022
commit 7a8be345ad12b8e85c124345a0a12ea520a5345b
14 changes: 7 additions & 7 deletions node/core/approval-voting/src/criteria.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ use polkadot_node_primitives::approval::{
self as approval_types, AssignmentCert, AssignmentCertKind, DelayTranche, RelayVRFStory,
};
use polkadot_primitives::v2::{
AssignmentId, AssignmentPair, CandidateHash, CoreIndex, GroupIndex, GroupValidators,
SessionInfo, ValidatorIndex,
AssignmentId, AssignmentPair, CandidateHash, CoreIndex, GroupIndex, SessionInfo,
ValidatorGroups, ValidatorIndex,
};
use sc_keystore::LocalKeystore;
use sp_application_crypto::ByteArray;
Expand Down Expand Up @@ -139,7 +139,7 @@ pub(crate) struct Config {
/// The assignment public keys for validators.
assignment_keys: Vec<AssignmentId>,
/// The groups of validators assigned to each core.
validator_groups: GroupValidators,
validator_groups: ValidatorGroups,
/// The number of availability cores used by the protocol during this session.
n_cores: u32,
/// The zeroth delay tranche width.
Expand Down Expand Up @@ -542,7 +542,7 @@ pub(crate) fn check_assignment_cert(
}

fn is_in_backing_group(
validator_groups: &GroupValidators,
validator_groups: &ValidatorGroups,
validator: ValidatorIndex,
group: GroupIndex,
) -> bool {
Expand Down Expand Up @@ -591,7 +591,7 @@ mod tests {
.collect()
}

fn basic_groups(n_validators: usize, n_groups: usize) -> GroupValidators {
fn basic_groups(n_validators: usize, n_groups: usize) -> ValidatorGroups {
let size = n_validators / n_groups;
let big_groups = n_validators % n_groups;
let scraps = n_groups * size;
Expand Down Expand Up @@ -632,7 +632,7 @@ mod tests {
Sr25519Keyring::Bob,
Sr25519Keyring::Charlie,
]),
validator_groups: GroupValidators::from(vec![
validator_groups: ValidatorGroups::from(vec![
vec![ValidatorIndex(0)],
vec![ValidatorIndex(1), ValidatorIndex(2)],
]),
Expand Down Expand Up @@ -667,7 +667,7 @@ mod tests {
Sr25519Keyring::Bob,
Sr25519Keyring::Charlie,
]),
validator_groups: GroupValidators::from(vec![
validator_groups: ValidatorGroups::from(vec![
vec![ValidatorIndex(0)],
vec![ValidatorIndex(1), ValidatorIndex(2)],
]),
Expand Down
4 changes: 2 additions & 2 deletions node/core/approval-voting/src/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ pub(crate) mod tests {
use polkadot_node_subsystem_test_helpers::make_subsystem_context;
use polkadot_node_subsystem_util::database::Database;
use polkadot_primitives::v2::{
GroupValidators, Id as ParaId, SessionInfo, ValidatorIndex, Validators,
Id as ParaId, SessionInfo, ValidatorGroups, ValidatorIndex, Validators,
};
pub(crate) use sp_consensus_babe::{
digests::{CompatibleDigestItem, PreDigest, SecondaryVRFPreDigest},
Expand Down Expand Up @@ -1180,7 +1180,7 @@ pub(crate) mod tests {
validators: Validators::from(vec![Sr25519Keyring::Alice.public().into(); 6]),
discovery_keys: Vec::new(),
assignment_keys: Vec::new(),
validator_groups: GroupValidators::from(vec![
validator_groups: ValidatorGroups::from(vec![
vec![ValidatorIndex(0); 5],
vec![ValidatorIndex(0); 2],
]),
Expand Down
20 changes: 10 additions & 10 deletions node/core/approval-voting/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ use polkadot_node_subsystem_test_helpers as test_helpers;
use polkadot_node_subsystem_util::TimeoutExt;
use polkadot_overseer::HeadSupportsParachains;
use polkadot_primitives::v2::{
CandidateCommitments, CandidateEvent, CoreIndex, GroupIndex, GroupValidators, Header,
Id as ParaId, ValidationCode, ValidatorSignature,
CandidateCommitments, CandidateEvent, CoreIndex, GroupIndex, Header, Id as ParaId,
ValidationCode, ValidatorGroups, ValidatorSignature,
};
use std::time::Duration;

Expand Down Expand Up @@ -739,7 +739,7 @@ fn session_info(keys: &[Sr25519Keyring]) -> SessionInfo {
validators: keys.iter().map(|v| v.public().into()).collect(),
discovery_keys: keys.iter().map(|v| v.public().into()).collect(),
assignment_keys: keys.iter().map(|v| v.public().into()).collect(),
validator_groups: GroupValidators::from(vec![
validator_groups: ValidatorGroups::from(vec![
vec![ValidatorIndex(0)],
vec![ValidatorIndex(1)],
]),
Expand Down Expand Up @@ -1555,7 +1555,7 @@ fn subsystem_second_approval_import_only_schedules_wakeups() {
Sr25519Keyring::Eve,
];
let session_info = SessionInfo {
validator_groups: GroupValidators::from(vec![
validator_groups: ValidatorGroups::from(vec![
vec![ValidatorIndex(0), ValidatorIndex(1)],
vec![ValidatorIndex(2)],
vec![ValidatorIndex(3), ValidatorIndex(4)],
Expand Down Expand Up @@ -1892,7 +1892,7 @@ fn import_checked_approval_updates_entries_and_schedules() {
Sr25519Keyring::Eve,
];
let session_info = SessionInfo {
validator_groups: GroupValidators::from(vec![
validator_groups: ValidatorGroups::from(vec![
vec![ValidatorIndex(0), ValidatorIndex(1)],
vec![ValidatorIndex(2)],
vec![ValidatorIndex(3), ValidatorIndex(4)],
Expand Down Expand Up @@ -2049,7 +2049,7 @@ fn subsystem_import_checked_approval_sets_one_block_bit_at_a_time() {
Sr25519Keyring::Eve,
];
let session_info = SessionInfo {
validator_groups: GroupValidators::from(vec![
validator_groups: ValidatorGroups::from(vec![
vec![ValidatorIndex(0), ValidatorIndex(1)],
vec![ValidatorIndex(2)],
vec![ValidatorIndex(3), ValidatorIndex(4)],
Expand Down Expand Up @@ -2339,7 +2339,7 @@ fn subsystem_validate_approvals_cache() {
Sr25519Keyring::Eve,
];
let session_info = SessionInfo {
validator_groups: GroupValidators::from(vec![
validator_groups: ValidatorGroups::from(vec![
vec![ValidatorIndex(0), ValidatorIndex(1)],
vec![ValidatorIndex(2)],
vec![ValidatorIndex(3), ValidatorIndex(4)],
Expand Down Expand Up @@ -2551,7 +2551,7 @@ where
Sr25519Keyring::Ferdie,
];
let session_info = SessionInfo {
validator_groups: GroupValidators::from(vec![
validator_groups: ValidatorGroups::from(vec![
vec![ValidatorIndex(0), ValidatorIndex(1)],
vec![ValidatorIndex(2), ValidatorIndex(3)],
vec![ValidatorIndex(4), ValidatorIndex(5)],
Expand Down Expand Up @@ -2871,7 +2871,7 @@ fn pre_covers_dont_stall_approval() {
Sr25519Keyring::One,
];
let session_info = SessionInfo {
validator_groups: GroupValidators::from(vec![
validator_groups: ValidatorGroups::from(vec![
vec![ValidatorIndex(0), ValidatorIndex(1)],
vec![ValidatorIndex(2), ValidatorIndex(5)],
vec![ValidatorIndex(3), ValidatorIndex(4)],
Expand Down Expand Up @@ -3048,7 +3048,7 @@ fn waits_until_approving_assignments_are_old_enough() {
Sr25519Keyring::One,
];
let session_info = SessionInfo {
validator_groups: GroupValidators::from(vec![
validator_groups: ValidatorGroups::from(vec![
vec![ValidatorIndex(0), ValidatorIndex(1)],
vec![ValidatorIndex(2), ValidatorIndex(5)],
vec![ValidatorIndex(3), ValidatorIndex(4)],
Expand Down
2 changes: 1 addition & 1 deletion node/core/dispute-coordinator/src/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ impl ImportResult {
for (index, sig) in approval_votes.into_iter() {
debug_assert!(
{
let pub_key = &env.session_info().validators[index];
let pub_key = &env.session_info().validators.get(index).expect("<write an actual proof here; qed>");
tifecool marked this conversation as resolved.
Show resolved Hide resolved
let candidate_hash = votes.candidate_receipt.hash();
let session_index = env.session_index();
DisputeStatement::Valid(ValidDisputeStatementKind::ApprovalChecking)
Expand Down
2 changes: 1 addition & 1 deletion node/core/dispute-coordinator/src/initialized.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,7 @@ impl Initialized {
valid,
candidate_hash,
session,
env.validators()[*index].clone(),
env.validators().get(*index).expect("<write an actual proof here; qed>").clone(),
tifecool marked this conversation as resolved.
Show resolved Hide resolved
)
.await;

Expand Down
10 changes: 5 additions & 5 deletions node/core/dispute-coordinator/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ use polkadot_node_subsystem::{
use polkadot_node_subsystem_test_helpers::{make_subsystem_context, TestSubsystemContextHandle};
use polkadot_primitives::v2::{
ApprovalVote, BlockNumber, CandidateCommitments, CandidateHash, CandidateReceipt,
DisputeStatement, GroupValidators, Hash, Header, MultiDisputeStatementSet, ScrapedOnChainVotes,
SessionIndex, SessionInfo, SigningContext, ValidDisputeStatementKind, ValidatorId,
DisputeStatement, Hash, Header, MultiDisputeStatementSet, ScrapedOnChainVotes, SessionIndex,
SessionInfo, SigningContext, ValidDisputeStatementKind, ValidatorGroups, ValidatorId,
ValidatorIndex, ValidatorSignature, Validators,
};

Expand Down Expand Up @@ -126,7 +126,7 @@ impl MockClock {
struct TestState {
validators: Vec<Pair>,
validator_public: Validators,
validator_groups: GroupValidators,
validator_groups: ValidatorGroups,
master_keystore: Arc<sc_keystore::LocalKeystore>,
subsystem_keystore: Arc<sc_keystore::LocalKeystore>,
db: Arc<dyn Database>,
Expand Down Expand Up @@ -163,7 +163,7 @@ impl Default for TestState {
.map(|k| ValidatorId::from(k.0.public()))
.collect();

let validator_groups = GroupValidators::from(vec![
let validator_groups = ValidatorGroups::from(vec![
vec![ValidatorIndex(0), ValidatorIndex(1)],
vec![ValidatorIndex(2), ValidatorIndex(3)],
vec![ValidatorIndex(4), ValidatorIndex(5), ValidatorIndex(6)],
Expand Down Expand Up @@ -431,7 +431,7 @@ impl TestState {
session: SessionIndex,
valid: bool,
) -> SignedDisputeStatement {
let public = self.validator_public[index].clone();
let public = self.validator_public.get(index).unwrap().clone();

let keystore = self.master_keystore.clone() as SyncCryptoStorePtr;

Expand Down
6 changes: 3 additions & 3 deletions node/network/availability-distribution/src/tests/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ use polkadot_erasure_coding::{branches, obtain_chunks_v1 as obtain_chunks};
use polkadot_node_primitives::{AvailableData, BlockData, ErasureChunk, PoV, Proof};
use polkadot_primitives::v2::{
CandidateCommitments, CandidateDescriptor, CandidateHash, CommittedCandidateReceipt,
GroupIndex, GroupValidators, Hash, HeadData, Id as ParaId, OccupiedCore,
PersistedValidationData, SessionInfo, ValidatorIndex,
GroupIndex, Hash, HeadData, Id as ParaId, OccupiedCore, PersistedValidationData, SessionInfo,
ValidatorGroups, ValidatorIndex,
};
use polkadot_primitives_test_helpers::{
dummy_collator, dummy_collator_signature, dummy_hash, dummy_validation_code,
Expand All @@ -43,7 +43,7 @@ pub fn make_session_info() -> SessionInfo {
Sr25519Keyring::One,
];

let validator_groups: GroupValidators = [vec![5, 0, 3], vec![1, 6, 2, 4]]
let validator_groups: ValidatorGroups = [vec![5, 0, 3], vec![1, 6, 2, 4]]
.iter()
.map(|g| g.into_iter().map(|v| ValidatorIndex(*v)).collect())
.collect();
Expand Down
4 changes: 2 additions & 2 deletions node/network/availability-recovery/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ use polkadot_node_subsystem::{
use polkadot_node_subsystem_test_helpers::{make_subsystem_context, TestSubsystemContextHandle};
use polkadot_node_subsystem_util::TimeoutExt;
use polkadot_primitives::v2::{
AuthorityDiscoveryId, GroupValidators, Hash, HeadData, PersistedValidationData,
AuthorityDiscoveryId, Hash, HeadData, PersistedValidationData, ValidatorGroups,
};
use polkadot_primitives_test_helpers::{dummy_candidate_receipt, dummy_hash};

Expand Down Expand Up @@ -220,7 +220,7 @@ impl TestState {
validators: self.validator_public.clone(),
discovery_keys: self.validator_authority_id.clone(),
// all validators in the same group.
validator_groups: GroupValidators::from(vec![(0..self.validators.len()).map(|i| ValidatorIndex(i as _)).collect()]),
validator_groups: ValidatorGroups::from(vec![(0..self.validators.len()).map(|i| ValidatorIndex(i as _)).collect()]),
assignment_keys: vec![],
n_cores: 0,
zeroth_delay_tranche_width: 0,
Expand Down
2 changes: 1 addition & 1 deletion node/network/collator-protocol/src/collator_side/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ impl TestState {
fn current_group_validator_indices(&self) -> &[ValidatorIndex] {
let core_num = self.availability_cores.len();
let GroupIndex(group_idx) = self.group_rotation_info.group_for_core(CoreIndex(0), core_num);
&self.session_info.validator_groups[GroupIndex::from(group_idx)]
&self.session_info.validator_groups.get(GroupIndex::from(group_idx)).unwrap()
}

fn current_session_index(&self) -> SessionIndex {
Expand Down
4 changes: 2 additions & 2 deletions node/network/gossip-support/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ use polkadot_node_subsystem::{
};
use polkadot_node_subsystem_test_helpers as test_helpers;
use polkadot_node_subsystem_util::TimeoutExt as _;
use polkadot_primitives::v2::GroupValidators;
use polkadot_primitives::v2::ValidatorGroups;
use test_helpers::mock::make_ferdie_keystore;

use super::*;
Expand Down Expand Up @@ -220,7 +220,7 @@ fn make_session_info() -> SessionInfo {
validators: AUTHORITY_KEYRINGS.iter().map(|k| k.public().into()).collect(),
discovery_keys: AUTHORITIES.clone(),
assignment_keys: AUTHORITY_KEYRINGS.iter().map(|k| k.public().into()).collect(),
validator_groups: GroupValidators::from(vec![all_validator_indices]),
validator_groups: ValidatorGroups::from(vec![all_validator_indices]),
n_cores: 1,
zeroth_delay_tranche_width: 1,
relay_vrf_modulo_samples: 1,
Expand Down
5 changes: 4 additions & 1 deletion node/network/statement-distribution/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2072,7 +2072,10 @@ impl<R: rand::Rng> StatementDistributionSubsystem<R> {
// directly:
let group_peers = {
if let Some(our_group) = validator_info.our_group {
let our_group = &session_info.validator_groups[our_group];
let our_group = &session_info
.validator_groups
.get(our_group)
.expect("<write an actual proof here; qed>");
tifecool marked this conversation as resolved.
Show resolved Hide resolved

our_group
.into_iter()
Expand Down
4 changes: 2 additions & 2 deletions node/network/statement-distribution/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ use polkadot_node_subsystem::{
};
use polkadot_node_subsystem_test_helpers::mock::make_ferdie_keystore;
use polkadot_primitives::v2::{
GroupValidators, Hash, Id as ParaId, SessionInfo, ValidationCode, ValidatorId,
Hash, Id as ParaId, SessionInfo, ValidationCode, ValidatorGroups, ValidatorId,
};
use polkadot_primitives_test_helpers::{
dummy_committed_candidate_receipt, dummy_hash, AlwaysZeroRng,
Expand Down Expand Up @@ -2321,7 +2321,7 @@ fn handle_multiple_seconded_statements() {
}

fn make_session_info(validators: Vec<Pair>, groups: Vec<Vec<u32>>) -> SessionInfo {
let validator_groups: GroupValidators = groups
let validator_groups: ValidatorGroups = groups
.iter()
.map(|g| g.into_iter().map(|v| ValidatorIndex(*v)).collect())
.collect();
Expand Down
46 changes: 10 additions & 36 deletions primitives/src/v2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1579,14 +1579,6 @@ impl CompactStatement {
#[cfg_attr(feature = "std", derive(PartialEq, MallocSizeOf))]
pub struct Validators(Vec<ValidatorId>);

impl Index<ValidatorIndex> for Validators {
type Output = ValidatorId;

fn index(&self, index: ValidatorIndex) -> &Self::Output {
&self.0.get(index.0 as usize).unwrap()
}
}

impl From<Vec<ValidatorId>> for Validators {
fn from(validators: Vec<ValidatorId>) -> Self {
Validators(validators)
Expand All @@ -1595,12 +1587,7 @@ impl From<Vec<ValidatorId>> for Validators {

impl FromIterator<ValidatorId> for Validators {
fn from_iter<T: IntoIterator<Item = ValidatorId>>(iter: T) -> Self {
let mut validators = Vec::new();

for i in iter {
validators.push(i);
}
Validators(validators)
Self(Vec::from_iter(iter))
}
}

Expand Down Expand Up @@ -1641,37 +1628,24 @@ impl Validators {
}
}

/// GroupValidators struct indexed by GroupIndex.
/// ValidatorGroups struct indexed by GroupIndex.
#[derive(Clone, Encode, Decode, RuntimeDebug, TypeInfo, Default)]
#[cfg_attr(feature = "std", derive(PartialEq, MallocSizeOf))]
pub struct GroupValidators(Vec<Vec<ValidatorIndex>>);
pub struct ValidatorGroups(Vec<Vec<ValidatorIndex>>);

impl Index<GroupIndex> for GroupValidators {
type Output = Vec<ValidatorIndex>;

fn index(&self, index: GroupIndex) -> &Self::Output {
self.0.get(index.0 as usize).unwrap()
}
}

impl From<Vec<Vec<ValidatorIndex>>> for GroupValidators {
impl From<Vec<Vec<ValidatorIndex>>> for ValidatorGroups {
fn from(group_validators: Vec<Vec<ValidatorIndex>>) -> Self {
GroupValidators(group_validators)
ValidatorGroups(group_validators)
}
}

impl FromIterator<Vec<ValidatorIndex>> for GroupValidators {
impl FromIterator<Vec<ValidatorIndex>> for ValidatorGroups {
fn from_iter<T: IntoIterator<Item = Vec<ValidatorIndex>>>(iter: T) -> Self {
let mut validator_groups = Vec::new();

for i in iter {
validator_groups.push(i);
}
GroupValidators(validator_groups)
Self(Vec::from_iter(iter))
}
}

impl GroupValidators {
impl ValidatorGroups {
/// Returns a reference to an element indexed using GroupIndex.
tifecool marked this conversation as resolved.
Show resolved Hide resolved
pub fn get(&self, index: GroupIndex) -> Option<&Vec<ValidatorIndex>> {
self.0.get(index.0 as usize)
Expand Down Expand Up @@ -1765,7 +1739,7 @@ pub struct SessionInfo {
/// Validators in shuffled ordering - these are the validator groups as produced
/// by the `Scheduler` module for the session and are typically referred to by
/// `GroupIndex`.
pub validator_groups: GroupValidators,
pub validator_groups: ValidatorGroups,
/// The number of availability cores used by the protocol during this session.
pub n_cores: u32,
/// The zeroth delay tranche width.
Expand Down Expand Up @@ -1841,7 +1815,7 @@ pub struct OldV1SessionInfo {
/// Validators in shuffled ordering - these are the validator groups as produced
/// by the `Scheduler` module for the session and are typically referred to by
/// `GroupIndex`.
pub validator_groups: GroupValidators,
pub validator_groups: ValidatorGroups,
/// The number of availability cores used by the protocol during this session.
pub n_cores: u32,
/// The zeroth delay tranche width.
Expand Down
Loading