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

approval-voting: implement some TODOs and remove v2 assignment core_indices and samples #6802

Merged
3 changes: 3 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions node/core/approval-voting/src/approval_db/v1/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
//! Version 1 of the DB schema.

use parity_scale_codec::{Decode, Encode};
use polkadot_node_primitives::approval::{AssignmentCertV2, DelayTranche};
use polkadot_node_primitives::approval::{v2::AssignmentBitfield, AssignmentCertV2, DelayTranche};
use polkadot_node_subsystem::{SubsystemError, SubsystemResult};
use polkadot_node_subsystem_util::database::{DBTransaction, Database};
use polkadot_primitives::{
Expand Down Expand Up @@ -161,11 +161,16 @@ pub struct Config {
/// Details pertaining to our assignment on a block.
#[derive(Encode, Decode, Debug, Clone, PartialEq)]
pub struct OurAssignment {
/// Our assignment certificate.
pub cert: AssignmentCertV2,
/// The tranche for which the assignment refers to.
pub tranche: DelayTranche,
/// Our validator index for the session in which the candidate was included.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does it refer to a single candidate or a few?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refers to all candidates in assignment_bitfield.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was referring to "the candidate was" part :) Should be "the candidates were"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I totally missed that :)

pub validator_index: ValidatorIndex,
// Whether the assignment has been triggered already.
/// Whether the assignment has been triggered already.
pub triggered: bool,
/// A subset of the core indices obtained from the VRF output.
pub assignment_bitfield: AssignmentBitfield,
}

/// Metadata regarding a specific tranche of assignments for a specific candidate.
Expand Down
Loading