Skip to content

Commit

Permalink
Merge branch 'master' into tsv-disabling
Browse files Browse the repository at this point in the history
  • Loading branch information
tdimitrov committed Nov 6, 2023
2 parents c986fd3 + 0570b6f commit b16c8b6
Show file tree
Hide file tree
Showing 116 changed files with 6,318 additions and 2,372 deletions.
8 changes: 8 additions & 0 deletions .gitlab/pipeline/zombienet/polkadot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,14 @@ zombienet-polkadot-functional-0005-parachains-disputes-past-session:
--local-dir="${LOCAL_DIR}/functional"
--test="0005-parachains-disputes-past-session.zndsl"

zombienet-polkadot-functional-0006-parachains-max-tranche0:
extends:
- .zombienet-polkadot-common
script:
- /home/nonroot/zombie-net/scripts/ci/run-test-local-env-manager.sh
--local-dir="${LOCAL_DIR}/functional"
--test="0006-parachains-max-tranche0.zndsl"

zombienet-polkadot-smoke-0001-parachains-smoke-test:
extends:
- .zombienet-polkadot-common
Expand Down
18 changes: 14 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cumulus/client/relay-chain-rpc-interface/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jsonrpsee = { version = "0.16.2", features = ["ws-client"] }
tracing = "0.1.37"
async-trait = "0.1.73"
url = "2.4.0"
serde_json = "1.0.107"
serde_json = "1.0.108"
serde = "1.0.188"
schnellru = "0.2.1"
smoldot = { version = "0.11.0", default_features = false, features = ["std"]}
Expand Down
2 changes: 1 addition & 1 deletion cumulus/parachain-template/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ codec = { package = "parity-scale-codec", version = "3.0.0" }
serde = { version = "1.0.188", features = ["derive"] }
jsonrpsee = { version = "0.16.2", features = ["server"] }
futures = "0.3.28"
serde_json = "1.0.104"
serde_json = "1.0.108"

