Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
280 changes: 141 additions & 139 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions node/core/approval-voting/src/aux_schema/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ use polkadot_primitives::v1::{
ValidatorIndex, GroupIndex, CandidateReceipt, SessionIndex, CoreIndex,
BlockNumber, Hash, CandidateHash,
};
use sp_consensus_slots::SlotNumber;
use sp_consensus_slots::Slot;
use parity_scale_codec::{Encode, Decode};

use std::collections::{BTreeMap, HashMap};
Expand Down Expand Up @@ -94,7 +94,7 @@ pub(crate) struct CandidateEntry {
pub(crate) struct BlockEntry {
block_hash: Hash,
session: SessionIndex,
slot: SlotNumber,
slot: Slot,
relay_vrf_story: RelayVRF,
// The candidates included as-of this block and the index of the core they are
// leaving. Sorted ascending by core index.
Expand Down
2 changes: 1 addition & 1 deletion node/core/approval-voting/src/aux_schema/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ fn make_block_entry(
BlockEntry {
block_hash,
session: 1,
slot: 1,
slot: 1.into(),
relay_vrf_story: RelayVRF([0u8; 32]),
approved_bitfield: make_bitvec(candidates.len()),
candidates,
Expand Down
22 changes: 11 additions & 11 deletions node/network/approval-distribution/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ fn try_import_the_same_assignment() {
parent_hash,
number: 2,
candidates: vec![Default::default(); 1],
slot_number: 1,
slot: 1.into(),
};
let msg = ApprovalDistributionMessage::NewBlocks(vec![meta]);
overseer_send(overseer, msg).await;
Expand Down Expand Up @@ -288,7 +288,7 @@ fn spam_attack_results_in_negative_reputation_change() {
parent_hash,
number: 2,
candidates: vec![Default::default(); candidates_count],
slot_number: 1,
slot: 1.into(),
};

let msg = ApprovalDistributionMessage::NewBlocks(vec![meta]);
Expand Down Expand Up @@ -363,7 +363,7 @@ fn import_approval_happy_path() {
parent_hash,
number: 1,
candidates: vec![Default::default(); 1],
slot_number: 1,
slot: 1.into(),
};
let msg = ApprovalDistributionMessage::NewBlocks(vec![meta]);
overseer_send(overseer, msg).await;
Expand Down Expand Up @@ -447,7 +447,7 @@ fn import_approval_bad() {
parent_hash,
number: 1,
candidates: vec![Default::default(); 1],
slot_number: 1,
slot: 1.into(),
};
let msg = ApprovalDistributionMessage::NewBlocks(vec![meta]);
overseer_send(overseer, msg).await;
Expand Down Expand Up @@ -521,21 +521,21 @@ fn update_our_view() {
parent_hash,
number: 1,
candidates: vec![Default::default(); 1],
slot_number: 1,
slot: 1.into(),
};
let meta_b = BlockApprovalMeta {
hash: hash_b,
parent_hash: hash_a,
number: 2,
candidates: vec![Default::default(); 1],
slot_number: 1,
slot: 1.into(),
};
let meta_c = BlockApprovalMeta {
hash: hash_c,
parent_hash: hash_b,
number: 3,
candidates: vec![Default::default(); 1],
slot_number: 1,
slot: 1.into(),
};

let msg = ApprovalDistributionMessage::NewBlocks(vec![meta_a, meta_b, meta_c]);
Expand Down Expand Up @@ -591,21 +591,21 @@ fn update_peer_view() {
parent_hash,
number: 1,
candidates: vec![Default::default(); 1],
slot_number: 1,
slot: 1.into(),
};
let meta_b = BlockApprovalMeta {
hash: hash_b,
parent_hash: hash_a,
number: 2,
candidates: vec![Default::default(); 1],
slot_number: 1,
slot: 1.into(),
};
let meta_c = BlockApprovalMeta {
hash: hash_c,
parent_hash: hash_b,
number: 3,
candidates: vec![Default::default(); 1],
slot_number: 1,
slot: 1.into(),
};

let msg = ApprovalDistributionMessage::NewBlocks(vec![meta_a, meta_b, meta_c]);
Expand Down Expand Up @@ -742,7 +742,7 @@ fn import_remotely_then_locally() {
parent_hash,
number: 1,
candidates: vec![Default::default(); 1],
slot_number: 1,
slot: 1.into(),
};
let msg = ApprovalDistributionMessage::NewBlocks(vec![meta]);
overseer_send(overseer, msg).await;
Expand Down
6 changes: 3 additions & 3 deletions node/primitives/src/approval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
//! Types relevant for approval.

pub use sp_consensus_vrf::schnorrkel::{VRFOutput, VRFProof};
pub use sp_consensus_slots::SlotNumber;
pub use sp_consensus_slots::Slot;

use polkadot_primitives::v1::{
CandidateHash, Hash, ValidatorIndex, Signed, ValidatorSignature, CoreIndex,
Expand Down Expand Up @@ -118,6 +118,6 @@ pub struct BlockApprovalMeta {
/// The candidates included by the block.
/// Note that these are not the same as the candidates that appear within the block body.
pub candidates: Vec<CandidateHash>,
/// The consensus slot number of the block.
pub slot_number: SlotNumber,
/// The consensus slot of the block.
pub slot: Slot,
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ struct CandidateEntry {
struct BlockEntry {
block_hash: Hash,
session: SessionIndex,
slot: SlotNumber,
slot: Slot,
// random bytes derived from the VRF submitted within the block by the block
// author as a credential and used as input to approval assignment criteria.
relay_vrf_story: [u8; 32],
Expand Down
4 changes: 2 additions & 2 deletions roadmap/implementers-guide/src/types/overseer-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ struct BlockApprovalMeta {
/// The candidates included by the block. Note that these are not the same as the candidates that appear within the
/// block body.
candidates: Vec<CandidateHash>,
/// The consensus slot number of the block.
slot_number: SlotNumber,
/// The consensus slot of the block.
slot: Slot,
}

enum ApprovalDistributionMessage {
Expand Down
4 changes: 2 additions & 2 deletions runtime/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1240,7 +1240,7 @@ sp_api::impl_runtime_apis! {
}
}

fn current_epoch_start() -> babe_primitives::SlotNumber {
fn current_epoch_start() -> babe_primitives::Slot {
Babe::current_epoch_start()
}

Expand All @@ -1253,7 +1253,7 @@ sp_api::impl_runtime_apis! {
}

fn generate_key_ownership_proof(
_slot_number: babe_primitives::SlotNumber,
_slot: babe_primitives::Slot,
authority_id: babe_primitives::AuthorityId,
) -> Option<babe_primitives::OpaqueKeyOwnershipProof> {
use parity_scale_codec::Encode;
Expand Down
4 changes: 2 additions & 2 deletions runtime/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1235,7 +1235,7 @@ sp_api::impl_runtime_apis! {
}
}

fn current_epoch_start() -> babe_primitives::SlotNumber {
fn current_epoch_start() -> babe_primitives::Slot {
Babe::current_epoch_start()
}

Expand All @@ -1248,7 +1248,7 @@ sp_api::impl_runtime_apis! {
}

fn generate_key_ownership_proof(
_slot_number: babe_primitives::SlotNumber,
_slot: babe_primitives::Slot,
authority_id: babe_primitives::AuthorityId,
) -> Option<babe_primitives::OpaqueKeyOwnershipProof> {
use parity_scale_codec::Encode;
Expand Down
4 changes: 2 additions & 2 deletions runtime/rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ sp_api::impl_runtime_apis! {
}
}

fn current_epoch_start() -> babe_primitives::SlotNumber {
fn current_epoch_start() -> babe_primitives::Slot {
Babe::current_epoch_start()
}

Expand All @@ -817,7 +817,7 @@ sp_api::impl_runtime_apis! {
}

fn generate_key_ownership_proof(
_slot_number: babe_primitives::SlotNumber,
_slot: babe_primitives::Slot,
authority_id: babe_primitives::AuthorityId,
) -> Option<babe_primitives::OpaqueKeyOwnershipProof> {
use parity_scale_codec::Encode;
Expand Down
4 changes: 2 additions & 2 deletions runtime/test-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ sp_api::impl_runtime_apis! {
}
}

fn current_epoch_start() -> babe_primitives::SlotNumber {
fn current_epoch_start() -> babe_primitives::Slot {
Babe::current_epoch_start()
}

Expand All @@ -748,7 +748,7 @@ sp_api::impl_runtime_apis! {
}

fn generate_key_ownership_proof(
_slot_number: babe_primitives::SlotNumber,
_slot: babe_primitives::Slot,
_authority_id: babe_primitives::AuthorityId,
) -> Option<babe_primitives::OpaqueKeyOwnershipProof> {
None
Expand Down
4 changes: 2 additions & 2 deletions runtime/westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@ sp_api::impl_runtime_apis! {
}
}

fn current_epoch_start() -> babe_primitives::SlotNumber {
fn current_epoch_start() -> babe_primitives::Slot {
Babe::current_epoch_start()
}

Expand All @@ -963,7 +963,7 @@ sp_api::impl_runtime_apis! {
}

fn generate_key_ownership_proof(
_slot_number: babe_primitives::SlotNumber,
_slot: babe_primitives::Slot,
authority_id: babe_primitives::AuthorityId,
) -> Option<babe_primitives::OpaqueKeyOwnershipProof> {
use parity_scale_codec::Encode;
Expand Down