Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit 71a528e

Browse files
authored
Upgrade codec to 2.0 and bitvec to 0.20 (companion) (#2343)
* upgrade codec and bitvec * "Update Substrate" Co-authored-by: parity-processbot <>
1 parent 1dd53d4 commit 71a528e

File tree

44 files changed

+297
-272
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+297
-272
lines changed

Cargo.lock

Lines changed: 196 additions & 176 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core-primitives/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ edition = "2018"
88
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
99
sp-std = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
1010
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
11-
parity-scale-codec = { version = "1.3.6", default-features = false, features = [ "derive" ] }
12-
parity-util-mem = { version = "0.8.0", default-features = false, optional = true }
11+
parity-scale-codec = { version = "2.0.0", default-features = false, features = [ "derive" ] }
12+
parity-util-mem = { version = "0.9.0", default-features = false, optional = true }
1313

1414
[features]
1515
default = [ "std" ]

erasure-coding/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ edition = "2018"
77
[dependencies]
88
primitives = { package = "polkadot-primitives", path = "../primitives" }
99
reed_solomon = { package = "reed-solomon-erasure", version = "4.0.2" }
10-
parity-scale-codec = { version = "1.3.6", default-features = false, features = ["derive"] }
10+
parity-scale-codec = { version = "2.0.0", default-features = false, features = ["derive"] }
1111
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" }
1212
trie = { package = "sp-trie", git = "https://github.com/paritytech/substrate", branch = "master" }
1313
thiserror = "1.0.23"

node/core/approval-voting/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ edition = "2018"
66

77
[dependencies]
88
futures = "0.3.8"
9-
parity-scale-codec = { version = "1.3.5", default-features = false, features = ["bit-vec", "derive"] }
9+
parity-scale-codec = { version = "2.0.0", default-features = false, features = ["bit-vec", "derive"] }
1010

1111
polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../../subsystem" }
1212
polkadot-overseer = { path = "../../overseer" }
1313
polkadot-primitives = { path = "../../../primitives" }
1414
polkadot-node-primitives = { path = "../../primitives" }
15-
bitvec = "0.17.4"
15+
bitvec = "0.20.1"
1616

1717
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
1818
sp-consensus-slots = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }

node/core/av-store/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ edition = "2018"
77
[dependencies]
88
futures = "0.3.12"
99
futures-timer = "3.0.2"
10-
kvdb = "0.8.0"
11-
kvdb-rocksdb = "0.10.0"
10+
kvdb = "0.9.0"
11+
kvdb-rocksdb = "0.11.0"
1212
thiserror = "1.0.23"
1313
tracing = "0.1.22"
1414
tracing-futures = "0.2.4"
15-
bitvec = "0.17.4"
15+
bitvec = "0.20.1"
1616

17-
parity-scale-codec = { version = "1.3.6", features = ["derive"] }
17+
parity-scale-codec = { version = "2.0.0", features = ["derive"] }
1818
erasure = { package = "polkadot-erasure-coding", path = "../../../erasure-coding" }
1919
polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../../subsystem" }
2020
polkadot-node-subsystem-util = { path = "../../subsystem-util" }
@@ -27,7 +27,7 @@ sc-service = { git = "https://github.com/paritytech/substrate", branch = "master
2727
log = "0.4.13"
2828
env_logger = "0.8.2"
2929
assert_matches = "1.4.0"
30-
kvdb-memorydb = "0.8.0"
30+
kvdb-memorydb = "0.9.0"
3131

3232
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" }
3333
polkadot-node-subsystem-util = { path = "../../subsystem-util" }

node/core/av-store/src/lib.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,16 +133,16 @@ impl Decode for BEBlockNumber {
133133
#[derive(Debug, Encode, Decode)]
134134
enum State {
135135
/// Candidate data was first observed at the given time but is not available in any block.
136-
#[codec(index = "0")]
136+
#[codec(index = 0)]
137137
Unavailable(BETimestamp),
138138
/// The candidate was first observed at the given time and was included in the given list of unfinalized blocks, which may be
139139
/// empty. The timestamp here is not used for pruning. Either one of these blocks will be finalized or the state will regress to
140140
/// `State::Unavailable`, in which case the same timestamp will be reused. Blocks are sorted ascending first by block number and
141141
/// then hash.
142-
#[codec(index = "1")]
142+
#[codec(index = 1)]
143143
Unfinalized(BETimestamp, Vec<(BEBlockNumber, Hash)>),
144144
/// Candidate data has appeared in a finalized block and did so at the given time.
145-
#[codec(index = "2")]
145+
#[codec(index = 2)]
146146
Finalized(BETimestamp)
147147
}
148148

@@ -967,7 +967,9 @@ fn process_message(
967967
}
968968
AvailabilityStoreMessage::QueryChunkAvailability(candidate, validator_index, tx) => {
969969
let a = load_meta(&subsystem.db, &candidate)?
970-
.map_or(false, |m| *m.chunks_stored.get(validator_index as usize).unwrap_or(&false));
970+
.map_or(false, |m|
971+
*m.chunks_stored.get(validator_index as usize).as_deref().unwrap_or(&false)
972+
);
971973
let _ = tx.send(a);
972974
}
973975
AvailabilityStoreMessage::StoreChunk {

node/core/backing/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../../subsys
1313
polkadot-node-subsystem-util = { path = "../../subsystem-util" }
1414
erasure-coding = { package = "polkadot-erasure-coding", path = "../../../erasure-coding" }
1515
statement-table = { package = "polkadot-statement-table", path = "../../../statement-table" }
16-
bitvec = { version = "0.17.4", default-features = false, features = ["alloc"] }
16+
bitvec = { version = "0.20.1", default-features = false, features = ["alloc"] }
1717
tracing = "0.1.22"
1818
tracing-futures = "0.2.4"
1919
thiserror = "1.0.23"

node/core/backing/src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1794,7 +1794,10 @@ mod tests {
17941794
assert!(candidates[0].validity_votes.contains(
17951795
&ValidityAttestation::Explicit(signed_c.signature().clone())
17961796
));
1797-
assert_eq!(candidates[0].validator_indices, bitvec::bitvec![Lsb0, u8; 1, 0, 1, 1]);
1797+
assert_eq!(
1798+
candidates[0].validator_indices,
1799+
bitvec::bitvec![bitvec::order::Lsb0, u8; 1, 0, 1, 1],
1800+
);
17981801

17991802
virtual_overseer.send(FromOverseer::Signal(
18001803
OverseerSignal::ActiveLeaves(ActiveLeavesUpdate::stop_work(test_state.relay_parent)))

node/core/candidate-validation/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ tracing = "0.1.22"
1010
tracing-futures = "0.2.4"
1111

1212
sp-core = { package = "sp-core", git = "https://github.com/paritytech/substrate", branch = "master" }
13-
parity-scale-codec = { version = "1.3.6", default-features = false, features = ["bit-vec", "derive"] }
13+
parity-scale-codec = { version = "2.0.0", default-features = false, features = ["bit-vec", "derive"] }
1414

1515
polkadot-primitives = { path = "../../../primitives" }
1616
polkadot-parachain = { path = "../../../parachain" }

node/core/provisioner/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ authors = ["Parity Technologies <[email protected]>"]
55
edition = "2018"
66

77
[dependencies]
8-
bitvec = { version = "0.17.4", default-features = false, features = ["alloc"] }
8+
bitvec = { version = "0.20.1", default-features = false, features = ["alloc"] }
99
futures = "0.3.12"
1010
tracing = "0.1.22"
1111
tracing-futures = "0.2.4"

0 commit comments

Comments
 (0)