# Local
parachain-template-runtime = { path = "../runtime" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ publish = false
[dependencies]
codec = { package = "parity-scale-codec", version = "3.4.0", default-features = false }
paste = "1.0.14"
serde_json = "1.0.104"
serde_json = "1.0.108"

# Substrate
grandpa = { package = "sc-consensus-grandpa", path = "../../../../../substrate/client/consensus/grandpa" }
Expand Down
2 changes: 1 addition & 1 deletion cumulus/polkadot-parachain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ futures = "0.3.28"
hex-literal = "0.4.1"
log = "0.4.20"
serde = { version = "1.0.188", features = ["derive"] }
serde_json = "1.0.107"
serde_json = "1.0.108"

# Local
rococo-parachain-runtime = { path = "../parachains/runtimes/testing/rococo-parachain" }
Expand Down
2 changes: 1 addition & 1 deletion cumulus/test/service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ criterion = { version = "0.5.1", features = [ "async_tokio" ] }
jsonrpsee = { version = "0.16.2", features = ["server"] }
rand = "0.8.5"
serde = { version = "1.0.188", features = ["derive"] }
serde_json = "1.0.107"
serde_json = "1.0.108"
tokio = { version = "1.32.0", features = ["macros"] }
tracing = "0.1.37"
url = "2.4.0"
Expand Down
2 changes: 2 additions & 0 deletions polkadot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ jemalloc-allocator = [
"polkadot-node-core-pvf/jemalloc-allocator",
"polkadot-overseer/jemalloc-allocator",
]
network-protocol-staging = [ "polkadot-cli/network-protocol-staging" ]


# Enables timeout-based tests supposed to be run only in CI environment as they may be flaky
# when run locally depending on system load
Expand Down
2 changes: 2 additions & 0 deletions polkadot/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,5 @@ runtime-metrics = [
"polkadot-node-metrics/runtime-metrics",
"service/runtime-metrics",
]

network-protocol-staging = [ "service/network-protocol-staging" ]
6 changes: 6 additions & 0 deletions polkadot/node/core/approval-voting/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ schnorrkel = "0.9.1"
kvdb = "0.13.0"
derive_more = "0.99.17"
thiserror = "1.0.48"
itertools = "0.10.5"

polkadot-node-subsystem = { path = "../../subsystem" }
polkadot-node-subsystem-util = { path = "../../subsystem-util" }
Expand All @@ -30,6 +31,9 @@ sp-consensus = { path = "../../../../substrate/primitives/consensus/common", def
sp-consensus-slots = { path = "../../../../substrate/primitives/consensus/slots", default-features = false }
sp-application-crypto = { path = "../../../../substrate/primitives/application-crypto", default-features = false, features = ["full_crypto"] }
sp-runtime = { path = "../../../../substrate/primitives/runtime", default-features = false }
rand_core = "0.5.1"
rand_chacha = { version = "0.3.1" }
rand = "0.8.5"

[dev-dependencies]
async-trait = "0.1.57"
Expand All @@ -43,3 +47,5 @@ polkadot-node-subsystem-test-helpers = { path = "../../subsystem-test-helpers" }
assert_matches = "1.4.0"
kvdb-memorydb = "0.13.0"
test-helpers = { package = "polkadot-primitives-test-helpers", path = "../../../primitives/test-helpers" }
log = "0.4.17"
env_logger = "0.9.0"
60 changes: 30 additions & 30 deletions polkadot/node/core/approval-voting/src/approval_checking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
//! Utilities for checking whether a candidate has been approved under a given block.

use bitvec::{order::Lsb0 as BitOrderLsb0, slice::BitSlice};
use polkadot_node_primitives::approval::DelayTranche;
use polkadot_node_primitives::approval::v1::DelayTranche;
use polkadot_primitives::ValidatorIndex;

use crate::{
Expand Down Expand Up @@ -472,9 +472,9 @@ mod tests {
}
.into();

let approval_entry = approval_db::v1::ApprovalEntry {
let approval_entry = approval_db::v2::ApprovalEntry {
tranches: Vec::new(),
assignments: BitVec::default(),
assigned_validators: BitVec::default(),
our_assignment: None,
our_approval_sig: None,
backing_group: GroupIndex(0),
Expand Down Expand Up @@ -509,22 +509,22 @@ mod tests {
candidate.mark_approval(ValidatorIndex(i));
}

let approval_entry = approval_db::v1::ApprovalEntry {
let approval_entry = approval_db::v2::ApprovalEntry {
tranches: vec![
approval_db::v1::TrancheEntry {
approval_db::v2::TrancheEntry {
tranche: 0,
assignments: (0..2).map(|i| (ValidatorIndex(i), 0.into())).collect(),
},
approval_db::v1::TrancheEntry {
approval_db::v2::TrancheEntry {
tranche: 1,
assignments: (2..5).map(|i| (ValidatorIndex(i), 1.into())).collect(),
},
approval_db::v1::TrancheEntry {
approval_db::v2::TrancheEntry {
tranche: 2,
assignments: (5..10).map(|i| (ValidatorIndex(i), 0.into())).collect(),
},
],
assignments: bitvec![u8, BitOrderLsb0; 1; 10],
assigned_validators: bitvec![u8, BitOrderLsb0; 1; 10],
our_assignment: None,
our_approval_sig: None,
backing_group: GroupIndex(0),
Expand Down Expand Up @@ -581,22 +581,22 @@ mod tests {
candidate.mark_approval(ValidatorIndex(i));
}

let approval_entry = approval_db::v1::ApprovalEntry {
let approval_entry = approval_db::v2::ApprovalEntry {
tranches: vec![
approval_db::v1::TrancheEntry {
approval_db::v2::TrancheEntry {
tranche: 0,
assignments: (0..4).map(|i| (ValidatorIndex(i), 0.into())).collect(),
},
approval_db::v1::TrancheEntry {
approval_db::v2::TrancheEntry {
tranche: 1,
assignments: (4..6).map(|i| (ValidatorIndex(i), 1.into())).collect(),
},
approval_db::v1::TrancheEntry {
approval_db::v2::TrancheEntry {
tranche: 2,
assignments: (6..10).map(|i| (ValidatorIndex(i), 0.into())).collect(),
},
],
assignments: bitvec![u8, BitOrderLsb0; 1; 10],
assigned_validators: bitvec![u8, BitOrderLsb0; 1; 10],
our_assignment: None,
our_approval_sig: None,
backing_group: GroupIndex(0),
Expand Down Expand Up @@ -647,9 +647,9 @@ mod tests {
let no_show_duration = 10;
let needed_approvals = 4;

let mut approval_entry: ApprovalEntry = approval_db::v1::ApprovalEntry {
let mut approval_entry: ApprovalEntry = approval_db::v2::ApprovalEntry {
tranches: Vec::new(),
assignments: bitvec![u8, BitOrderLsb0; 0; 5],
assigned_validators: bitvec![u8, BitOrderLsb0; 0; 5],
our_assignment: None,
our_approval_sig: None,
backing_group: GroupIndex(0),
Expand Down Expand Up @@ -691,9 +691,9 @@ mod tests {
let no_show_duration = 10;
let needed_approvals = 4;

let mut approval_entry: ApprovalEntry = approval_db::v1::ApprovalEntry {
let mut approval_entry: ApprovalEntry = approval_db::v2::ApprovalEntry {
tranches: Vec::new(),
assignments: bitvec![u8, BitOrderLsb0; 0; 10],
assigned_validators: bitvec![u8, BitOrderLsb0; 0; 10],
our_assignment: None,
our_approval_sig: None,
backing_group: GroupIndex(0),
Expand Down Expand Up @@ -731,9 +731,9 @@ mod tests {
let no_show_duration = 10;
let needed_approvals = 4;

let mut approval_entry: ApprovalEntry = approval_db::v1::ApprovalEntry {
let mut approval_entry: ApprovalEntry = approval_db::v2::ApprovalEntry {
tranches: Vec::new(),
assignments: bitvec![u8, BitOrderLsb0; 0; 10],
assigned_validators: bitvec![u8, BitOrderLsb0; 0; 10],
our_assignment: None,
our_approval_sig: None,
backing_group: GroupIndex(0),
Expand Down Expand Up @@ -776,9 +776,9 @@ mod tests {
let needed_approvals = 4;
let n_validators = 8;

let mut approval_entry: ApprovalEntry = approval_db::v1::ApprovalEntry {
let mut approval_entry: ApprovalEntry = approval_db::v2::ApprovalEntry {
tranches: Vec::new(),
assignments: bitvec![u8, BitOrderLsb0; 0; n_validators],
assigned_validators: bitvec![u8, BitOrderLsb0; 0; n_validators],
our_assignment: None,
our_approval_sig: None,
backing_group: GroupIndex(0),
Expand Down Expand Up @@ -843,9 +843,9 @@ mod tests {
let needed_approvals = 4;
let n_validators = 8;

let mut approval_entry: ApprovalEntry = approval_db::v1::ApprovalEntry {
let mut approval_entry: ApprovalEntry = approval_db::v2::ApprovalEntry {
tranches: Vec::new(),
assignments: bitvec![u8, BitOrderLsb0; 0; n_validators],
assigned_validators: bitvec![u8, BitOrderLsb0; 0; n_validators],
our_assignment: None,
our_approval_sig: None,
backing_group: GroupIndex(0),
Expand Down Expand Up @@ -934,9 +934,9 @@ mod tests {
let needed_approvals = 4;
let n_validators = 8;

let mut approval_entry: ApprovalEntry = approval_db::v1::ApprovalEntry {
let mut approval_entry: ApprovalEntry = approval_db::v2::ApprovalEntry {
tranches: Vec::new(),
assignments: bitvec![u8, BitOrderLsb0; 0; n_validators],
assigned_validators: bitvec![u8, BitOrderLsb0; 0; n_validators],
our_assignment: None,
our_approval_sig: None,
backing_group: GroupIndex(0),
Expand Down Expand Up @@ -1041,15 +1041,15 @@ mod tests {
candidate.mark_approval(ValidatorIndex(i));
}

let approval_entry = approval_db::v1::ApprovalEntry {
let approval_entry = approval_db::v2::ApprovalEntry {
tranches: vec![
// Assignments with invalid validator indexes.
approval_db::v1::TrancheEntry {
approval_db::v2::TrancheEntry {
tranche: 1,
assignments: (2..5).map(|i| (ValidatorIndex(i), 1.into())).collect(),
},
],
assignments: bitvec![u8, BitOrderLsb0; 1; 3],
assigned_validators: bitvec![u8, BitOrderLsb0; 1; 3],
our_assignment: None,
our_approval_sig: None,
backing_group: GroupIndex(0),
Expand Down Expand Up @@ -1094,12 +1094,12 @@ mod tests {
];

for test_tranche in test_tranches {
let mut approval_entry: ApprovalEntry = approval_db::v1::ApprovalEntry {
let mut approval_entry: ApprovalEntry = approval_db::v2::ApprovalEntry {
tranches: Vec::new(),
backing_group: GroupIndex(0),
our_assignment: None,
our_approval_sig: None,
assignments: bitvec![u8, BitOrderLsb0; 0; 3],
assigned_validators: bitvec![u8, BitOrderLsb0; 0; 3],
approved: false,
}
.into();
Expand Down
1 change: 1 addition & 0 deletions polkadot/node/core/approval-voting/src/approval_db/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@
//! time being we share the same DB with the rest of Substrate.

pub mod v1;
pub mod v2;
Loading

0 comments on commit b16c8b6

Please sign in to comment.