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:
wigy
2022-02-25 13:07:06 +01:00
committed by GitHub
parent d0c9f75a0b
commit e8cb6cdaac
106 changed files with 680 additions and 556 deletions
+4 -4
View File
@@ -6,8 +6,8 @@ edition = "2021"
[dependencies]
serde = { version = "1.0.136", optional = true, features = ["derive"] }
scale-info = { version = "1.0", default-features = false, features = ["bit-vec", "derive"] }
parity-scale-codec = { version = "2.3.1", default-features = false, features = ["bit-vec", "derive"] }
scale-info = { version = "2.0.0", default-features = false, features = ["bit-vec", "derive"] }
parity-scale-codec = { version = "3.0.0", default-features = false, features = ["bit-vec", "derive"] }
primitives = { package = "sp-core", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
inherents = { package = "sp-inherents", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
application-crypto = { package = "sp-application-crypto", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
@@ -24,10 +24,10 @@ runtime_primitives = { package = "sp-runtime", git = "https://github.com/parityt
polkadot-parachain = { path = "../parachain", default-features = false }
polkadot-core-primitives = { path = "../core-primitives", default-features = false }
trie = { package = "sp-trie", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
bitvec = { version = "0.20.1", default-features = false, features = ["alloc"] }
bitvec = { version = "1.0.0", default-features = false, features = ["alloc"] }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
hex-literal = "0.3.4"
parity-util-mem = { version = "0.10.0", default-features = false, optional = true }
parity-util-mem = { version = "0.11.0", default-features = false, optional = true }
[features]
default = ["std"]
+1 -1
View File
@@ -797,7 +797,7 @@ pub struct AttestedCandidate {
/// Validity attestations.
pub validity_votes: Vec<ValidityAttestation>,
/// Indices of the corresponding validity votes.
pub validator_indices: BitVec<bitvec::order::Lsb0, u8>,
pub validator_indices: BitVec<u8, bitvec::order::Lsb0>,
}
impl AttestedCandidate {
+7 -7
View File
@@ -545,10 +545,10 @@ impl CandidateCommitments {
///
/// Every bit refers to an availability core index.
#[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo)]
pub struct AvailabilityBitfield(pub BitVec<bitvec::order::Lsb0, u8>);
pub struct AvailabilityBitfield(pub BitVec<u8, bitvec::order::Lsb0>);
impl From<BitVec<bitvec::order::Lsb0, u8>> for AvailabilityBitfield {
fn from(inner: BitVec<bitvec::order::Lsb0, u8>) -> Self {
impl From<BitVec<u8, bitvec::order::Lsb0>> for AvailabilityBitfield {
fn from(inner: BitVec<u8, bitvec::order::Lsb0>) -> Self {
AvailabilityBitfield(inner)
}
}
@@ -574,7 +574,7 @@ pub struct BackedCandidate<H = Hash> {
/// The validity votes themselves, expressed as signatures.
pub validity_votes: Vec<ValidityAttestation>,
/// The indices of the validators within the group, expressed as a bitfield.
pub validator_indices: BitVec<bitvec::order::Lsb0, u8>,
pub validator_indices: BitVec<u8, bitvec::order::Lsb0>,
}
impl<H> BackedCandidate<H> {
@@ -810,7 +810,7 @@ pub struct OccupiedCore<H = Hash, N = BlockNumber> {
/// validators has attested to availability on-chain. A 2/3+ majority of `1` bits means that
/// this will be available.
#[cfg_attr(feature = "std", ignore_malloc_size_of = "outside type")]
pub availability: BitVec<bitvec::order::Lsb0, u8>,
pub availability: BitVec<u8, bitvec::order::Lsb0>,
/// The group assigned to distribute availability pieces of this candidate.
pub group_responsible: GroupIndex,
/// The hash of the candidate occupying the core.
@@ -1331,9 +1331,9 @@ pub type CheckedMultiDisputeStatementSet = Vec<CheckedDisputeStatementSet>;
#[derive(Encode, Decode, Clone, RuntimeDebug, PartialEq, TypeInfo)]
pub struct DisputeState<N = BlockNumber> {
/// A bitfield indicating all validators for the candidate.
pub validators_for: BitVec<bitvec::order::Lsb0, u8>, // one bit per validator.
pub validators_for: BitVec<u8, bitvec::order::Lsb0>, // one bit per validator.
/// A bitfield indicating all validators against the candidate.
pub validators_against: BitVec<bitvec::order::Lsb0, u8>, // one bit per validator.
pub validators_against: BitVec<u8, bitvec::order::Lsb0>, // one bit per validator.
/// The block number at which the dispute started on-chain.
pub start: N,
/// The block number at which the dispute concluded on-chain.