Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into altonen-rework-sc-n…
Browse files Browse the repository at this point in the history
…etwork-event-system
  • Loading branch information
altonen committed Nov 27, 2023
2 parents e791de2 + dc69dbb commit 32c0c5f
Show file tree
Hide file tree
Showing 28 changed files with 482 additions and 23 deletions.
16 changes: 16 additions & 0 deletions .gitlab/pipeline/zombienet/polkadot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,22 @@ zombienet-polkadot-functional-0006-parachains-max-tranche0:
--local-dir="${LOCAL_DIR}/functional"
--test="0006-parachains-max-tranche0.zndsl"

zombienet-polkadot-functional-0007-dispute-freshly-finalized:
extends:
- .zombienet-polkadot-common
script:
- /home/nonroot/zombie-net/scripts/ci/run-test-local-env-manager.sh
--local-dir="${LOCAL_DIR}/functional"
--test="0007-dispute-freshly-finalized.zndsl"

zombienet-polkadot-functional-0008-dispute-old-finalized:
extends:
- .zombienet-polkadot-common
script:
- /home/nonroot/zombie-net/scripts/ci/run-test-local-env-manager.sh
--local-dir="${LOCAL_DIR}/functional"
--test="0008-dispute-old-finalized.zndsl"

zombienet-polkadot-smoke-0001-parachains-smoke-test:
extends:
- .zombienet-polkadot-common
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("statemine"),
impl_name: create_runtime_str!("statemine"),
authoring_version: 1,
spec_version: 10000,
spec_version: 1_004_000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 13,
Expand All @@ -130,7 +130,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("statemine"),
impl_name: create_runtime_str!("statemine"),
authoring_version: 1,
spec_version: 10000,
spec_version: 1_004_000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 13,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("statemint"),
impl_name: create_runtime_str!("statemint"),
authoring_version: 1,
spec_version: 10000,
spec_version: 1_004_000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 13,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("statemine"),
impl_name: create_runtime_str!("statemine"),
authoring_version: 1,
spec_version: 1_003_000,
spec_version: 1_004_000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 13,
Expand All @@ -127,7 +127,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("statemine"),
impl_name: create_runtime_str!("statemine"),
authoring_version: 1,
spec_version: 1_003_000,
spec_version: 1_004_000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 13,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("westmint"),
impl_name: create_runtime_str!("westmint"),
authoring_version: 1,
spec_version: 1_003_000,
spec_version: 1_004_000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 13,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("bridge-hub-kusama"),
impl_name: create_runtime_str!("bridge-hub-kusama"),
authoring_version: 1,
spec_version: 10000,
spec_version: 1_004_000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 3,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("bridge-hub-polkadot"),
impl_name: create_runtime_str!("bridge-hub-polkadot"),
authoring_version: 1,
spec_version: 10000,
spec_version: 1_004_000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("bridge-hub-rococo"),
impl_name: create_runtime_str!("bridge-hub-rococo"),
authoring_version: 1,
spec_version: 1_003_000,
spec_version: 1_004_000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 3,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("bridge-hub-westend"),
impl_name: create_runtime_str!("bridge-hub-westend"),
authoring_version: 1,
spec_version: 1_003_000,
spec_version: 1_004_000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 3,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("collectives"),
impl_name: create_runtime_str!("collectives"),
authoring_version: 1,
spec_version: 10000,
spec_version: 1_004_000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 5,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("collectives-westend"),
impl_name: create_runtime_str!("collectives-westend"),
authoring_version: 1,
spec_version: 1_003_000,
spec_version: 1_004_000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 5,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("contracts-rococo"),
impl_name: create_runtime_str!("contracts-rococo"),
authoring_version: 1,
spec_version: 10001,
spec_version: 1_004_000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 6,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("glutton"),
impl_name: create_runtime_str!("glutton"),
authoring_version: 1,
spec_version: 10000,
spec_version: 1_004_000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("glutton-westend"),
impl_name: create_runtime_str!("glutton-westend"),
authoring_version: 1,
spec_version: 10000,
spec_version: 1_004_000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down
2 changes: 1 addition & 1 deletion cumulus/parachains/runtimes/starters/seedling/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("seedling"),
impl_name: create_runtime_str!("seedling"),
authoring_version: 1,
spec_version: 10000,
spec_version: 1,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 2,
Expand Down
2 changes: 1 addition & 1 deletion cumulus/parachains/runtimes/testing/penpal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("penpal-parachain"),
impl_name: create_runtime_str!("penpal-parachain"),
authoring_version: 1,
spec_version: 10000,
spec_version: 1,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("test-parachain"),
impl_name: create_runtime_str!("test-parachain"),
authoring_version: 1,
spec_version: 10000,
spec_version: 1_004_000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 6,
Expand Down
46 changes: 46 additions & 0 deletions polkadot/node/malus/src/malus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ enum NemesisVariant {
BackGarbageCandidate(BackGarbageCandidateOptions),
/// Delayed disputing of ancestors that are perfectly fine.
DisputeAncestor(DisputeAncestorOptions),
/// Delayed disputing of finalized candidates.
DisputeFinalizedCandidates(DisputeFinalizedCandidatesOptions),
}

#[derive(Debug, Parser)]
Expand Down Expand Up @@ -80,6 +82,15 @@ impl MalusCli {
finality_delay,
)?
},
NemesisVariant::DisputeFinalizedCandidates(opts) => {
let DisputeFinalizedCandidatesOptions { dispute_offset, cli } = opts;

polkadot_cli::run_node(
cli,
DisputeFinalizedCandidates { dispute_offset },
finality_delay,
)?
},
}
Ok(())
}
Expand Down Expand Up @@ -184,4 +195,39 @@ mod tests {
assert!(run.cli.run.base.bob);
});
}

#[test]
fn dispute_finalized_candidates_works() {
let cli = MalusCli::try_parse_from(IntoIterator::into_iter([
"malus",
"dispute-finalized-candidates",
"--bob",
]))
.unwrap();
assert_matches::assert_matches!(cli, MalusCli {
variant: NemesisVariant::DisputeFinalizedCandidates(run),
..
} => {
assert!(run.cli.run.base.bob);
});
}

#[test]
fn dispute_finalized_offset_value_works() {
let cli = MalusCli::try_parse_from(IntoIterator::into_iter([
"malus",
"dispute-finalized-candidates",
"--dispute-offset",
"13",
"--bob",
]))
.unwrap();
assert_matches::assert_matches!(cli, MalusCli {
variant: NemesisVariant::DisputeFinalizedCandidates(opts),
..
} => {
assert_eq!(opts.dispute_offset, 13); // This line checks that dispute_offset is correctly set to 13
assert!(opts.cli.run.base.bob);
});
}
}
4 changes: 2 additions & 2 deletions polkadot/node/malus/src/variants/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.

//! Implements common code for nemesis. Currently, only `FakeValidationResult`
//! Implements common code for nemesis. Currently, only `ReplaceValidationResult`
//! interceptor is implemented.
use crate::{
interceptor::*,
Expand Down Expand Up @@ -188,7 +188,7 @@ where
let _candidate_descriptor = candidate_descriptor.clone();
let mut subsystem_sender = subsystem_sender.clone();
let (sender, receiver) = std::sync::mpsc::channel();
self.spawner.spawn_blocking(
self.spawner.spawn(
"malus-get-validation-data",
Some("malus"),
Box::pin(async move {
Expand Down
Loading

0 comments on commit 32c0c5f

Please sign in to comment.