mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 19:21:13 +00:00
Companion to "Updating scale to v3" (#4958)
* Updating dependencies * Adapting code to scale v3 * Upgrade bitvec to 1.0.0 * Fix bitvec arithmetics * Update Cargo.lock * Update sp-io * Fixing the build * Yanked scale-info 2.0.0 Co-authored-by: Bastian Köcher <info@kchr.de>
This commit is contained in:
@@ -7,13 +7,13 @@ edition = "2021"
|
||||
[dependencies]
|
||||
futures = "0.3.21"
|
||||
futures-timer = "3.0.2"
|
||||
parity-scale-codec = { version = "2.3.1", default-features = false, features = ["bit-vec", "derive"] }
|
||||
parity-scale-codec = { version = "3.0.0", default-features = false, features = ["bit-vec", "derive"] }
|
||||
tracing = "0.1.31"
|
||||
bitvec = { version = "0.20.1", default-features = false, features = ["alloc"] }
|
||||
bitvec = { version = "1.0.0", default-features = false, features = ["alloc"] }
|
||||
lru = "0.7"
|
||||
merlin = "2.0"
|
||||
schnorrkel = "0.9.1"
|
||||
kvdb = "0.10.0"
|
||||
kvdb = "0.11.0"
|
||||
derive_more = "0.99.17"
|
||||
|
||||
polkadot-node-subsystem = { path = "../../subsystem" }
|
||||
@@ -38,5 +38,5 @@ sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sp-consensus-babe = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
polkadot-node-subsystem-test-helpers = { path = "../../subsystem-test-helpers" }
|
||||
assert_matches = "1.4.0"
|
||||
kvdb-memorydb = "0.10.0"
|
||||
kvdb-memorydb = "0.11.0"
|
||||
test-helpers = { package = "polkadot-primitives-test-helpers", path = "../../../primitives/test-helpers" }
|
||||
|
||||
@@ -129,7 +129,7 @@ pub fn check_approval(
|
||||
let n_assigned = assigned_mask.count_ones();
|
||||
|
||||
// Filter the amount of assigned validators by those which have approved.
|
||||
assigned_mask &= approvals.iter().by_val();
|
||||
assigned_mask &= approvals;
|
||||
let n_approved = assigned_mask.count_ones();
|
||||
|
||||
// note: the process of computing `required` only chooses `exact` if
|
||||
@@ -326,7 +326,7 @@ fn filled_tranche_iterator<'a>(
|
||||
/// - if `tick` > `clock_drift`: the value is equal to `tick` + `no_show_duration`.
|
||||
fn count_no_shows(
|
||||
assignments: &[(ValidatorIndex, Tick)],
|
||||
approvals: &BitSlice<BitOrderLsb0, u8>,
|
||||
approvals: &BitSlice<u8, BitOrderLsb0>,
|
||||
clock_drift: Tick,
|
||||
block_tick: Tick,
|
||||
no_show_duration: Tick,
|
||||
@@ -367,7 +367,7 @@ fn count_no_shows(
|
||||
/// Determine the amount of tranches of assignments needed to determine approval of a candidate.
|
||||
pub fn tranches_to_approve(
|
||||
approval_entry: &ApprovalEntry,
|
||||
approvals: &BitSlice<BitOrderLsb0, u8>,
|
||||
approvals: &BitSlice<u8, BitOrderLsb0>,
|
||||
tranche_now: DelayTranche,
|
||||
block_tick: Tick,
|
||||
no_show_duration: Tick,
|
||||
@@ -501,7 +501,7 @@ mod tests {
|
||||
candidate: dummy_candidate_receipt(dummy_hash()),
|
||||
session: 0,
|
||||
block_assignments: BTreeMap::default(),
|
||||
approvals: bitvec![BitOrderLsb0, u8; 0; 10],
|
||||
approvals: bitvec![u8, BitOrderLsb0; 0; 10],
|
||||
}
|
||||
.into();
|
||||
|
||||
@@ -524,7 +524,7 @@ mod tests {
|
||||
assignments: (5..10).map(|i| (ValidatorIndex(i), 0.into())).collect(),
|
||||
},
|
||||
],
|
||||
assignments: bitvec![BitOrderLsb0, u8; 1; 10],
|
||||
assignments: bitvec![u8, BitOrderLsb0; 1; 10],
|
||||
our_assignment: None,
|
||||
our_approval_sig: None,
|
||||
backing_group: GroupIndex(0),
|
||||
@@ -573,7 +573,7 @@ mod tests {
|
||||
candidate: dummy_candidate_receipt(dummy_hash()),
|
||||
session: 0,
|
||||
block_assignments: BTreeMap::default(),
|
||||
approvals: bitvec![BitOrderLsb0, u8; 0; 10],
|
||||
approvals: bitvec![u8, BitOrderLsb0; 0; 10],
|
||||
}
|
||||
.into();
|
||||
|
||||
@@ -596,7 +596,7 @@ mod tests {
|
||||
assignments: (6..10).map(|i| (ValidatorIndex(i), 0.into())).collect(),
|
||||
},
|
||||
],
|
||||
assignments: bitvec![BitOrderLsb0, u8; 1; 10],
|
||||
assignments: bitvec![u8, BitOrderLsb0; 1; 10],
|
||||
our_assignment: None,
|
||||
our_approval_sig: None,
|
||||
backing_group: GroupIndex(0),
|
||||
@@ -649,7 +649,7 @@ mod tests {
|
||||
|
||||
let mut approval_entry: ApprovalEntry = approval_db::v1::ApprovalEntry {
|
||||
tranches: Vec::new(),
|
||||
assignments: bitvec![BitOrderLsb0, u8; 0; 5],
|
||||
assignments: bitvec![u8, BitOrderLsb0; 0; 5],
|
||||
our_assignment: None,
|
||||
our_approval_sig: None,
|
||||
backing_group: GroupIndex(0),
|
||||
@@ -665,7 +665,7 @@ mod tests {
|
||||
|
||||
approval_entry.import_assignment(2, ValidatorIndex(4), block_tick + 2);
|
||||
|
||||
let approvals = bitvec![BitOrderLsb0, u8; 1; 5];
|
||||
let approvals = bitvec![u8, BitOrderLsb0; 1; 5];
|
||||
|
||||
assert_eq!(
|
||||
tranches_to_approve(
|
||||
@@ -693,7 +693,7 @@ mod tests {
|
||||
|
||||
let mut approval_entry: ApprovalEntry = approval_db::v1::ApprovalEntry {
|
||||
tranches: Vec::new(),
|
||||
assignments: bitvec![BitOrderLsb0, u8; 0; 10],
|
||||
assignments: bitvec![u8, BitOrderLsb0; 0; 10],
|
||||
our_assignment: None,
|
||||
our_approval_sig: None,
|
||||
backing_group: GroupIndex(0),
|
||||
@@ -704,7 +704,7 @@ mod tests {
|
||||
approval_entry.import_assignment(0, ValidatorIndex(0), block_tick);
|
||||
approval_entry.import_assignment(1, ValidatorIndex(2), block_tick);
|
||||
|
||||
let approvals = bitvec![BitOrderLsb0, u8; 0; 10];
|
||||
let approvals = bitvec![u8, BitOrderLsb0; 0; 10];
|
||||
|
||||
let tranche_now = 2;
|
||||
assert_eq!(
|
||||
@@ -733,7 +733,7 @@ mod tests {
|
||||
|
||||
let mut approval_entry: ApprovalEntry = approval_db::v1::ApprovalEntry {
|
||||
tranches: Vec::new(),
|
||||
assignments: bitvec![BitOrderLsb0, u8; 0; 10],
|
||||
assignments: bitvec![u8, BitOrderLsb0; 0; 10],
|
||||
our_assignment: None,
|
||||
our_approval_sig: None,
|
||||
backing_group: GroupIndex(0),
|
||||
@@ -746,7 +746,7 @@ mod tests {
|
||||
|
||||
approval_entry.import_assignment(1, ValidatorIndex(2), block_tick);
|
||||
|
||||
let mut approvals = bitvec![BitOrderLsb0, u8; 0; 10];
|
||||
let mut approvals = bitvec![u8, BitOrderLsb0; 0; 10];
|
||||
approvals.set(0, true);
|
||||
approvals.set(1, true);
|
||||
|
||||
@@ -778,7 +778,7 @@ mod tests {
|
||||
|
||||
let mut approval_entry: ApprovalEntry = approval_db::v1::ApprovalEntry {
|
||||
tranches: Vec::new(),
|
||||
assignments: bitvec![BitOrderLsb0, u8; 0; n_validators],
|
||||
assignments: bitvec![u8, BitOrderLsb0; 0; n_validators],
|
||||
our_assignment: None,
|
||||
our_approval_sig: None,
|
||||
backing_group: GroupIndex(0),
|
||||
@@ -792,7 +792,7 @@ mod tests {
|
||||
approval_entry.import_assignment(1, ValidatorIndex(2), block_tick);
|
||||
approval_entry.import_assignment(1, ValidatorIndex(3), block_tick);
|
||||
|
||||
let mut approvals = bitvec![BitOrderLsb0, u8; 0; n_validators];
|
||||
let mut approvals = bitvec![u8, BitOrderLsb0; 0; n_validators];
|
||||
approvals.set(0, true);
|
||||
approvals.set(1, true);
|
||||
// skip 2
|
||||
@@ -845,7 +845,7 @@ mod tests {
|
||||
|
||||
let mut approval_entry: ApprovalEntry = approval_db::v1::ApprovalEntry {
|
||||
tranches: Vec::new(),
|
||||
assignments: bitvec![BitOrderLsb0, u8; 0; n_validators],
|
||||
assignments: bitvec![u8, BitOrderLsb0; 0; n_validators],
|
||||
our_assignment: None,
|
||||
our_approval_sig: None,
|
||||
backing_group: GroupIndex(0),
|
||||
@@ -862,7 +862,7 @@ mod tests {
|
||||
approval_entry.import_assignment(2, ValidatorIndex(4), block_tick + no_show_duration + 2);
|
||||
approval_entry.import_assignment(2, ValidatorIndex(5), block_tick + no_show_duration + 2);
|
||||
|
||||
let mut approvals = bitvec![BitOrderLsb0, u8; 0; n_validators];
|
||||
let mut approvals = bitvec![u8, BitOrderLsb0; 0; n_validators];
|
||||
approvals.set(0, true);
|
||||
approvals.set(1, true);
|
||||
// skip 2
|
||||
@@ -936,7 +936,7 @@ mod tests {
|
||||
|
||||
let mut approval_entry: ApprovalEntry = approval_db::v1::ApprovalEntry {
|
||||
tranches: Vec::new(),
|
||||
assignments: bitvec![BitOrderLsb0, u8; 0; n_validators],
|
||||
assignments: bitvec![u8, BitOrderLsb0; 0; n_validators],
|
||||
our_assignment: None,
|
||||
our_approval_sig: None,
|
||||
backing_group: GroupIndex(0),
|
||||
@@ -953,7 +953,7 @@ mod tests {
|
||||
approval_entry.import_assignment(2, ValidatorIndex(4), block_tick + no_show_duration + 2);
|
||||
approval_entry.import_assignment(2, ValidatorIndex(5), block_tick + no_show_duration + 2);
|
||||
|
||||
let mut approvals = bitvec![BitOrderLsb0, u8; 0; n_validators];
|
||||
let mut approvals = bitvec![u8, BitOrderLsb0; 0; n_validators];
|
||||
approvals.set(0, true);
|
||||
approvals.set(1, true);
|
||||
// skip 2
|
||||
@@ -1033,7 +1033,7 @@ mod tests {
|
||||
candidate: dummy_candidate_receipt(dummy_hash()),
|
||||
session: 0,
|
||||
block_assignments: BTreeMap::default(),
|
||||
approvals: bitvec![BitOrderLsb0, u8; 0; 3],
|
||||
approvals: bitvec![u8, BitOrderLsb0; 0; 3],
|
||||
}
|
||||
.into();
|
||||
|
||||
@@ -1049,7 +1049,7 @@ mod tests {
|
||||
assignments: (2..5).map(|i| (ValidatorIndex(i), 1.into())).collect(),
|
||||
},
|
||||
],
|
||||
assignments: bitvec![BitOrderLsb0, u8; 1; 3],
|
||||
assignments: bitvec![u8, BitOrderLsb0; 1; 3],
|
||||
our_assignment: None,
|
||||
our_approval_sig: None,
|
||||
backing_group: GroupIndex(0),
|
||||
@@ -1057,7 +1057,7 @@ mod tests {
|
||||
}
|
||||
.into();
|
||||
|
||||
let approvals = bitvec![BitOrderLsb0, u8; 0; 3];
|
||||
let approvals = bitvec![u8, BitOrderLsb0; 0; 3];
|
||||
|
||||
let tranche_now = 10;
|
||||
assert_eq!(
|
||||
@@ -1099,7 +1099,7 @@ mod tests {
|
||||
backing_group: GroupIndex(0),
|
||||
our_assignment: None,
|
||||
our_approval_sig: None,
|
||||
assignments: bitvec![BitOrderLsb0, u8; 0; 3],
|
||||
assignments: bitvec![u8, BitOrderLsb0; 0; 3],
|
||||
approved: false,
|
||||
}
|
||||
.into();
|
||||
@@ -1137,7 +1137,7 @@ mod tests {
|
||||
let n_validators = 4;
|
||||
let block_tick = 20;
|
||||
|
||||
let mut approvals = bitvec![BitOrderLsb0, u8; 0; n_validators];
|
||||
let mut approvals = bitvec![u8, BitOrderLsb0; 0; n_validators];
|
||||
for &v_index in &test.approvals {
|
||||
approvals.set(v_index, true);
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ pub struct StoredBlockRange(pub BlockNumber, pub BlockNumber);
|
||||
pub struct Tick(u64);
|
||||
|
||||
/// Convenience type definition
|
||||
pub type Bitfield = BitVec<BitOrderLsb0, u8>;
|
||||
pub type Bitfield = BitVec<u8, BitOrderLsb0>;
|
||||
|
||||
/// The database config.
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
|
||||
@@ -37,8 +37,8 @@ fn make_db() -> (DbBackend, Arc<dyn KeyValueDB>) {
|
||||
(DbBackend::new(db_writer.clone(), TEST_CONFIG), db_writer)
|
||||
}
|
||||
|
||||
fn make_bitvec(len: usize) -> BitVec<BitOrderLsb0, u8> {
|
||||
bitvec::bitvec![BitOrderLsb0, u8; 0; len]
|
||||
fn make_bitvec(len: usize) -> BitVec<u8, BitOrderLsb0> {
|
||||
bitvec::bitvec![u8, BitOrderLsb0; 0; len]
|
||||
}
|
||||
|
||||
fn make_block_entry(
|
||||
|
||||
@@ -463,9 +463,9 @@ pub(crate) async fn handle_new_head(
|
||||
block_hash = ?block_hash,
|
||||
"Insta-approving all candidates",
|
||||
);
|
||||
bitvec::bitvec![BitOrderLsb0, u8; 1; num_candidates]
|
||||
bitvec::bitvec![u8, BitOrderLsb0; 1; num_candidates]
|
||||
} else {
|
||||
let mut result = bitvec::bitvec![BitOrderLsb0, u8; 0; num_candidates];
|
||||
let mut result = bitvec::bitvec![u8, BitOrderLsb0; 0; num_candidates];
|
||||
for (i, &(_, _, _, backing_group)) in included_candidates.iter().enumerate() {
|
||||
let backing_group_size =
|
||||
validator_group_lens.get(backing_group.0 as usize).copied().unwrap_or(0);
|
||||
|
||||
@@ -1257,7 +1257,7 @@ async fn handle_approved_ancestor(
|
||||
|
||||
let mut block_descriptions = Vec::new();
|
||||
|
||||
let mut bits: BitVec<Lsb0, u8> = Default::default();
|
||||
let mut bits: BitVec<u8, Lsb0> = Default::default();
|
||||
for (i, block_hash) in std::iter::once(target).chain(ancestry).enumerate() {
|
||||
// Block entries should be present as the assumption is that
|
||||
// nothing here is finalized. If we encounter any missing block
|
||||
@@ -1344,7 +1344,7 @@ async fn handle_approved_ancestor(
|
||||
let n_approvals = c_entry
|
||||
.approvals()
|
||||
.iter()
|
||||
.by_val()
|
||||
.by_vals()
|
||||
.enumerate()
|
||||
.filter(|(i, approved)| {
|
||||
*approved && a_entry.is_assigned(ValidatorIndex(*i as _))
|
||||
|
||||
@@ -242,7 +242,7 @@ pub fn add_block_entry(
|
||||
candidate,
|
||||
session,
|
||||
block_assignments: BTreeMap::new(),
|
||||
approvals: bitvec::bitvec![BitOrderLsb0, u8; 0; n_validators],
|
||||
approvals: bitvec::bitvec![u8, BitOrderLsb0; 0; n_validators],
|
||||
}
|
||||
});
|
||||
|
||||
@@ -253,7 +253,7 @@ pub fn add_block_entry(
|
||||
backing_group,
|
||||
our_assignment.map(|v| v.into()),
|
||||
None,
|
||||
bitvec::bitvec![BitOrderLsb0, u8; 0; n_validators],
|
||||
bitvec::bitvec![u8, BitOrderLsb0; 0; n_validators],
|
||||
false,
|
||||
),
|
||||
);
|
||||
|
||||
@@ -80,7 +80,7 @@ pub struct ApprovalEntry {
|
||||
our_assignment: Option<OurAssignment>,
|
||||
our_approval_sig: Option<ValidatorSignature>,
|
||||
// `n_validators` bits.
|
||||
assignments: BitVec<BitOrderLsb0, u8>,
|
||||
assignments: BitVec<u8, BitOrderLsb0>,
|
||||
approved: bool,
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ impl ApprovalEntry {
|
||||
our_assignment: Option<OurAssignment>,
|
||||
our_approval_sig: Option<ValidatorSignature>,
|
||||
// `n_validators` bits.
|
||||
assignments: BitVec<BitOrderLsb0, u8>,
|
||||
assignments: BitVec<u8, BitOrderLsb0>,
|
||||
approved: bool,
|
||||
) -> Self {
|
||||
Self { tranches, backing_group, our_assignment, our_approval_sig, assignments, approved }
|
||||
@@ -163,9 +163,9 @@ impl ApprovalEntry {
|
||||
|
||||
// Produce a bitvec indicating the assignments of all validators up to and
|
||||
// including `tranche`.
|
||||
pub fn assignments_up_to(&self, tranche: DelayTranche) -> BitVec<BitOrderLsb0, u8> {
|
||||
pub fn assignments_up_to(&self, tranche: DelayTranche) -> BitVec<u8, BitOrderLsb0> {
|
||||
self.tranches.iter().take_while(|e| e.tranche <= tranche).fold(
|
||||
bitvec::bitvec![BitOrderLsb0, u8; 0; self.assignments.len()],
|
||||
bitvec::bitvec![u8, BitOrderLsb0; 0; self.assignments.len()],
|
||||
|mut a, e| {
|
||||
for &(v, _) in &e.assignments {
|
||||
a.set(v.0 as _, true);
|
||||
@@ -253,12 +253,12 @@ pub struct CandidateEntry {
|
||||
// Assignments are based on blocks, so we need to track assignments separately
|
||||
// based on the block we are looking at.
|
||||
pub block_assignments: BTreeMap<Hash, ApprovalEntry>,
|
||||
pub approvals: BitVec<BitOrderLsb0, u8>,
|
||||
pub approvals: BitVec<u8, BitOrderLsb0>,
|
||||
}
|
||||
|
||||
impl CandidateEntry {
|
||||
/// Access the bit-vec of approvals.
|
||||
pub fn approvals(&self) -> &BitSlice<BitOrderLsb0, u8> {
|
||||
pub fn approvals(&self) -> &BitSlice<u8, BitOrderLsb0> {
|
||||
&self.approvals
|
||||
}
|
||||
|
||||
@@ -336,7 +336,7 @@ pub struct BlockEntry {
|
||||
// A bitfield where the i'th bit corresponds to the i'th candidate in `candidates`.
|
||||
// The i'th bit is `true` iff the candidate has been approved in the context of this
|
||||
// block. The block can be considered approved if the bitfield has all bits set to `true`.
|
||||
pub approved_bitfield: BitVec<BitOrderLsb0, u8>,
|
||||
pub approved_bitfield: BitVec<u8, BitOrderLsb0>,
|
||||
pub children: Vec<Hash>,
|
||||
}
|
||||
|
||||
|
||||
@@ -7,12 +7,12 @@ edition = "2021"
|
||||
[dependencies]
|
||||
futures = "0.3.21"
|
||||
futures-timer = "3.0.2"
|
||||
kvdb = "0.10.0"
|
||||
kvdb = "0.11.0"
|
||||
thiserror = "1.0.30"
|
||||
tracing = "0.1.31"
|
||||
bitvec = "0.20.1"
|
||||
bitvec = "1.0.0"
|
||||
|
||||
parity-scale-codec = { version = "2.3.1", features = ["derive"] }
|
||||
parity-scale-codec = { version = "3.0.0", features = ["derive"] }
|
||||
erasure = { package = "polkadot-erasure-coding", path = "../../../erasure-coding" }
|
||||
polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../../subsystem" }
|
||||
polkadot-node-subsystem-util = { path = "../../subsystem-util" }
|
||||
@@ -24,7 +24,7 @@ polkadot-node-primitives = { path = "../../primitives" }
|
||||
log = "0.4.13"
|
||||
env_logger = "0.9.0"
|
||||
assert_matches = "1.4.0"
|
||||
kvdb-memorydb = "0.10.0"
|
||||
kvdb-memorydb = "0.11.0"
|
||||
|
||||
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
polkadot-node-subsystem-util = { path = "../../subsystem-util" }
|
||||
|
||||
@@ -148,7 +148,7 @@ enum State {
|
||||
struct CandidateMeta {
|
||||
state: State,
|
||||
data_available: bool,
|
||||
chunks_stored: BitVec<BitOrderLsb0, u8>,
|
||||
chunks_stored: BitVec<u8, BitOrderLsb0>,
|
||||
}
|
||||
|
||||
fn query_inner<D: Decode>(
|
||||
@@ -727,7 +727,7 @@ fn note_block_backed(
|
||||
let meta = CandidateMeta {
|
||||
state: State::Unavailable(now.into()),
|
||||
data_available: false,
|
||||
chunks_stored: bitvec::bitvec![BitOrderLsb0, u8; 0; n_validators],
|
||||
chunks_stored: bitvec::bitvec![u8, BitOrderLsb0; 0; n_validators],
|
||||
};
|
||||
|
||||
let prune_at = now + pruning_config.keep_unavailable_for;
|
||||
@@ -1210,7 +1210,7 @@ fn store_available_data(
|
||||
}
|
||||
|
||||
meta.data_available = true;
|
||||
meta.chunks_stored = bitvec::bitvec![BitOrderLsb0, u8; 1; n_validators];
|
||||
meta.chunks_stored = bitvec::bitvec![u8, BitOrderLsb0; 1; n_validators];
|
||||
|
||||
write_meta(&mut tx, &subsystem.config, &candidate_hash, &meta);
|
||||
write_available_data(&mut tx, &subsystem.config, &candidate_hash, &available_data);
|
||||
|
||||
@@ -291,7 +291,7 @@ fn store_chunk_works() {
|
||||
&candidate_hash,
|
||||
&CandidateMeta {
|
||||
data_available: false,
|
||||
chunks_stored: bitvec::bitvec![BitOrderLsb0, u8; 0; n_validators],
|
||||
chunks_stored: bitvec::bitvec![u8, BitOrderLsb0; 0; n_validators],
|
||||
state: State::Unavailable(BETimestamp(0)),
|
||||
},
|
||||
);
|
||||
@@ -364,7 +364,7 @@ fn query_chunk_checks_meta() {
|
||||
&CandidateMeta {
|
||||
data_available: false,
|
||||
chunks_stored: {
|
||||
let mut v = bitvec::bitvec![BitOrderLsb0, u8; 0; n_validators];
|
||||
let mut v = bitvec::bitvec![u8, BitOrderLsb0; 0; n_validators];
|
||||
v.set(validator_index.0 as usize, true);
|
||||
v
|
||||
},
|
||||
@@ -528,7 +528,7 @@ fn query_all_chunks_works() {
|
||||
&candidate_hash_2,
|
||||
&CandidateMeta {
|
||||
data_available: false,
|
||||
chunks_stored: bitvec::bitvec![BitOrderLsb0, u8; 0; n_validators as _],
|
||||
chunks_stored: bitvec::bitvec![u8, BitOrderLsb0; 0; n_validators as _],
|
||||
state: State::Unavailable(BETimestamp(0)),
|
||||
},
|
||||
);
|
||||
|
||||
@@ -13,7 +13,7 @@ polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../../subsys
|
||||
polkadot-node-subsystem-util = { path = "../../subsystem-util" }
|
||||
erasure-coding = { package = "polkadot-erasure-coding", path = "../../../erasure-coding" }
|
||||
statement-table = { package = "polkadot-statement-table", path = "../../../statement-table" }
|
||||
bitvec = { version = "0.20.1", default-features = false, features = ["alloc"] }
|
||||
bitvec = { version = "1.0.0", default-features = false, features = ["alloc"] }
|
||||
tracing = "0.1.31"
|
||||
thiserror = "1.0.30"
|
||||
|
||||
|
||||
@@ -752,7 +752,7 @@ fn backing_works_while_validation_ongoing() {
|
||||
.contains(&ValidityAttestation::Explicit(signed_c.signature().clone())));
|
||||
assert_eq!(
|
||||
candidates[0].validator_indices,
|
||||
bitvec::bitvec![bitvec::order::Lsb0, u8; 1, 0, 1, 1],
|
||||
bitvec::bitvec![u8, bitvec::order::Lsb0; 1, 0, 1, 1],
|
||||
);
|
||||
|
||||
virtual_overseer
|
||||
@@ -1484,7 +1484,7 @@ fn candidate_backing_reorders_votes() {
|
||||
let backed = table_attested_to_backed(attested, &table_context).unwrap();
|
||||
|
||||
let expected_bitvec = {
|
||||
let mut validator_indices = BitVec::<bitvec::order::Lsb0, u8>::with_capacity(6);
|
||||
let mut validator_indices = BitVec::<u8, bitvec::order::Lsb0>::with_capacity(6);
|
||||
validator_indices.resize(6, false);
|
||||
|
||||
validator_indices.set(1, true);
|
||||
|
||||
@@ -10,7 +10,7 @@ futures = "0.3.21"
|
||||
tracing = "0.1.31"
|
||||
|
||||
sp-maybe-compressed-blob = { package = "sp-maybe-compressed-blob", git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
parity-scale-codec = { version = "2.3.1", default-features = false, features = ["bit-vec", "derive"] }
|
||||
parity-scale-codec = { version = "3.0.0", default-features = false, features = ["bit-vec", "derive"] }
|
||||
|
||||
polkadot-primitives = { path = "../../../primitives" }
|
||||
polkadot-parachain = { path = "../../../parachain" }
|
||||
|
||||
@@ -17,7 +17,7 @@ sc-consensus-babe = { git = "https://github.com/paritytech/substrate", branch =
|
||||
[dev-dependencies]
|
||||
futures = { version = "0.3.21", features = ["thread-pool"] }
|
||||
maplit = "1.0.2"
|
||||
parity-scale-codec = "2.3.1"
|
||||
parity-scale-codec = "3.0.0"
|
||||
polkadot-node-primitives = { path = "../../primitives" }
|
||||
polkadot-node-subsystem-test-helpers = { path = "../../subsystem-test-helpers" }
|
||||
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
|
||||
@@ -13,13 +13,13 @@ polkadot-primitives = { path = "../../../primitives" }
|
||||
polkadot-node-primitives = { path = "../../primitives" }
|
||||
polkadot-node-subsystem = { path = "../../subsystem" }
|
||||
polkadot-node-subsystem-util = { path = "../../subsystem-util" }
|
||||
kvdb = "0.10.0"
|
||||
kvdb = "0.11.0"
|
||||
thiserror = "1.0.30"
|
||||
parity-scale-codec = "2"
|
||||
parity-scale-codec = "3.0.0"
|
||||
|
||||
[dev-dependencies]
|
||||
polkadot-node-subsystem-test-helpers = { path = "../../subsystem-test-helpers" }
|
||||
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
parking_lot = "0.12"
|
||||
parking_lot = "0.12.0"
|
||||
assert_matches = "1"
|
||||
kvdb-memorydb = "0.10.0"
|
||||
kvdb-memorydb = "0.11.0"
|
||||
|
||||
@@ -7,8 +7,8 @@ edition = "2021"
|
||||
[dependencies]
|
||||
futures = "0.3.21"
|
||||
tracing = "0.1.31"
|
||||
parity-scale-codec = "2"
|
||||
kvdb = "0.10.0"
|
||||
parity-scale-codec = "3.0.0"
|
||||
kvdb = "0.11.0"
|
||||
thiserror = "1.0.30"
|
||||
lru = "0.7.2"
|
||||
|
||||
@@ -20,7 +20,7 @@ polkadot-node-subsystem-util = { path = "../../subsystem-util" }
|
||||
sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
|
||||
[dev-dependencies]
|
||||
kvdb-memorydb = "0.10.0"
|
||||
kvdb-memorydb = "0.11.0"
|
||||
polkadot-node-subsystem-test-helpers = { path = "../../subsystem-test-helpers" }
|
||||
sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
|
||||
@@ -5,7 +5,7 @@ authors = ["Parity Technologies <admin@parity.io>"]
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
bitvec = { version = "0.20.1", default-features = false, features = ["alloc"] }
|
||||
bitvec = { version = "1.0.0", default-features = false, features = ["alloc"] }
|
||||
futures = "0.3.21"
|
||||
tracing = "0.1.31"
|
||||
thiserror = "1.0.30"
|
||||
|
||||
@@ -291,7 +291,7 @@ impl ProvisionerJob {
|
||||
}
|
||||
}
|
||||
|
||||
type CoreAvailability = BitVec<bitvec::order::Lsb0, u8>;
|
||||
type CoreAvailability = BitVec<u8, bitvec::order::Lsb0>;
|
||||
|
||||
/// The provisioner is the subsystem best suited to choosing which specific
|
||||
/// backed candidates and availability bitfields should be assembled into the
|
||||
|
||||
@@ -10,7 +10,7 @@ pub fn occupied_core(para_id: u32) -> CoreState {
|
||||
occupied_since: 100_u32,
|
||||
time_out_at: 200_u32,
|
||||
next_up_on_time_out: None,
|
||||
availability: bitvec![bitvec::order::Lsb0, u8; 0; 32],
|
||||
availability: bitvec![u8, bitvec::order::Lsb0; 0; 32],
|
||||
candidate_descriptor: dummy_candidate_descriptor(dummy_hash()),
|
||||
candidate_hash: Default::default(),
|
||||
})
|
||||
@@ -31,7 +31,7 @@ where
|
||||
}
|
||||
|
||||
pub fn default_bitvec(n_cores: usize) -> CoreAvailability {
|
||||
bitvec![bitvec::order::Lsb0, u8; 0; n_cores]
|
||||
bitvec![u8, bitvec::order::Lsb0; 0; n_cores]
|
||||
}
|
||||
|
||||
pub fn scheduled_core(id: u32) -> ScheduledCore {
|
||||
|
||||
@@ -19,7 +19,7 @@ slotmap = "1.0"
|
||||
tracing = "0.1.31"
|
||||
pin-project = "1.0.9"
|
||||
rand = "0.8.5"
|
||||
parity-scale-codec = { version = "2.3.1", default-features = false, features = ["derive"] }
|
||||
parity-scale-codec = { version = "3.0.0", default-features = false, features = ["derive"] }
|
||||
polkadot-parachain = { path = "../../../parachain" }
|
||||
polkadot-core-primitives = { path = "../../../core-primitives" }
|
||||
polkadot-node-subsystem-util = { path = "../../subsystem-util"}
|
||||
|
||||
@@ -8,7 +8,7 @@ edition = "2021"
|
||||
futures = "0.3.21"
|
||||
tracing = "0.1.31"
|
||||
memory-lru = "0.1.0"
|
||||
parity-util-mem = { version = "0.10.0", default-features = false }
|
||||
parity-util-mem = { version = "0.11.0", default-features = false }
|
||||
|
||||
sp-api = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sp-authority-discovery = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
|
||||
Reference in New Issue
Block a user