From 20042171dff55fd72f0bd667e49494a080dbdfda Mon Sep 17 00:00:00 2001 From: Sergei Shulepov Date: Thu, 16 Dec 2021 18:00:34 +0100 Subject: [PATCH 1/4] paras: add log target (#4478) Simply extract hardcoded log target into a const. --- runtime/parachains/src/paras.rs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/runtime/parachains/src/paras.rs b/runtime/parachains/src/paras.rs index cf1dd2076b96..c66e6a80f3ef 100644 --- a/runtime/parachains/src/paras.rs +++ b/runtime/parachains/src/paras.rs @@ -1038,7 +1038,7 @@ impl Pallet { Self::decrease_code_ref(&removed_code_hash); } else { log::warn!( - target: "runtime::paras", + target: LOG_TARGET, "Missing code for removed hash {:?}", removed_code_hash, ); @@ -1115,7 +1115,7 @@ impl Pallet { // `PvfActiveVoteMap`'s keys is always equal to the set of items found in // `PvfActiveVoteList`. log::warn!( - target: "runtime::paras", + target: LOG_TARGET, "The PvfActiveVoteMap is out of sync with PvfActiveVoteList!", ); debug_assert!(false); @@ -1453,7 +1453,7 @@ impl Pallet { // NOTE: we cannot set `UpgradeGoAheadSignal` signal here since this will be reset by // the following call `note_new_head` log::warn!( - target: "runtime::paras", + target: LOG_TARGET, "ended up scheduling an upgrade while one is pending", ); return weight @@ -1470,7 +1470,7 @@ impl Pallet { // NOTE: we cannot set `UpgradeGoAheadSignal` signal here since this will be reset by // the following call `note_new_head` log::warn!( - target: "runtime::paras", + target: LOG_TARGET, "para tried to upgrade to the same code. Abort the upgrade", ); return weight @@ -1654,11 +1654,7 @@ impl Pallet { if let Err(e) = SubmitTransaction::>::submit_unsigned_transaction( Call::include_pvf_check_statement { stmt, signature }.into(), ) { - log::error!( - target: "runtime::paras", - "Error submitting pvf check statement: {:?}", - e, - ); + log::error!(target: LOG_TARGET, "Error submitting pvf check statement: {:?}", e,); } } From 6d25f9d82b983100e7141d5477ca6eecce50026a Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Thu, 16 Dec 2021 18:16:41 +0100 Subject: [PATCH 2/4] naming consistency (#4539) --- bridges/bin/rialto/node/src/overseer.rs | 2 +- node/core/provisioner/src/lib.rs | 12 ++++++------ node/network/statement-distribution/src/lib.rs | 12 ++++++------ node/network/statement-distribution/src/tests.rs | 8 ++++---- node/service/src/overseer.rs | 4 ++-- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/bridges/bin/rialto/node/src/overseer.rs b/bridges/bin/rialto/node/src/overseer.rs index 9a7025e77c9b..488a6649047e 100644 --- a/bridges/bin/rialto/node/src/overseer.rs +++ b/bridges/bin/rialto/node/src/overseer.rs @@ -65,7 +65,7 @@ pub use polkadot_node_core_chain_selection::ChainSelectionSubsystem; pub use polkadot_node_core_dispute_coordinator::DisputeCoordinatorSubsystem; pub use polkadot_node_core_provisioner::ProvisionerSubsystem; pub use polkadot_node_core_runtime_api::RuntimeApiSubsystem; -pub use polkadot_statement_distribution::StatementDistribution as StatementDistributionSubsystem; +pub use polkadot_statement_distribution::StatementDistributionSubsystem; /// Arguments passed for overseer construction. pub struct OverseerGenArgs<'a, Spawner, RuntimeClient> diff --git a/node/core/provisioner/src/lib.rs b/node/core/provisioner/src/lib.rs index fc4968000804..11c2f0aa9c1e 100644 --- a/node/core/provisioner/src/lib.rs +++ b/node/core/provisioner/src/lib.rs @@ -91,7 +91,7 @@ impl InherentAfter { } /// A per-relay-parent job for the provisioning subsystem. -pub struct ProvisioningJob { +pub struct ProvisionerJob { leaf: ActivatedLeaf, receiver: mpsc::Receiver, backed_candidates: Vec, @@ -144,7 +144,7 @@ pub enum Error { BackedCandidateOrderingProblem, } -impl JobTrait for ProvisioningJob { +impl JobTrait for ProvisionerJob { type ToJob = ProvisionerMessage; type Error = Error; type RunArgs = (); @@ -164,7 +164,7 @@ impl JobTrait for ProvisioningJob { ) -> Pin> + Send>> { async move { let span = leaf.span.clone(); - let job = ProvisioningJob::new(leaf, metrics, receiver); + let job = ProvisionerJob::new(leaf, metrics, receiver); job.run_loop(sender.subsystem_sender(), PerLeafSpan::new(span, "provisioner")) .await @@ -173,7 +173,7 @@ impl JobTrait for ProvisioningJob { } } -impl ProvisioningJob { +impl ProvisionerJob { fn new( leaf: ActivatedLeaf, metrics: Metrics, @@ -626,5 +626,5 @@ async fn select_disputes( .collect()) } -/// The provisioning subsystem. -pub type ProvisioningSubsystem = JobSubsystem; +/// The provisioner subsystem. +pub type ProvisionerSubsystem = JobSubsystem; diff --git a/node/network/statement-distribution/src/lib.rs b/node/network/statement-distribution/src/lib.rs index d6ca288165ae..2194aa806a60 100644 --- a/node/network/statement-distribution/src/lib.rs +++ b/node/network/statement-distribution/src/lib.rs @@ -104,7 +104,7 @@ const LOG_TARGET: &str = "parachain::statement-distribution"; const MAX_LARGE_STATEMENTS_PER_SENDER: usize = 20; /// The statement distribution subsystem. -pub struct StatementDistribution { +pub struct StatementDistributionSubsystem { /// Pointer to a keystore, which is required for determining this node's validator index. keystore: SyncCryptoStorePtr, /// Receiver for incoming large statement requests. @@ -113,7 +113,7 @@ pub struct StatementDistribution { metrics: Metrics, } -impl overseer::Subsystem for StatementDistribution +impl overseer::Subsystem for StatementDistributionSubsystem where Context: SubsystemContext, Context: overseer::SubsystemContext, @@ -131,14 +131,14 @@ where } } -impl StatementDistribution { +impl StatementDistributionSubsystem { /// Create a new Statement Distribution Subsystem pub fn new( keystore: SyncCryptoStorePtr, req_receiver: IncomingRequestReceiver, metrics: Metrics, - ) -> StatementDistribution { - StatementDistribution { keystore, req_receiver: Some(req_receiver), metrics } + ) -> Self { + Self { keystore, req_receiver: Some(req_receiver), metrics } } } @@ -1535,7 +1535,7 @@ async fn handle_network_update( } } -impl StatementDistribution { +impl StatementDistributionSubsystem { async fn run( mut self, mut ctx: (impl SubsystemContext diff --git a/node/network/statement-distribution/src/tests.rs b/node/network/statement-distribution/src/tests.rs index afe1d59f0207..41263a6862bf 100644 --- a/node/network/statement-distribution/src/tests.rs +++ b/node/network/statement-distribution/src/tests.rs @@ -703,7 +703,7 @@ fn receiving_from_one_sends_to_another_and_to_candidate_backing() { let (statement_req_receiver, _) = IncomingRequest::get_config_receiver(); let bg = async move { - let s = StatementDistribution::new( + let s = StatementDistributionSubsystem::new( Arc::new(LocalKeystore::in_memory()), statement_req_receiver, Default::default(), @@ -895,7 +895,7 @@ fn receiving_large_statement_from_one_sends_to_another_and_to_candidate_backing( let (statement_req_receiver, mut req_cfg) = IncomingRequest::get_config_receiver(); let bg = async move { - let s = StatementDistribution::new( + let s = StatementDistributionSubsystem::new( make_ferdie_keystore(), statement_req_receiver, Default::default(), @@ -1394,7 +1394,7 @@ fn share_prioritizes_backing_group() { let (statement_req_receiver, mut req_cfg) = IncomingRequest::get_config_receiver(); let bg = async move { - let s = StatementDistribution::new( + let s = StatementDistributionSubsystem::new( make_ferdie_keystore(), statement_req_receiver, Default::default(), @@ -1679,7 +1679,7 @@ fn peer_cant_flood_with_large_statements() { let (statement_req_receiver, _) = IncomingRequest::get_config_receiver(); let bg = async move { - let s = StatementDistribution::new( + let s = StatementDistributionSubsystem::new( make_ferdie_keystore(), statement_req_receiver, Default::default(), diff --git a/node/service/src/overseer.rs b/node/service/src/overseer.rs index 08d94445df8b..2441c688babe 100644 --- a/node/service/src/overseer.rs +++ b/node/service/src/overseer.rs @@ -59,9 +59,9 @@ pub use polkadot_node_core_candidate_validation::CandidateValidationSubsystem; pub use polkadot_node_core_chain_api::ChainApiSubsystem; pub use polkadot_node_core_chain_selection::ChainSelectionSubsystem; pub use polkadot_node_core_dispute_coordinator::DisputeCoordinatorSubsystem; -pub use polkadot_node_core_provisioner::ProvisioningSubsystem as ProvisionerSubsystem; +pub use polkadot_node_core_provisioner::ProvisionerSubsystem; pub use polkadot_node_core_runtime_api::RuntimeApiSubsystem; -pub use polkadot_statement_distribution::StatementDistribution as StatementDistributionSubsystem; +pub use polkadot_statement_distribution::StatementDistributionSubsystem; /// Arguments passed for overseer construction. pub struct OverseerGenArgs<'a, Spawner, RuntimeClient> From 0f21c60844bd700f410872257ca57a4123fe557c Mon Sep 17 00:00:00 2001 From: Javier Viola Date: Thu, 16 Dec 2021 14:23:21 -0300 Subject: [PATCH 3/4] Support new version of zombienet (#4528) * test new version of zombienet * use default chain spec command * use commit ref to get test files * change test spec for zombienet new versionzombienet_tests/parachains/0001-parachains-smoke-test.toml * changes for new version of zombienet * use paritytech zombienet version --- .gitlab-ci.yml | 4 ++-- node/malus/integrationtests/0001-dispute-valid-block.toml | 5 ++--- zombienet_tests/parachains/0001-parachains-smoke-test.toml | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b068ac9ab4fc..6d7977f2a7f7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -621,7 +621,7 @@ zombienet-tests-parachains-smoke-test: - job: publish-adder-collator-image variables: - GH_DIR: 'https://github.com/paritytech/polkadot/tree/master/zombienet_tests/parachains' + GH_DIR: 'https://github.com/paritytech/polkadot/tree/${CI_COMMIT_SHORT_SHA}/zombienet_tests/parachains' before_script: - echo "Zombie-net Tests Config" @@ -658,7 +658,7 @@ zombienet-tests-malus-dispute-valid: - job: publish-adder-collator-image variables: - GH_DIR: 'https://github.com/paritytech/polkadot/tree/master/node/malus/integrationtests' + GH_DIR: 'https://github.com/paritytech/polkadot/tree/${CI_COMMIT_SHORT_SHA}/node/malus/integrationtests' before_script: - echo "Zombie-net Tests Config" diff --git a/node/malus/integrationtests/0001-dispute-valid-block.toml b/node/malus/integrationtests/0001-dispute-valid-block.toml index a1d711cd78dc..9a4917841d30 100644 --- a/node/malus/integrationtests/0001-dispute-valid-block.toml +++ b/node/malus/integrationtests/0001-dispute-valid-block.toml @@ -4,7 +4,6 @@ timeout = 1000 [relaychain] default_image = "{{ZOMBIENET_INTEGRATION_TEST_IMAGE}}" chain = "wococo-local" -chain_spec_command = "polkadot build-spec --chain wococo-local --disable-default-bootnode --raw > /cfg/wococo-local.json" command = "polkadot" [[relaychain.nodes]] @@ -23,7 +22,7 @@ command = "polkadot" extra_args = [ "--charlie", "-lparachain=debug" ] [[relaychain.nodes]] - name = "david" + name = "dave" validator = true command = "/usr/local/bin/malus dispute-ancestor" extra_args = ["--dave", "-lparachain=debug"] @@ -37,4 +36,4 @@ id = 100 name = "collator01" image = "{{COL_IMAGE}}" command = "/usr/local/bin/adder-collator" - args = ["-lparachain=debug"] \ No newline at end of file + args = ["-lparachain=debug"] diff --git a/zombienet_tests/parachains/0001-parachains-smoke-test.toml b/zombienet_tests/parachains/0001-parachains-smoke-test.toml index 2b1a9fb0fa59..43fa65af67e7 100644 --- a/zombienet_tests/parachains/0001-parachains-smoke-test.toml +++ b/zombienet_tests/parachains/0001-parachains-smoke-test.toml @@ -4,7 +4,6 @@ timeout = 1000 [relaychain] default_image = "{{ZOMBIENET_INTEGRATION_TEST_IMAGE}}" chain = "rococo-local" -chain_spec_command = "polkadot build-spec --chain rococo-local --disable-default-bootnode --raw > /cfg/rococo-local.json" command = "polkadot" [[relaychain.nodes]] @@ -17,6 +16,7 @@ command = "polkadot" [[parachains]] id = 100 +addToGenesis = false [parachains.collator] name = "collator01" From 952d77378bb927cab6ee0bb9c77f8ee02c4dc59e Mon Sep 17 00:00:00 2001 From: Sergei Shulepov Date: Thu, 16 Dec 2021 19:10:46 +0100 Subject: [PATCH 4/4] Fix fmt on master (#4546) --- runtime/parachains/src/paras.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/runtime/parachains/src/paras.rs b/runtime/parachains/src/paras.rs index c66e6a80f3ef..2997f302da44 100644 --- a/runtime/parachains/src/paras.rs +++ b/runtime/parachains/src/paras.rs @@ -1452,10 +1452,7 @@ impl Pallet { // // NOTE: we cannot set `UpgradeGoAheadSignal` signal here since this will be reset by // the following call `note_new_head` - log::warn!( - target: LOG_TARGET, - "ended up scheduling an upgrade while one is pending", - ); + log::warn!(target: LOG_TARGET, "ended up scheduling an upgrade while one is pending",); return weight }