session_info: add dispute_period and random_seed (#4547)

This commit is contained in:
Andronik Ordian
2021-12-27 10:03:50 +01:00
committed by GitHub
parent b342ae11d3
commit 9efb223a97
12 changed files with 33 additions and 0 deletions
+6
View File
@@ -34,6 +34,10 @@ pub struct SessionInfo {
/// All the validators actively participating in parachain consensus.
/// Indices are into the broader validator set.
pub active_validator_indices: Vec<v1::ValidatorIndex>,
/// A secure random seed for the session, gathered from BABE.
pub random_seed: [u8; 32],
/// The amount of sessions to keep for disputes.
pub dispute_period: v1::SessionIndex,
/****** Old fields ******/
/// Validators in canonical ordering.
@@ -87,6 +91,8 @@ impl From<v1::SessionInfo> for SessionInfo {
SessionInfo {
// new fields
active_validator_indices: Vec::new(),
random_seed: [0u8; 32],
dispute_period: 6,
// old fields
validators: old.validators,
discovery_keys: old.discovery_keys,