Upgrade codec to 2.0 and bitvec to 0.20 (companion) (#2343)

* upgrade codec and bitvec

* "Update Substrate"

Co-authored-by: parity-processbot <>
This commit is contained in:
Guillaume Thiolliere
2021-01-29 14:35:45 +01:00
committed by GitHub
parent 6efeb1ee13
commit 29f12f3f48
44 changed files with 297 additions and 272 deletions
+5 -5
View File
@@ -7,14 +7,14 @@ edition = "2018"
[dependencies]
futures = "0.3.12"
futures-timer = "3.0.2"
kvdb = "0.8.0"
kvdb-rocksdb = "0.10.0"
kvdb = "0.9.0"
kvdb-rocksdb = "0.11.0"
thiserror = "1.0.23"
tracing = "0.1.22"
tracing-futures = "0.2.4"
bitvec = "0.17.4"
bitvec = "0.20.1"
parity-scale-codec = { version = "1.3.6", features = ["derive"] }
parity-scale-codec = { version = "2.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" }
@@ -27,7 +27,7 @@ sc-service = { git = "https://github.com/paritytech/substrate", branch = "master
log = "0.4.13"
env_logger = "0.8.2"
assert_matches = "1.4.0"
kvdb-memorydb = "0.8.0"
kvdb-memorydb = "0.9.0"
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" }
polkadot-node-subsystem-util = { path = "../../subsystem-util" }
+6 -4
View File
@@ -133,16 +133,16 @@ impl Decode for BEBlockNumber {
#[derive(Debug, Encode, Decode)]
enum State {
/// Candidate data was first observed at the given time but is not available in any block.
#[codec(index = "0")]
#[codec(index = 0)]
Unavailable(BETimestamp),
/// The candidate was first observed at the given time and was included in the given list of unfinalized blocks, which may be
/// empty. The timestamp here is not used for pruning. Either one of these blocks will be finalized or the state will regress to
/// `State::Unavailable`, in which case the same timestamp will be reused. Blocks are sorted ascending first by block number and
/// then hash.
#[codec(index = "1")]
#[codec(index = 1)]
Unfinalized(BETimestamp, Vec<(BEBlockNumber, Hash)>),
/// Candidate data has appeared in a finalized block and did so at the given time.
#[codec(index = "2")]
#[codec(index = 2)]
Finalized(BETimestamp)
}
@@ -967,7 +967,9 @@ fn process_message(
}
AvailabilityStoreMessage::QueryChunkAvailability(candidate, validator_index, tx) => {
let a = load_meta(&subsystem.db, &candidate)?
.map_or(false, |m| *m.chunks_stored.get(validator_index as usize).unwrap_or(&false));
.map_or(false, |m|
*m.chunks_stored.get(validator_index as usize).as_deref().unwrap_or(&false)
);
let _ = tx.send(a);
}
AvailabilityStoreMessage::StoreChunk {