diff --git a/polkadot/node/core/av-store/Cargo.toml b/polkadot/node/core/av-store/Cargo.toml index f8f7d340d8014a647ccc23bdaf2a74c621169659..1ce4168817bbdec13e6ca39cd6c2a263c512841f 100644 --- a/polkadot/node/core/av-store/Cargo.toml +++ b/polkadot/node/core/av-store/Cargo.toml @@ -14,7 +14,7 @@ bitvec = "1.0.0" parity-scale-codec = { version = "3.1.2", features = ["derive"] } erasure = { package = "polkadot-erasure-coding", path = "../../../erasure-coding" } -polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../../subsystem" } +polkadot-node-subsystem = {path = "../../subsystem" } polkadot-node-subsystem-util = { path = "../../subsystem-util" } polkadot-overseer = { path = "../../overseer" } polkadot-primitives = { path = "../../../primitives" } diff --git a/polkadot/node/core/av-store/src/lib.rs b/polkadot/node/core/av-store/src/lib.rs index 9c7fb929530226c21bb24fb4e75336daae518393..dbb30fdda02a18026e4695f08051414c8db4131a 100644 --- a/polkadot/node/core/av-store/src/lib.rs +++ b/polkadot/node/core/av-store/src/lib.rs @@ -33,16 +33,16 @@ use polkadot_node_subsystem_util::database::{DBTransaction, Database}; use bitvec::{order::Lsb0 as BitOrderLsb0, vec::BitVec}; use polkadot_node_primitives::{AvailableData, ErasureChunk}; -use polkadot_node_subsystem_util as util; -use polkadot_primitives::v2::{ - BlockNumber, CandidateEvent, CandidateHash, CandidateReceipt, Hash, Header, ValidatorIndex, -}; -use polkadot_subsystem::{ +use polkadot_node_subsystem::{ errors::{ChainApiError, RuntimeApiError}, messages::{AvailabilityStoreMessage, ChainApiMessage}, overseer, ActiveLeavesUpdate, FromOverseer, OverseerSignal, SpawnedSubsystem, SubsystemContext, SubsystemError, }; +use polkadot_node_subsystem_util as util; +use polkadot_primitives::v2::{ + BlockNumber, CandidateEvent, CandidateHash, CandidateReceipt, Hash, Header, ValidatorIndex, +}; mod metrics; pub use self::metrics::*; diff --git a/polkadot/node/core/av-store/src/tests.rs b/polkadot/node/core/av-store/src/tests.rs index f1e04faa3faf4b096a9c84ceb1249c0d8958ae44..8c8a65864f8dbde36753ff67f0c66e0ef270f375 100644 --- a/polkadot/node/core/av-store/src/tests.rs +++ b/polkadot/node/core/av-store/src/tests.rs @@ -22,18 +22,18 @@ use futures::{channel::oneshot, executor, future, Future}; use ::test_helpers::TestCandidateBuilder; use parking_lot::Mutex; use polkadot_node_primitives::{AvailableData, BlockData, PoV, Proof}; +use polkadot_node_subsystem::{ + errors::RuntimeApiError, + jaeger, + messages::{AllMessages, RuntimeApiMessage, RuntimeApiRequest}, + ActivatedLeaf, ActiveLeavesUpdate, LeafStatus, +}; use polkadot_node_subsystem_test_helpers as test_helpers; use polkadot_node_subsystem_util::{database::Database, TimeoutExt}; use polkadot_primitives::v2::{ CandidateHash, CandidateReceipt, CoreIndex, GroupIndex, HeadData, Header, PersistedValidationData, ValidatorId, }; -use polkadot_subsystem::{ - errors::RuntimeApiError, - jaeger, - messages::{AllMessages, RuntimeApiMessage, RuntimeApiRequest}, - ActivatedLeaf, ActiveLeavesUpdate, LeafStatus, -}; use sp_keyring::Sr25519Keyring; mod columns { diff --git a/polkadot/node/core/backing/Cargo.toml b/polkadot/node/core/backing/Cargo.toml index 61c2f8d8c306af32e13d57f0257b6a965763b502..fcc3ecb76186aa7a9fac7193276a885d09ce886d 100644 --- a/polkadot/node/core/backing/Cargo.toml +++ b/polkadot/node/core/backing/Cargo.toml @@ -9,7 +9,7 @@ futures = "0.3.21" sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" } polkadot-primitives = { path = "../../../primitives" } polkadot-node-primitives = { path = "../../primitives" } -polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../../subsystem" } +polkadot-node-subsystem = {path = "../../subsystem" } polkadot-node-subsystem-util = { path = "../../subsystem-util" } erasure-coding = { package = "polkadot-erasure-coding", path = "../../../erasure-coding" } statement-table = { package = "polkadot-statement-table", path = "../../../statement-table" } diff --git a/polkadot/node/core/backing/src/error.rs b/polkadot/node/core/backing/src/error.rs index 39f5c8b7f3fdde70ab321045885792bd192076aa..604c6c0a0c377c2f90b96e2802eb389187446444 100644 --- a/polkadot/node/core/backing/src/error.rs +++ b/polkadot/node/core/backing/src/error.rs @@ -17,9 +17,9 @@ use fatality::Nested; use futures::channel::{mpsc, oneshot}; +use polkadot_node_subsystem::{messages::ValidationFailed, SubsystemError}; use polkadot_node_subsystem_util::Error as UtilError; use polkadot_primitives::v2::BackedCandidate; -use polkadot_subsystem::{messages::ValidationFailed, SubsystemError}; use crate::LOG_TARGET; diff --git a/polkadot/node/core/backing/src/lib.rs b/polkadot/node/core/backing/src/lib.rs index 56a077e06ad4f60e15e0ddeff6a8629e83f91ef5..264e7e27016da19108933bc89a3c34a55812341c 100644 --- a/polkadot/node/core/backing/src/lib.rs +++ b/polkadot/node/core/backing/src/lib.rs @@ -34,16 +34,7 @@ use polkadot_node_primitives::{ AvailableData, InvalidCandidate, PoV, SignedDisputeStatement, SignedFullStatement, Statement, ValidationResult, BACKING_EXECUTION_TIMEOUT, }; -use polkadot_node_subsystem_util::{ - self as util, request_from_runtime, request_session_index_for_child, request_validator_groups, - request_validators, Validator, -}; -use polkadot_primitives::v2::{ - BackedCandidate, CandidateCommitments, CandidateHash, CandidateReceipt, CollatorId, - CommittedCandidateReceipt, CoreIndex, CoreState, Hash, Id as ParaId, SessionIndex, - SigningContext, ValidatorId, ValidatorIndex, ValidatorSignature, ValidityAttestation, -}; -use polkadot_subsystem::{ +use polkadot_node_subsystem::{ jaeger, messages::{ AllMessages, AvailabilityDistributionMessage, AvailabilityStoreMessage, @@ -54,6 +45,15 @@ use polkadot_subsystem::{ overseer, ActiveLeavesUpdate, FromOverseer, OverseerSignal, PerLeafSpan, SpawnedSubsystem, Stage, SubsystemContext, SubsystemError, SubsystemSender, }; +use polkadot_node_subsystem_util::{ + self as util, request_from_runtime, request_session_index_for_child, request_validator_groups, + request_validators, Validator, +}; +use polkadot_primitives::v2::{ + BackedCandidate, CandidateCommitments, CandidateHash, CandidateReceipt, CollatorId, + CommittedCandidateReceipt, CoreIndex, CoreState, Hash, Id as ParaId, SessionIndex, + SigningContext, ValidatorId, ValidatorIndex, ValidatorSignature, ValidityAttestation, +}; use sp_keystore::SyncCryptoStorePtr; use statement_table::{ generic::AttestedCandidate as TableAttestedCandidate, diff --git a/polkadot/node/core/backing/src/tests.rs b/polkadot/node/core/backing/src/tests.rs index dbe65f5256f200065aa12b28a2c94759da02cce6..e60d5112be1c97394d6b48658ab683ccba32129f 100644 --- a/polkadot/node/core/backing/src/tests.rs +++ b/polkadot/node/core/backing/src/tests.rs @@ -22,15 +22,15 @@ use ::test_helpers::{ use assert_matches::assert_matches; use futures::{future, Future}; use polkadot_node_primitives::{BlockData, InvalidCandidate}; +use polkadot_node_subsystem::{ + messages::{CollatorProtocolMessage, RuntimeApiMessage, RuntimeApiRequest, ValidationFailed}, + ActivatedLeaf, ActiveLeavesUpdate, FromOverseer, LeafStatus, OverseerSignal, +}; use polkadot_node_subsystem_test_helpers as test_helpers; use polkadot_primitives::v2::{ CandidateDescriptor, CollatorId, GroupRotationInfo, HeadData, PersistedValidationData, ScheduledCore, }; -use polkadot_subsystem::{ - messages::{CollatorProtocolMessage, RuntimeApiMessage, RuntimeApiRequest, ValidationFailed}, - ActivatedLeaf, ActiveLeavesUpdate, FromOverseer, LeafStatus, OverseerSignal, -}; use sp_application_crypto::AppKey; use sp_keyring::Sr25519Keyring; use sp_keystore::{CryptoStore, SyncCryptoStore}; diff --git a/polkadot/node/core/candidate-validation/Cargo.toml b/polkadot/node/core/candidate-validation/Cargo.toml index f82a22eb9d7aa3ca20729c3e4c771c260c4b7c8f..f98603c15a257493b9dbe98ee8f4a246ad87e286 100644 --- a/polkadot/node/core/candidate-validation/Cargo.toml +++ b/polkadot/node/core/candidate-validation/Cargo.toml @@ -15,7 +15,7 @@ parity-scale-codec = { version = "3.1.2", default-features = false, features = [ polkadot-primitives = { path = "../../../primitives" } polkadot-parachain = { path = "../../../parachain" } polkadot-node-primitives = { path = "../../primitives" } -polkadot-node-subsystem = { package = "polkadot-node-subsystem", path = "../../subsystem" } +polkadot-node-subsystem = {path = "../../subsystem" } polkadot-node-subsystem-util = { path = "../../subsystem-util" } [target.'cfg(not(any(target_os = "android", target_os = "unknown")))'.dependencies] diff --git a/polkadot/node/core/chain-api/Cargo.toml b/polkadot/node/core/chain-api/Cargo.toml index 0d9ec8d3c2f25d972107825a9e75a0d033e15e40..c2df290d209b700adfb7a61c721cb361c6f9ec3f 100644 --- a/polkadot/node/core/chain-api/Cargo.toml +++ b/polkadot/node/core/chain-api/Cargo.toml @@ -9,7 +9,7 @@ futures = "0.3.21" gum = { package = "tracing-gum", path = "../../gum" } sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "master" } polkadot-primitives = { path = "../../../primitives" } -polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../../subsystem" } +polkadot-node-subsystem = {path = "../../subsystem" } polkadot-node-subsystem-util = { path = "../../subsystem-util" } sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-consensus-babe = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/polkadot/node/core/chain-api/src/lib.rs b/polkadot/node/core/chain-api/src/lib.rs index bea0d513369a1a36ecba2149dfa1d1a4a3b98b98..36282a2edcccadd0ba153cb162cef522ffd4915f 100644 --- a/polkadot/node/core/chain-api/src/lib.rs +++ b/polkadot/node/core/chain-api/src/lib.rs @@ -37,11 +37,11 @@ use futures::prelude::*; use sc_client_api::AuxStore; use sp_blockchain::HeaderBackend; -use polkadot_primitives::v2::{Block, BlockId}; -use polkadot_subsystem::{ +use polkadot_node_subsystem::{ messages::ChainApiMessage, overseer, FromOverseer, OverseerSignal, SpawnedSubsystem, SubsystemContext, SubsystemError, SubsystemResult, }; +use polkadot_primitives::v2::{Block, BlockId}; mod metrics; use self::metrics::Metrics; diff --git a/polkadot/node/core/runtime-api/Cargo.toml b/polkadot/node/core/runtime-api/Cargo.toml index da036d602725796aecda32c360f5435fb730cd7a..3e63c4d86d17a90c12459bd272ece51804c95412 100644 --- a/polkadot/node/core/runtime-api/Cargo.toml +++ b/polkadot/node/core/runtime-api/Cargo.toml @@ -16,7 +16,7 @@ sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-consensus-babe = { git = "https://github.com/paritytech/substrate", branch = "master" } polkadot-primitives = { path = "../../../primitives" } -polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../../subsystem" } +polkadot-node-subsystem = {path = "../../subsystem" } polkadot-node-subsystem-util = { path = "../../subsystem-util" } [dev-dependencies] diff --git a/polkadot/node/core/runtime-api/src/lib.rs b/polkadot/node/core/runtime-api/src/lib.rs index d10483c800105f4bceac8287d6a71494731f32dc..fa20a2ad768a1e9af7abdaa9babef8135f5d3227 100644 --- a/polkadot/node/core/runtime-api/src/lib.rs +++ b/polkadot/node/core/runtime-api/src/lib.rs @@ -22,16 +22,16 @@ #![deny(unused_crate_dependencies)] #![warn(missing_docs)] -use polkadot_primitives::{ - runtime_api::ParachainHost, - v2::{Block, BlockId, Hash}, -}; -use polkadot_subsystem::{ +use polkadot_node_subsystem::{ errors::RuntimeApiError, messages::{RuntimeApiMessage, RuntimeApiRequest as Request}, overseer, FromOverseer, OverseerSignal, SpawnedSubsystem, SubsystemContext, SubsystemError, SubsystemResult, }; +use polkadot_primitives::{ + runtime_api::ParachainHost, + v2::{Block, BlockId, Hash}, +}; use sp_api::ProvideRuntimeApi; use sp_authority_discovery::AuthorityDiscoveryApi; diff --git a/polkadot/node/network/availability-distribution/Cargo.toml b/polkadot/node/network/availability-distribution/Cargo.toml index b5ec1fcb5a9a1d455263a136f4f37e0366d9ccf6..0589fd684977c9990fc5bdf9a2a71ac23dba405f 100644 --- a/polkadot/node/network/availability-distribution/Cargo.toml +++ b/polkadot/node/network/availability-distribution/Cargo.toml @@ -10,8 +10,8 @@ gum = { package = "tracing-gum", path = "../../gum" } parity-scale-codec = { version = "3.1.2", features = ["std"] } polkadot-primitives = { path = "../../../primitives" } polkadot-erasure-coding = { path = "../../../erasure-coding" } -polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../../subsystem" } polkadot-node-network-protocol = { path = "../../network/protocol" } +polkadot-node-subsystem = { path = "../../subsystem" } polkadot-node-subsystem-util = { path = "../../subsystem-util" } polkadot-node-primitives = { path = "../../primitives" } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", features = ["std"] } @@ -23,7 +23,7 @@ lru = "0.7.5" fatality = "0.0.6" [dev-dependencies] -polkadot-subsystem-testhelpers = { package = "polkadot-node-subsystem-test-helpers", path = "../../subsystem-test-helpers" } +polkadot-node-subsystem-test-helpers = { path = "../../subsystem-test-helpers" } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", features = ["std"] } sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-tracing = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/polkadot/node/network/availability-distribution/src/error.rs b/polkadot/node/network/availability-distribution/src/error.rs index 8f6fd9987748cbe42a95593acce4ac5ce580a0fb..13c126360a6d0738babf3a63efbf56d3f4cf6e96 100644 --- a/polkadot/node/network/availability-distribution/src/error.rs +++ b/polkadot/node/network/availability-distribution/src/error.rs @@ -23,8 +23,8 @@ use polkadot_primitives::v2::SessionIndex; use futures::channel::oneshot; +use polkadot_node_subsystem::{ChainApiError, SubsystemError}; use polkadot_node_subsystem_util::runtime; -use polkadot_subsystem::{ChainApiError, SubsystemError}; use crate::LOG_TARGET; diff --git a/polkadot/node/network/availability-distribution/src/lib.rs b/polkadot/node/network/availability-distribution/src/lib.rs index c09fb208df41f9e9417c18d842c69ed4742acb37..f26a2c78e5d75e69f2e8857fe2d4a8dac1fc9704 100644 --- a/polkadot/node/network/availability-distribution/src/lib.rs +++ b/polkadot/node/network/availability-distribution/src/lib.rs @@ -19,7 +19,7 @@ use futures::{future::Either, FutureExt, StreamExt, TryFutureExt}; use sp_keystore::SyncCryptoStorePtr; use polkadot_node_network_protocol::request_response::{v1, IncomingRequestReceiver}; -use polkadot_subsystem::{ +use polkadot_node_subsystem::{ messages::AvailabilityDistributionMessage, overseer, FromOverseer, OverseerSignal, SpawnedSubsystem, SubsystemContext, SubsystemError, }; diff --git a/polkadot/node/network/availability-distribution/src/pov_requester/mod.rs b/polkadot/node/network/availability-distribution/src/pov_requester/mod.rs index b4ff76aa82c885139b5e4279c5c248ebac501da6..b1b9af35ef4e33603480e474635a10c528f795b1 100644 --- a/polkadot/node/network/availability-distribution/src/pov_requester/mod.rs +++ b/polkadot/node/network/availability-distribution/src/pov_requester/mod.rs @@ -24,13 +24,13 @@ use polkadot_node_network_protocol::request_response::{ OutgoingRequest, Recipient, }; use polkadot_node_primitives::PoV; -use polkadot_node_subsystem_util::runtime::RuntimeInfo; -use polkadot_primitives::v2::{AuthorityDiscoveryId, CandidateHash, Hash, ValidatorIndex}; -use polkadot_subsystem::{ +use polkadot_node_subsystem::{ jaeger, messages::{IfDisconnected, NetworkBridgeMessage}, SubsystemContext, }; +use polkadot_node_subsystem_util::runtime::RuntimeInfo; +use polkadot_primitives::v2::{AuthorityDiscoveryId, CandidateHash, Hash, ValidatorIndex}; use crate::{ error::{Error, FatalError, JfyiError, Result}, @@ -133,11 +133,11 @@ mod tests { use sp_core::testing::TaskExecutor; use polkadot_node_primitives::BlockData; - use polkadot_primitives::v2::{CandidateHash, Hash, ValidatorIndex}; - use polkadot_subsystem::messages::{ + use polkadot_node_subsystem::messages::{ AllMessages, AvailabilityDistributionMessage, RuntimeApiMessage, RuntimeApiRequest, }; - use polkadot_subsystem_testhelpers as test_helpers; + use polkadot_node_subsystem_test_helpers as test_helpers; + use polkadot_primitives::v2::{CandidateHash, Hash, ValidatorIndex}; use test_helpers::mock::make_ferdie_keystore; use super::*; diff --git a/polkadot/node/network/availability-distribution/src/requester/fetch_task/mod.rs b/polkadot/node/network/availability-distribution/src/requester/fetch_task/mod.rs index 0e751435196f210a5354742d5f7ba7ca9cc139ee..9945dd1b4a537b1003d04e58a1ef560bde3659c4 100644 --- a/polkadot/node/network/availability-distribution/src/requester/fetch_task/mod.rs +++ b/polkadot/node/network/availability-distribution/src/requester/fetch_task/mod.rs @@ -28,15 +28,15 @@ use polkadot_node_network_protocol::request_response::{ v1::{ChunkFetchingRequest, ChunkFetchingResponse}, }; use polkadot_node_primitives::ErasureChunk; -use polkadot_primitives::v2::{ - AuthorityDiscoveryId, BlakeTwo256, CandidateHash, GroupIndex, Hash, HashT, OccupiedCore, - SessionIndex, -}; -use polkadot_subsystem::{ +use polkadot_node_subsystem::{ jaeger, messages::{AllMessages, AvailabilityStoreMessage, IfDisconnected, NetworkBridgeMessage}, SubsystemContext, }; +use polkadot_primitives::v2::{ + AuthorityDiscoveryId, BlakeTwo256, CandidateHash, GroupIndex, Hash, HashT, OccupiedCore, + SessionIndex, +}; use crate::{ error::{FatalError, Result}, diff --git a/polkadot/node/network/availability-distribution/src/requester/fetch_task/tests.rs b/polkadot/node/network/availability-distribution/src/requester/fetch_task/tests.rs index 432ef17e9995667c2fce7321c968d4ced85011a8..dea0d187f2d85f0a29f601f1fe1d8cbbc4a4531d 100644 --- a/polkadot/node/network/availability-distribution/src/requester/fetch_task/tests.rs +++ b/polkadot/node/network/availability-distribution/src/requester/fetch_task/tests.rs @@ -30,6 +30,7 @@ use sp_keyring::Sr25519Keyring; use polkadot_node_network_protocol::request_response::{v1, Recipient}; use polkadot_node_primitives::{BlockData, PoV, Proof}; +use polkadot_node_subsystem::messages::AllMessages; use polkadot_primitives::v2::{CandidateHash, ValidatorIndex}; use super::*; diff --git a/polkadot/node/network/availability-distribution/src/requester/mod.rs b/polkadot/node/network/availability-distribution/src/requester/mod.rs index 95bae7c618dc6f77d7e0877e61d59c5a49b3ff9c..b1ea7a98c1f374fecedab5a9f686088b72b93038 100644 --- a/polkadot/node/network/availability-distribution/src/requester/mod.rs +++ b/polkadot/node/network/availability-distribution/src/requester/mod.rs @@ -32,12 +32,12 @@ use futures::{ Stream, }; -use polkadot_node_subsystem_util::runtime::{get_occupied_cores, RuntimeInfo}; -use polkadot_primitives::v2::{CandidateHash, Hash, OccupiedCore, SessionIndex}; -use polkadot_subsystem::{ +use polkadot_node_subsystem::{ messages::{AllMessages, ChainApiMessage}, ActivatedLeaf, ActiveLeavesUpdate, LeafStatus, SubsystemContext, }; +use polkadot_node_subsystem_util::runtime::{get_occupied_cores, RuntimeInfo}; +use polkadot_primitives::v2::{CandidateHash, Hash, OccupiedCore, SessionIndex}; use super::{FatalError, Metrics, Result, LOG_TARGET}; diff --git a/polkadot/node/network/availability-distribution/src/requester/session_cache.rs b/polkadot/node/network/availability-distribution/src/requester/session_cache.rs index 78b4da36058dd17eb1c63c27f6d3c7ba1b7d9f81..e9febc864322687d04d888297a23e88af4669b89 100644 --- a/polkadot/node/network/availability-distribution/src/requester/session_cache.rs +++ b/polkadot/node/network/availability-distribution/src/requester/session_cache.rs @@ -19,11 +19,11 @@ use std::collections::HashSet; use lru::LruCache; use rand::{seq::SliceRandom, thread_rng}; +use polkadot_node_subsystem::SubsystemContext; use polkadot_node_subsystem_util::runtime::RuntimeInfo; use polkadot_primitives::v2::{ AuthorityDiscoveryId, GroupIndex, Hash, SessionIndex, ValidatorIndex, }; -use polkadot_subsystem::SubsystemContext; use crate::{ error::{Error, Result}, diff --git a/polkadot/node/network/availability-distribution/src/requester/tests.rs b/polkadot/node/network/availability-distribution/src/requester/tests.rs index a5096f9014b4171ba22b5f4b493e0b0fdecc2fa9..64e695530b687e4ca2f56f02701e1794b899ba0b 100644 --- a/polkadot/node/network/availability-distribution/src/requester/tests.rs +++ b/polkadot/node/network/availability-distribution/src/requester/tests.rs @@ -25,14 +25,14 @@ use polkadot_primitives::v2::{ BlockNumber, CoreState, GroupIndex, Hash, Id, ScheduledCore, SessionIndex, SessionInfo, }; -use polkadot_subsystem::{ +use polkadot_node_subsystem::{ messages::{ AllMessages, AvailabilityDistributionMessage, AvailabilityStoreMessage, ChainApiMessage, NetworkBridgeMessage, RuntimeApiMessage, RuntimeApiRequest, }, ActivatedLeaf, ActiveLeavesUpdate, LeafStatus, }; -use polkadot_subsystem_testhelpers::{ +use polkadot_node_subsystem_test_helpers::{ make_subsystem_context, mock::make_ferdie_keystore, TestSubsystemContext, TestSubsystemContextHandle, }; diff --git a/polkadot/node/network/availability-distribution/src/responder.rs b/polkadot/node/network/availability-distribution/src/responder.rs index f3691b5d0266404fba92e185eb616996d155be08..0520a86ca1d298b240d171d0abd469a4b6f9e1c5 100644 --- a/polkadot/node/network/availability-distribution/src/responder.rs +++ b/polkadot/node/network/availability-distribution/src/responder.rs @@ -26,8 +26,8 @@ use polkadot_node_network_protocol::{ UnifiedReputationChange as Rep, }; use polkadot_node_primitives::{AvailableData, ErasureChunk}; +use polkadot_node_subsystem::{jaeger, messages::AvailabilityStoreMessage, SubsystemSender}; use polkadot_primitives::v2::{CandidateHash, ValidatorIndex}; -use polkadot_subsystem::{jaeger, messages::AvailabilityStoreMessage, SubsystemSender}; use crate::{ error::{JfyiError, Result}, diff --git a/polkadot/node/network/availability-distribution/src/tests/mod.rs b/polkadot/node/network/availability-distribution/src/tests/mod.rs index d82c7f2f5a723dd0819dd016be6d050068a8ac31..fd5d0dafaf1f0c7d7d1fb9071bf68238b9356f27 100644 --- a/polkadot/node/network/availability-distribution/src/tests/mod.rs +++ b/polkadot/node/network/availability-distribution/src/tests/mod.rs @@ -22,7 +22,7 @@ use polkadot_node_network_protocol::request_response::IncomingRequest; use polkadot_primitives::v2::CoreState; use sp_keystore::SyncCryptoStorePtr; -use polkadot_subsystem_testhelpers as test_helpers; +use polkadot_node_subsystem_test_helpers as test_helpers; use super::*; diff --git a/polkadot/node/network/availability-distribution/src/tests/state.rs b/polkadot/node/network/availability-distribution/src/tests/state.rs index b4bda8375949182e423738898018f82bbd163548..2659eafcbb13dad072ee33afba1ff3777945becc 100644 --- a/polkadot/node/network/availability-distribution/src/tests/state.rs +++ b/polkadot/node/network/availability-distribution/src/tests/state.rs @@ -20,8 +20,8 @@ use std::{ time::Duration, }; +use polkadot_node_subsystem_test_helpers::TestSubsystemContextHandle; use polkadot_node_subsystem_util::TimeoutExt; -use polkadot_subsystem_testhelpers::TestSubsystemContextHandle; use futures::{ channel::{mpsc, oneshot}, @@ -39,18 +39,18 @@ use polkadot_node_network_protocol::{ request_response::{v1, IncomingRequest, OutgoingRequest, Requests}, }; use polkadot_node_primitives::ErasureChunk; -use polkadot_primitives::v2::{ - CandidateHash, CoreState, GroupIndex, Hash, Id as ParaId, ScheduledCore, SessionInfo, - ValidatorIndex, -}; -use polkadot_subsystem::{ +use polkadot_node_subsystem::{ messages::{ AllMessages, AvailabilityDistributionMessage, AvailabilityStoreMessage, ChainApiMessage, NetworkBridgeMessage, RuntimeApiMessage, RuntimeApiRequest, }, ActivatedLeaf, ActiveLeavesUpdate, FromOverseer, LeafStatus, OverseerSignal, }; -use polkadot_subsystem_testhelpers as test_helpers; +use polkadot_node_subsystem_test_helpers as test_helpers; +use polkadot_primitives::v2::{ + CandidateHash, CoreState, GroupIndex, Hash, Id as ParaId, ScheduledCore, SessionInfo, + ValidatorIndex, +}; use test_helpers::{mock::make_ferdie_keystore, SingleItemSink}; use super::mock::{make_session_info, OccupiedCoreBuilder}; diff --git a/polkadot/node/network/availability-recovery/Cargo.toml b/polkadot/node/network/availability-recovery/Cargo.toml index 837b715c62bbf6a0998be35c73ffb31530abacd3..e63144a822eb6908373991f1c1b0d00b437a9a03 100644 --- a/polkadot/node/network/availability-recovery/Cargo.toml +++ b/polkadot/node/network/availability-recovery/Cargo.toml @@ -15,7 +15,7 @@ gum = { package = "tracing-gum", path = "../../gum" } polkadot-erasure-coding = { path = "../../../erasure-coding" } polkadot-primitives = { path = "../../../primitives" } polkadot-node-primitives = { path = "../../primitives" } -polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../../subsystem" } +polkadot-node-subsystem = {path = "../../subsystem" } polkadot-node-subsystem-util = { path = "../../subsystem-util" } polkadot-node-network-protocol = { path = "../../network/protocol" } parity-scale-codec = { version = "3.1.2", default-features = false, features = ["derive"] } @@ -32,5 +32,5 @@ sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "master sp-application-crypto = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-network = { git = "https://github.com/paritytech/substrate", branch = "master" } -polkadot-subsystem-test-helpers = { package = "polkadot-node-subsystem-test-helpers", path = "../../subsystem-test-helpers" } +polkadot-node-subsystem-test-helpers = { path = "../../subsystem-test-helpers" } polkadot-primitives-test-helpers = { path = "../../../primitives/test-helpers" } diff --git a/polkadot/node/network/availability-recovery/src/error.rs b/polkadot/node/network/availability-recovery/src/error.rs index 50a596ba2ac4884fb40b0b2def2109f03bc8f688..70f23bef92b972261b36bd68cb4d41dec3592a24 100644 --- a/polkadot/node/network/availability-recovery/src/error.rs +++ b/polkadot/node/network/availability-recovery/src/error.rs @@ -23,7 +23,7 @@ use thiserror::Error; #[derive(Debug, Error)] pub enum Error { #[error(transparent)] - Subsystem(#[from] polkadot_subsystem::SubsystemError), + Subsystem(#[from] polkadot_node_subsystem::SubsystemError), #[error("failed to query full data from store")] CanceledQueryFullData(#[source] oneshot::Canceled), @@ -35,7 +35,7 @@ pub enum Error { CanceledResponseSender, #[error(transparent)] - Runtime(#[from] polkadot_subsystem::errors::RuntimeApiError), + Runtime(#[from] polkadot_node_subsystem::errors::RuntimeApiError), #[error(transparent)] Erasure(#[from] polkadot_erasure_coding::Error), diff --git a/polkadot/node/network/availability-recovery/src/lib.rs b/polkadot/node/network/availability-recovery/src/lib.rs index 965912efd0b8fc98c9ae25f413359b015b08a943..533d4ec94f8d449a60552c8e72bdd9c90d1b1560 100644 --- a/polkadot/node/network/availability-recovery/src/lib.rs +++ b/polkadot/node/network/availability-recovery/src/lib.rs @@ -47,12 +47,7 @@ use polkadot_node_network_protocol::{ IfDisconnected, UnifiedReputationChange as Rep, }; use polkadot_node_primitives::{AvailableData, ErasureChunk}; -use polkadot_node_subsystem_util::request_session_info; -use polkadot_primitives::v2::{ - AuthorityDiscoveryId, BlakeTwo256, BlockNumber, CandidateHash, CandidateReceipt, GroupIndex, - Hash, HashT, SessionIndex, SessionInfo, ValidatorId, ValidatorIndex, -}; -use polkadot_subsystem::{ +use polkadot_node_subsystem::{ errors::RecoveryError, jaeger, messages::{AvailabilityRecoveryMessage, AvailabilityStoreMessage, NetworkBridgeMessage}, @@ -60,6 +55,11 @@ use polkadot_subsystem::{ ActiveLeavesUpdate, FromOverseer, OverseerSignal, SpawnedSubsystem, SubsystemContext, SubsystemError, SubsystemResult, SubsystemSender, }; +use polkadot_node_subsystem_util::request_session_info; +use polkadot_primitives::v2::{ + AuthorityDiscoveryId, BlakeTwo256, BlockNumber, CandidateHash, CandidateReceipt, GroupIndex, + Hash, HashT, SessionIndex, SessionInfo, ValidatorId, ValidatorIndex, +}; mod error; mod futures_undead; diff --git a/polkadot/node/network/availability-recovery/src/tests.rs b/polkadot/node/network/availability-recovery/src/tests.rs index 38d3a8b76062b24cdbd45235f572e72f47e49878..2aa5723a6900eb3879df30205a65c26d06bd2371 100644 --- a/polkadot/node/network/availability-recovery/src/tests.rs +++ b/polkadot/node/network/availability-recovery/src/tests.rs @@ -29,15 +29,15 @@ use sc_network::config::RequestResponseConfig; use polkadot_erasure_coding::{branches, obtain_chunks_v1 as obtain_chunks}; use polkadot_node_primitives::{BlockData, PoV, Proof}; -use polkadot_node_subsystem_util::TimeoutExt; -use polkadot_primitives::v2::{AuthorityDiscoveryId, HeadData, PersistedValidationData}; -use polkadot_primitives_test_helpers::{dummy_candidate_receipt, dummy_hash}; -use polkadot_subsystem::{ +use polkadot_node_subsystem::{ jaeger, messages::{AllMessages, RuntimeApiMessage, RuntimeApiRequest}, ActivatedLeaf, LeafStatus, }; -use polkadot_subsystem_test_helpers::{make_subsystem_context, TestSubsystemContextHandle}; +use polkadot_node_subsystem_test_helpers::{make_subsystem_context, TestSubsystemContextHandle}; +use polkadot_node_subsystem_util::TimeoutExt; +use polkadot_primitives::v2::{AuthorityDiscoveryId, HeadData, PersistedValidationData}; +use polkadot_primitives_test_helpers::{dummy_candidate_receipt, dummy_hash}; type VirtualOverseer = TestSubsystemContextHandle<AvailabilityRecoveryMessage>; diff --git a/polkadot/node/network/bitfield-distribution/Cargo.toml b/polkadot/node/network/bitfield-distribution/Cargo.toml index 20cdcde31ec6e06df9f77fa5c7c94e65a6492f1b..a0e132d012999f3a642d60c6f0ae6162a6832f46 100644 --- a/polkadot/node/network/bitfield-distribution/Cargo.toml +++ b/polkadot/node/network/bitfield-distribution/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" futures = "0.3.21" gum = { package = "tracing-gum", path = "../../gum" } polkadot-primitives = { path = "../../../primitives" } -polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../../subsystem" } +polkadot-node-subsystem = {path = "../../subsystem" } polkadot-node-subsystem-util = { path = "../../subsystem-util" } polkadot-node-network-protocol = { path = "../../network/protocol" } rand = "0.8" diff --git a/polkadot/node/network/bitfield-distribution/src/lib.rs b/polkadot/node/network/bitfield-distribution/src/lib.rs index 74245483e3d7d1716b386de2d0981f10c4c4894d..c2a17c5a42cb727ab458315a7e9a0ae9fb1a60ad 100644 --- a/polkadot/node/network/bitfield-distribution/src/lib.rs +++ b/polkadot/node/network/bitfield-distribution/src/lib.rs @@ -29,14 +29,14 @@ use polkadot_node_network_protocol::{ grid_topology::{RandomRouting, RequiredRouting, SessionGridTopology}, v1 as protocol_v1, OurView, PeerId, UnifiedReputationChange as Rep, Versioned, View, }; +use polkadot_node_subsystem::{ + jaeger, messages::*, overseer, ActiveLeavesUpdate, FromOverseer, OverseerSignal, PerLeafSpan, + SpawnedSubsystem, SubsystemContext, SubsystemError, SubsystemResult, +}; use polkadot_node_subsystem_util::{self as util}; use polkadot_primitives::v2::{ Hash, SessionIndex, SignedAvailabilityBitfield, SigningContext, ValidatorId, }; -use polkadot_subsystem::{ - jaeger, messages::*, overseer, ActiveLeavesUpdate, FromOverseer, OverseerSignal, PerLeafSpan, - SpawnedSubsystem, SubsystemContext, SubsystemError, SubsystemResult, -}; use rand::{CryptoRng, Rng, SeedableRng}; use std::collections::{HashMap, HashSet}; diff --git a/polkadot/node/network/bitfield-distribution/src/tests.rs b/polkadot/node/network/bitfield-distribution/src/tests.rs index 6a8363c887aa55e8bcf9fe4818622b94279da94e..16c7656052081a1a5c9c5f602681200800914941 100644 --- a/polkadot/node/network/bitfield-distribution/src/tests.rs +++ b/polkadot/node/network/bitfield-distribution/src/tests.rs @@ -20,13 +20,13 @@ use bitvec::bitvec; use futures::executor; use maplit::hashmap; use polkadot_node_network_protocol::{our_view, view, ObservedRole}; -use polkadot_node_subsystem_test_helpers::make_subsystem_context; -use polkadot_node_subsystem_util::TimeoutExt; -use polkadot_primitives::v2::{AvailabilityBitfield, Signed, ValidatorIndex}; -use polkadot_subsystem::{ +use polkadot_node_subsystem::{ jaeger, jaeger::{PerLeafSpan, Span}, }; +use polkadot_node_subsystem_test_helpers::make_subsystem_context; +use polkadot_node_subsystem_util::TimeoutExt; +use polkadot_primitives::v2::{AvailabilityBitfield, Signed, ValidatorIndex}; use rand_chacha::ChaCha12Rng; use sp_application_crypto::AppKey; use sp_core::Pair as PairT; diff --git a/polkadot/node/network/bridge/Cargo.toml b/polkadot/node/network/bridge/Cargo.toml index b057d079ce4dd95c788901fa13a4252911906616..c3abd296d5112fcaf515d19977826ef34d9594ec 100644 --- a/polkadot/node/network/bridge/Cargo.toml +++ b/polkadot/node/network/bridge/Cargo.toml @@ -13,7 +13,7 @@ polkadot-primitives = { path = "../../../primitives" } parity-scale-codec = { version = "3.1.2", default-features = false, features = ["derive"] } sc-network = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "master" } -polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../../subsystem" } +polkadot-node-subsystem = {path = "../../subsystem" } polkadot-overseer = { path = "../../overseer" } polkadot-node-network-protocol = { path = "../protocol" } polkadot-node-subsystem-util = { path = "../../subsystem-util"} diff --git a/polkadot/node/network/bridge/src/lib.rs b/polkadot/node/network/bridge/src/lib.rs index 054d1135ee260a8e910ff66d8efc199764c4698d..860a9b0c5fa298617e7bccbfd6b8e2e691fb4e42 100644 --- a/polkadot/node/network/bridge/src/lib.rs +++ b/polkadot/node/network/bridge/src/lib.rs @@ -33,10 +33,7 @@ use polkadot_node_network_protocol::{ v1 as protocol_v1, ObservedRole, OurView, PeerId, ProtocolVersion, UnifiedReputationChange as Rep, Versioned, View, }; -use polkadot_node_subsystem_util::metrics::{self, prometheus}; -use polkadot_overseer::gen::{OverseerError, Subsystem}; -use polkadot_primitives::v2::{AuthorityDiscoveryId, BlockNumber, Hash, ValidatorIndex}; -use polkadot_subsystem::{ +use polkadot_node_subsystem::{ errors::{SubsystemError, SubsystemResult}, messages::{ network_bridge_event::{NewGossipTopology, TopologyPeerInfo}, @@ -45,6 +42,9 @@ use polkadot_subsystem::{ overseer, ActivatedLeaf, ActiveLeavesUpdate, FromOverseer, OverseerSignal, SpawnedSubsystem, SubsystemContext, SubsystemSender, }; +use polkadot_node_subsystem_util::metrics::{self, prometheus}; +use polkadot_overseer::gen::{OverseerError, Subsystem}; +use polkadot_primitives::v2::{AuthorityDiscoveryId, BlockNumber, Hash, ValidatorIndex}; /// Peer set info for network initialization. /// diff --git a/polkadot/node/network/bridge/src/tests.rs b/polkadot/node/network/bridge/src/tests.rs index 140280e7af3ca3b6bc2db4370395fa1a7c1eb00f..0697c0cfdea8bfb3b5268c296675bdb472d022c2 100644 --- a/polkadot/node/network/bridge/src/tests.rs +++ b/polkadot/node/network/bridge/src/tests.rs @@ -31,13 +31,7 @@ use sc_network::{Event as NetworkEvent, IfDisconnected}; use polkadot_node_network_protocol::{ request_response::outgoing::Requests, view, ObservedRole, Versioned, }; -use polkadot_node_subsystem_test_helpers::{ - SingleItemSink, SingleItemStream, TestSubsystemContextHandle, -}; -use polkadot_node_subsystem_util::metered; -use polkadot_primitives::v2::AuthorityDiscoveryId; -use polkadot_primitives_test_helpers::dummy_collator_signature; -use polkadot_subsystem::{ +use polkadot_node_subsystem::{ jaeger, messages::{ ApprovalDistributionMessage, BitfieldDistributionMessage, GossipSupportMessage, @@ -45,6 +39,12 @@ use polkadot_subsystem::{ }, ActiveLeavesUpdate, FromOverseer, LeafStatus, OverseerSignal, }; +use polkadot_node_subsystem_test_helpers::{ + SingleItemSink, SingleItemStream, TestSubsystemContextHandle, +}; +use polkadot_node_subsystem_util::metered; +use polkadot_primitives::v2::AuthorityDiscoveryId; +use polkadot_primitives_test_helpers::dummy_collator_signature; use sc_network::Multiaddr; use sp_keyring::Sr25519Keyring; diff --git a/polkadot/node/network/collator-protocol/Cargo.toml b/polkadot/node/network/collator-protocol/Cargo.toml index 258448f1363a7b4bbca98500b57533d1359a9f2a..4b003f4a844938a21b2170d6ac119a1e8d9ecbdb 100644 --- a/polkadot/node/network/collator-protocol/Cargo.toml +++ b/polkadot/node/network/collator-protocol/Cargo.toml @@ -18,7 +18,7 @@ polkadot-primitives = { path = "../../../primitives" } polkadot-node-network-protocol = { path = "../../network/protocol" } polkadot-node-primitives = { path = "../../primitives" } polkadot-node-subsystem-util = { path = "../../subsystem-util" } -polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../../subsystem" } +polkadot-node-subsystem = {path = "../../subsystem" } fatality = "0.0.6" thiserror = "1.0.31" @@ -32,5 +32,5 @@ sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "master sc-network = { git = "https://github.com/paritytech/substrate", branch = "master" } parity-scale-codec = { version = "3.1.2", features = ["std"] } -polkadot-subsystem-testhelpers = { package = "polkadot-node-subsystem-test-helpers", path = "../../subsystem-test-helpers" } +polkadot-node-subsystem-test-helpers = { path = "../../subsystem-test-helpers" } polkadot-primitives-test-helpers = { path = "../../../primitives/test-helpers" } diff --git a/polkadot/node/network/collator-protocol/src/collator_side/mod.rs b/polkadot/node/network/collator-protocol/src/collator_side/mod.rs index 967e1afb0ad10f13cfe87180ce77ebcd608a44a9..6f23600ae8f356573f017b1f6f1ea6d468b26c25 100644 --- a/polkadot/node/network/collator-protocol/src/collator_side/mod.rs +++ b/polkadot/node/network/collator-protocol/src/collator_side/mod.rs @@ -36,6 +36,11 @@ use polkadot_node_network_protocol::{ v1 as protocol_v1, OurView, PeerId, UnifiedReputationChange as Rep, Versioned, View, }; use polkadot_node_primitives::{CollationSecondedSignal, PoV, Statement}; +use polkadot_node_subsystem::{ + jaeger, + messages::{CollatorProtocolMessage, NetworkBridgeEvent, NetworkBridgeMessage}, + overseer, FromOverseer, OverseerSignal, PerLeafSpan, SubsystemContext, +}; use polkadot_node_subsystem_util::{ metrics::{self, prometheus}, runtime::{get_availability_cores, get_group_rotation_info, RuntimeInfo}, @@ -45,11 +50,6 @@ use polkadot_primitives::v2::{ AuthorityDiscoveryId, CandidateHash, CandidateReceipt, CollatorPair, CoreIndex, CoreState, Hash, Id as ParaId, }; -use polkadot_subsystem::{ - jaeger, - messages::{CollatorProtocolMessage, NetworkBridgeEvent, NetworkBridgeMessage}, - overseer, FromOverseer, OverseerSignal, PerLeafSpan, SubsystemContext, -}; use super::LOG_TARGET; use crate::error::{log_error, Error, FatalError, Result}; diff --git a/polkadot/node/network/collator-protocol/src/collator_side/tests.rs b/polkadot/node/network/collator-protocol/src/collator_side/tests.rs index 0ddb79fd53f80eafbf129ead7197b210cd8db71e..f2c4c37a7f2dea7084acd176572540420415389b 100644 --- a/polkadot/node/network/collator-protocol/src/collator_side/tests.rs +++ b/polkadot/node/network/collator-protocol/src/collator_side/tests.rs @@ -31,18 +31,18 @@ use sp_runtime::traits::AppVerify; use polkadot_node_network_protocol::{our_view, request_response::IncomingRequest, view}; use polkadot_node_primitives::BlockData; +use polkadot_node_subsystem::{ + jaeger, + messages::{AllMessages, RuntimeApiMessage, RuntimeApiRequest}, + ActivatedLeaf, ActiveLeavesUpdate, LeafStatus, +}; +use polkadot_node_subsystem_test_helpers as test_helpers; use polkadot_node_subsystem_util::TimeoutExt; use polkadot_primitives::v2::{ AuthorityDiscoveryId, CollatorPair, GroupRotationInfo, ScheduledCore, SessionIndex, SessionInfo, ValidatorId, ValidatorIndex, }; use polkadot_primitives_test_helpers::TestCandidateBuilder; -use polkadot_subsystem::{ - jaeger, - messages::{AllMessages, RuntimeApiMessage, RuntimeApiRequest}, - ActivatedLeaf, ActiveLeavesUpdate, LeafStatus, -}; -use polkadot_subsystem_testhelpers as test_helpers; #[derive(Clone)] struct TestState { diff --git a/polkadot/node/network/collator-protocol/src/error.rs b/polkadot/node/network/collator-protocol/src/error.rs index 4f0b0921a05a36ab2acc4df79a15cb276fbdcbfa..b1c86fa81c5addab3755f18a0bbf755c30f9c534 100644 --- a/polkadot/node/network/collator-protocol/src/error.rs +++ b/polkadot/node/network/collator-protocol/src/error.rs @@ -19,8 +19,8 @@ use polkadot_node_network_protocol::request_response::incoming; use polkadot_node_primitives::UncheckedSignedFullStatement; +use polkadot_node_subsystem::errors::SubsystemError; use polkadot_node_subsystem_util::runtime; -use polkadot_subsystem::errors::SubsystemError; use crate::LOG_TARGET; diff --git a/polkadot/node/network/collator-protocol/src/lib.rs b/polkadot/node/network/collator-protocol/src/lib.rs index 975d60e553fe45e8097299afd839e218e9af0f60..21a5fd9baafd56bcbb3cb4040d4710bb8d65ec2c 100644 --- a/polkadot/node/network/collator-protocol/src/lib.rs +++ b/polkadot/node/network/collator-protocol/src/lib.rs @@ -33,7 +33,7 @@ use polkadot_node_network_protocol::{ }; use polkadot_primitives::v2::CollatorPair; -use polkadot_subsystem::{ +use polkadot_node_subsystem::{ errors::SubsystemError, messages::{CollatorProtocolMessage, NetworkBridgeMessage}, overseer, SpawnedSubsystem, SubsystemContext, SubsystemSender, diff --git a/polkadot/node/network/collator-protocol/src/validator_side/mod.rs b/polkadot/node/network/collator-protocol/src/validator_side/mod.rs index 9462a698a511ad3825540a96d7ffc3341b5fbd15..8b91e8ef25a122b2d908f4dea0f667a46e1409e1 100644 --- a/polkadot/node/network/collator-protocol/src/validator_side/mod.rs +++ b/polkadot/node/network/collator-protocol/src/validator_side/mod.rs @@ -44,9 +44,7 @@ use polkadot_node_network_protocol::{ v1 as protocol_v1, OurView, PeerId, UnifiedReputationChange as Rep, Versioned, View, }; use polkadot_node_primitives::{PoV, SignedFullStatement}; -use polkadot_node_subsystem_util::metrics::{self, prometheus}; -use polkadot_primitives::v2::{CandidateReceipt, CollatorId, Hash, Id as ParaId}; -use polkadot_subsystem::{ +use polkadot_node_subsystem::{ jaeger, messages::{ CandidateBackingMessage, CollatorProtocolMessage, IfDisconnected, NetworkBridgeEvent, @@ -54,6 +52,8 @@ use polkadot_subsystem::{ }, overseer, FromOverseer, OverseerSignal, PerLeafSpan, SubsystemContext, SubsystemSender, }; +use polkadot_node_subsystem_util::metrics::{self, prometheus}; +use polkadot_primitives::v2::{CandidateReceipt, CollatorId, Hash, Id as ParaId}; use crate::error::Result; diff --git a/polkadot/node/network/collator-protocol/src/validator_side/tests.rs b/polkadot/node/network/collator-protocol/src/validator_side/tests.rs index e0406b433fe5a3d64b0bc1836754fd880122fcfb..6227b30551a4766b649d85be4e991cbbab970e24 100644 --- a/polkadot/node/network/collator-protocol/src/validator_side/tests.rs +++ b/polkadot/node/network/collator-protocol/src/validator_side/tests.rs @@ -28,6 +28,8 @@ use polkadot_node_network_protocol::{ ObservedRole, }; use polkadot_node_primitives::BlockData; +use polkadot_node_subsystem::messages::{AllMessages, RuntimeApiMessage, RuntimeApiRequest}; +use polkadot_node_subsystem_test_helpers as test_helpers; use polkadot_node_subsystem_util::TimeoutExt; use polkadot_primitives::v2::{ CollatorPair, CoreState, GroupIndex, GroupRotationInfo, OccupiedCore, ScheduledCore, @@ -36,8 +38,6 @@ use polkadot_primitives::v2::{ use polkadot_primitives_test_helpers::{ dummy_candidate_descriptor, dummy_candidate_receipt_bad_sig, dummy_hash, }; -use polkadot_subsystem::messages::{AllMessages, RuntimeApiMessage, RuntimeApiRequest}; -use polkadot_subsystem_testhelpers as test_helpers; const ACTIVITY_TIMEOUT: Duration = Duration::from_millis(500); const DECLARE_TIMEOUT: Duration = Duration::from_millis(25); diff --git a/polkadot/node/network/dispute-distribution/Cargo.toml b/polkadot/node/network/dispute-distribution/Cargo.toml index e77c7fa9f704fbec3e36a96c058acb7669d24af5..2c69a26e9446205fa6fc1a9c5ab64272056ba3f8 100644 --- a/polkadot/node/network/dispute-distribution/Cargo.toml +++ b/polkadot/node/network/dispute-distribution/Cargo.toml @@ -11,7 +11,7 @@ derive_more = "0.99.17" parity-scale-codec = { version = "3.1.2", features = ["std"] } polkadot-primitives = { path = "../../../primitives" } polkadot-erasure-coding = { path = "../../../erasure-coding" } -polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../../subsystem" } +polkadot-node-subsystem = {path = "../../subsystem" } polkadot-node-network-protocol = { path = "../../network/protocol" } polkadot-node-subsystem-util = { path = "../../subsystem-util" } polkadot-node-primitives = { path = "../../primitives" } @@ -24,7 +24,7 @@ lru = "0.7.5" [dev-dependencies] async-trait = "0.1.53" -polkadot-subsystem-testhelpers = { package = "polkadot-node-subsystem-test-helpers", path = "../../subsystem-test-helpers" } +polkadot-node-subsystem-test-helpers = { path = "../../subsystem-test-helpers" } sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-tracing = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/polkadot/node/network/dispute-distribution/src/error.rs b/polkadot/node/network/dispute-distribution/src/error.rs index 053802c897adb653803086e861aeddd9e971665b..cc5be11602f438225054f0f98581fcee264f73b3 100644 --- a/polkadot/node/network/dispute-distribution/src/error.rs +++ b/polkadot/node/network/dispute-distribution/src/error.rs @@ -17,8 +17,8 @@ //! Error handling related code and Error/Result definitions. +use polkadot_node_subsystem::SubsystemError; use polkadot_node_subsystem_util::runtime; -use polkadot_subsystem::SubsystemError; use crate::{sender, LOG_TARGET}; diff --git a/polkadot/node/network/dispute-distribution/src/lib.rs b/polkadot/node/network/dispute-distribution/src/lib.rs index d20b3458694e15a349dded6ac605da78505a8f66..8f45cbb11b45eb6e16a33e20c607e8c106860ecb 100644 --- a/polkadot/node/network/dispute-distribution/src/lib.rs +++ b/polkadot/node/network/dispute-distribution/src/lib.rs @@ -31,11 +31,11 @@ use sp_keystore::SyncCryptoStorePtr; use polkadot_node_network_protocol::request_response::{incoming::IncomingRequestReceiver, v1}; use polkadot_node_primitives::DISPUTE_WINDOW; -use polkadot_node_subsystem_util::{runtime, runtime::RuntimeInfo}; -use polkadot_subsystem::{ +use polkadot_node_subsystem::{ messages::DisputeDistributionMessage, overseer, FromOverseer, OverseerSignal, SpawnedSubsystem, SubsystemContext, SubsystemError, }; +use polkadot_node_subsystem_util::{runtime, runtime::RuntimeInfo}; /// ## The sender [`DisputeSender`] /// diff --git a/polkadot/node/network/dispute-distribution/src/receiver/mod.rs b/polkadot/node/network/dispute-distribution/src/receiver/mod.rs index a75d95b6e4aa5b9b19feec21b1f94899a5fdec6e..c7a0a324e844f26bf2da01ef327af11449ad40a8 100644 --- a/polkadot/node/network/dispute-distribution/src/receiver/mod.rs +++ b/polkadot/node/network/dispute-distribution/src/receiver/mod.rs @@ -39,11 +39,11 @@ use polkadot_node_network_protocol::{ PeerId, UnifiedReputationChange as Rep, }; use polkadot_node_primitives::DISPUTE_WINDOW; -use polkadot_node_subsystem_util::{runtime, runtime::RuntimeInfo}; -use polkadot_subsystem::{ +use polkadot_node_subsystem::{ messages::{AllMessages, DisputeCoordinatorMessage, ImportStatementsResult}, SubsystemSender, }; +use polkadot_node_subsystem_util::{runtime, runtime::RuntimeInfo}; use crate::{ metrics::{FAILED, SUCCEEDED}, diff --git a/polkadot/node/network/dispute-distribution/src/sender/error.rs b/polkadot/node/network/dispute-distribution/src/sender/error.rs index 32f2e2f1e0d54a4b3cd1f8b322fc006b638c5675..c2f204344e152705dc182763d299f4c8fda30a6e 100644 --- a/polkadot/node/network/dispute-distribution/src/sender/error.rs +++ b/polkadot/node/network/dispute-distribution/src/sender/error.rs @@ -18,8 +18,8 @@ //! Error handling related code and Error/Result definitions. use polkadot_node_primitives::disputes::DisputeMessageCheckError; +use polkadot_node_subsystem::SubsystemError; use polkadot_node_subsystem_util::runtime; -use polkadot_subsystem::SubsystemError; #[allow(missing_docs)] #[fatality::fatality(splitable)] diff --git a/polkadot/node/network/dispute-distribution/src/sender/mod.rs b/polkadot/node/network/dispute-distribution/src/sender/mod.rs index d08a8fc5fa2f0ef64fa550a9ecf325cb0e4216cc..b1a21b96ed2e55eb52aa5d90c2a1e48bfe6d31a3 100644 --- a/polkadot/node/network/dispute-distribution/src/sender/mod.rs +++ b/polkadot/node/network/dispute-distribution/src/sender/mod.rs @@ -20,12 +20,12 @@ use futures::channel::{mpsc, oneshot}; use polkadot_node_network_protocol::request_response::v1::DisputeRequest; use polkadot_node_primitives::{CandidateVotes, DisputeMessage, SignedDisputeStatement}; -use polkadot_node_subsystem_util::runtime::RuntimeInfo; -use polkadot_primitives::v2::{CandidateHash, DisputeStatement, Hash, SessionIndex}; -use polkadot_subsystem::{ +use polkadot_node_subsystem::{ messages::{AllMessages, DisputeCoordinatorMessage}, ActiveLeavesUpdate, SubsystemContext, }; +use polkadot_node_subsystem_util::runtime::RuntimeInfo; +use polkadot_primitives::v2::{CandidateHash, DisputeStatement, Hash, SessionIndex}; /// For each ongoing dispute we have a `SendTask` which takes care of it. /// diff --git a/polkadot/node/network/dispute-distribution/src/sender/send_task.rs b/polkadot/node/network/dispute-distribution/src/sender/send_task.rs index 9cc202a69e9f4aee7a4aca50b104eb4e649e93e3..9cf639e2e76bd4d604c254cd82c5810878b94fda 100644 --- a/polkadot/node/network/dispute-distribution/src/sender/send_task.rs +++ b/polkadot/node/network/dispute-distribution/src/sender/send_task.rs @@ -26,14 +26,14 @@ use polkadot_node_network_protocol::{ }, IfDisconnected, }; +use polkadot_node_subsystem::{ + messages::{AllMessages, NetworkBridgeMessage}, + SubsystemContext, +}; use polkadot_node_subsystem_util::{metrics, runtime::RuntimeInfo}; use polkadot_primitives::v2::{ AuthorityDiscoveryId, CandidateHash, Hash, SessionIndex, ValidatorIndex, }; -use polkadot_subsystem::{ - messages::{AllMessages, NetworkBridgeMessage}, - SubsystemContext, -}; use super::error::{FatalError, Result}; diff --git a/polkadot/node/network/dispute-distribution/src/tests/mod.rs b/polkadot/node/network/dispute-distribution/src/tests/mod.rs index c9d15528a6efbafc35a286172135795551434fb1..3a294e1a34ef2e347bb64eb490e55786ff489b20 100644 --- a/polkadot/node/network/dispute-distribution/src/tests/mod.rs +++ b/polkadot/node/network/dispute-distribution/src/tests/mod.rs @@ -41,19 +41,19 @@ use polkadot_node_network_protocol::{ IfDisconnected, }; use polkadot_node_primitives::{CandidateVotes, UncheckedDisputeMessage}; -use polkadot_primitives::v2::{ - AuthorityDiscoveryId, CandidateHash, Hash, SessionIndex, SessionInfo, -}; -use polkadot_subsystem::{ +use polkadot_node_subsystem::{ messages::{ AllMessages, DisputeCoordinatorMessage, DisputeDistributionMessage, ImportStatementsResult, NetworkBridgeMessage, RuntimeApiMessage, RuntimeApiRequest, }, ActivatedLeaf, ActiveLeavesUpdate, FromOverseer, LeafStatus, OverseerSignal, Span, }; -use polkadot_subsystem_testhelpers::{ +use polkadot_node_subsystem_test_helpers::{ mock::make_ferdie_keystore, subsystem_test_harness, TestSubsystemContextHandle, }; +use polkadot_primitives::v2::{ + AuthorityDiscoveryId, CandidateHash, Hash, SessionIndex, SessionInfo, +}; use self::mock::{ make_candidate_receipt, make_dispute_message, ALICE_INDEX, FERDIE_DISCOVERY_KEY, FERDIE_INDEX, diff --git a/polkadot/node/network/statement-distribution/Cargo.toml b/polkadot/node/network/statement-distribution/Cargo.toml index 33643c3aa8768a87b54aefa1e9e704e5a413ef88..61e87ec5cf63bc68d15fe079e6057d37ff903b7f 100644 --- a/polkadot/node/network/statement-distribution/Cargo.toml +++ b/polkadot/node/network/statement-distribution/Cargo.toml @@ -11,7 +11,7 @@ gum = { package = "tracing-gum", path = "../../gum" } polkadot-primitives = { path = "../../../primitives" } sp-staking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" } -polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../../subsystem" } +polkadot-node-subsystem = {path = "../../subsystem" } polkadot-node-primitives = { path = "../../primitives" } polkadot-node-subsystem-util = { path = "../../subsystem-util" } polkadot-node-network-protocol = { path = "../../network/protocol" } diff --git a/polkadot/node/network/statement-distribution/src/error.rs b/polkadot/node/network/statement-distribution/src/error.rs index be4e8ffebeb15fac2e8e430d81952ff41d1af2eb..01b2efd53b869c385b676e316b464cce20643b8e 100644 --- a/polkadot/node/network/statement-distribution/src/error.rs +++ b/polkadot/node/network/statement-distribution/src/error.rs @@ -18,9 +18,9 @@ //! Error handling related code and Error/Result definitions. use polkadot_node_network_protocol::PeerId; +use polkadot_node_subsystem::SubsystemError; use polkadot_node_subsystem_util::runtime; use polkadot_primitives::v2::{CandidateHash, Hash}; -use polkadot_subsystem::SubsystemError; use crate::LOG_TARGET; diff --git a/polkadot/node/network/statement-distribution/src/lib.rs b/polkadot/node/network/statement-distribution/src/lib.rs index 036fac399761a0002feb3ef0db7bd2e650294a33..4eae61f567b86816094c2e1fae297adee766503e 100644 --- a/polkadot/node/network/statement-distribution/src/lib.rs +++ b/polkadot/node/network/statement-distribution/src/lib.rs @@ -35,12 +35,7 @@ use polkadot_node_network_protocol::{ use polkadot_node_primitives::{SignedFullStatement, Statement, UncheckedSignedFullStatement}; use polkadot_node_subsystem_util::{self as util, rand, MIN_GOSSIP_PEERS}; -use polkadot_primitives::v2::{ - AuthorityDiscoveryId, CandidateHash, CommittedCandidateReceipt, CompactStatement, Hash, - SignedStatement, SigningContext, UncheckedSignedStatement, ValidatorId, ValidatorIndex, - ValidatorSignature, -}; -use polkadot_subsystem::{ +use polkadot_node_subsystem::{ jaeger, messages::{ AllMessages, CandidateBackingMessage, NetworkBridgeEvent, NetworkBridgeMessage, @@ -49,6 +44,11 @@ use polkadot_subsystem::{ overseer, ActiveLeavesUpdate, FromOverseer, OverseerSignal, PerLeafSpan, SpawnedSubsystem, SubsystemContext, SubsystemError, }; +use polkadot_primitives::v2::{ + AuthorityDiscoveryId, CandidateHash, CommittedCandidateReceipt, CompactStatement, Hash, + SignedStatement, SigningContext, UncheckedSignedStatement, ValidatorId, ValidatorIndex, + ValidatorSignature, +}; use futures::{ channel::{mpsc, oneshot}, diff --git a/polkadot/node/network/statement-distribution/src/requester.rs b/polkadot/node/network/statement-distribution/src/requester.rs index 9feaeeb5136db9b6213bc9425de2dcaff20bd368..24ffa5e417427ae1fee54af93605f3f92f0e6c9f 100644 --- a/polkadot/node/network/statement-distribution/src/requester.rs +++ b/polkadot/node/network/statement-distribution/src/requester.rs @@ -28,9 +28,9 @@ use polkadot_node_network_protocol::{ }, PeerId, UnifiedReputationChange, }; +use polkadot_node_subsystem::{Span, Stage}; use polkadot_node_subsystem_util::TimeoutExt; use polkadot_primitives::v2::{CandidateHash, CommittedCandidateReceipt, Hash}; -use polkadot_subsystem::{Span, Stage}; use crate::{metrics::Metrics, COST_WRONG_HASH, LOG_TARGET}; diff --git a/polkadot/node/network/statement-distribution/src/tests.rs b/polkadot/node/network/statement-distribution/src/tests.rs index 28fade444096072e30e36f68a4869fe81c97447e..49a8e5cd1426d2e9f8c3e6d4e8941851df8267d3 100644 --- a/polkadot/node/network/statement-distribution/src/tests.rs +++ b/polkadot/node/network/statement-distribution/src/tests.rs @@ -27,16 +27,16 @@ use polkadot_node_network_protocol::{ view, ObservedRole, }; use polkadot_node_primitives::{Statement, UncheckedSignedFullStatement}; +use polkadot_node_subsystem::{ + jaeger, + messages::{network_bridge_event, RuntimeApiMessage, RuntimeApiRequest}, + ActivatedLeaf, LeafStatus, +}; use polkadot_node_subsystem_test_helpers::mock::make_ferdie_keystore; use polkadot_primitives::v2::{Hash, SessionInfo, ValidationCode}; use polkadot_primitives_test_helpers::{ dummy_committed_candidate_receipt, dummy_hash, AlwaysZeroRng, }; -use polkadot_subsystem::{ - jaeger, - messages::{network_bridge_event, RuntimeApiMessage, RuntimeApiRequest}, - ActivatedLeaf, LeafStatus, -}; use sc_keystore::LocalKeystore; use sp_application_crypto::{sr25519::Pair, AppKey, Pair as TraitPair}; use sp_authority_discovery::AuthorityPair; diff --git a/polkadot/node/service/Cargo.toml b/polkadot/node/service/Cargo.toml index 1acec72b81b38527101ea0cbbf8ddb6b52030d04..af50c481c6ff849038ad402a10670858ede0e7cf 100644 --- a/polkadot/node/service/Cargo.toml +++ b/polkadot/node/service/Cargo.toml @@ -81,7 +81,7 @@ polkadot-parachain = { path = "../../parachain" } polkadot-primitives = { path = "../../primitives" } polkadot-node-primitives = { path = "../primitives" } polkadot-rpc = { path = "../../rpc" } -polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../subsystem" } +polkadot-node-subsystem = {path = "../subsystem" } polkadot-node-subsystem-util = { path = "../subsystem-util" } polkadot-runtime-parachains = { path = "../../runtime/parachains" } polkadot-node-network-protocol = { path = "../network/protocol" } diff --git a/polkadot/node/service/src/lib.rs b/polkadot/node/service/src/lib.rs index e9d0fbad431c8bec698c64777744429b3ce3e697..687ea02695153f0627066eb3a40036377332efd8 100644 --- a/polkadot/node/service/src/lib.rs +++ b/polkadot/node/service/src/lib.rs @@ -67,7 +67,7 @@ pub use { }; #[cfg(feature = "full-node")] -use polkadot_subsystem::jaeger; +use polkadot_node_subsystem::jaeger; use std::{sync::Arc, time::Duration}; @@ -223,7 +223,7 @@ pub enum Error { Telemetry(#[from] telemetry::Error), #[error(transparent)] - Jaeger(#[from] polkadot_subsystem::jaeger::JaegerError), + Jaeger(#[from] polkadot_node_subsystem::jaeger::JaegerError), #[cfg(feature = "full-node")] #[error(transparent)] diff --git a/polkadot/node/service/src/relay_chain_selection.rs b/polkadot/node/service/src/relay_chain_selection.rs index 1300091709d94313a4addc7b99e1f17c1ed7cff4..df3e68cc7b1abd3d301f48b5992a7478114f18e4 100644 --- a/polkadot/node/service/src/relay_chain_selection.rs +++ b/polkadot/node/service/src/relay_chain_selection.rs @@ -39,15 +39,15 @@ use super::{HeaderProvider, HeaderProviderProvider}; use consensus_common::{Error as ConsensusError, SelectChain}; use futures::channel::oneshot; use polkadot_node_primitives::MAX_FINALITY_LAG as PRIMITIVES_MAX_FINALITY_LAG; +use polkadot_node_subsystem::messages::{ + ApprovalVotingMessage, ChainSelectionMessage, DisputeCoordinatorMessage, + HighestApprovedAncestorBlock, +}; use polkadot_node_subsystem_util::metrics::{self, prometheus}; use polkadot_overseer::{AllMessages, Handle}; use polkadot_primitives::v2::{ Block as PolkadotBlock, BlockNumber, Hash, Header as PolkadotHeader, }; -use polkadot_subsystem::messages::{ - ApprovalVotingMessage, ChainSelectionMessage, DisputeCoordinatorMessage, - HighestApprovedAncestorBlock, -}; use std::sync::Arc; /// The maximum amount of unfinalized blocks we are willing to allow due to approval checking diff --git a/polkadot/node/service/src/tests.rs b/polkadot/node/service/src/tests.rs index e657701543ae5cd7b46c2db453ff4e9aefb681cd..0997097ed996c5fa6bf035a59715fdfc2df4c41b 100644 --- a/polkadot/node/service/src/tests.rs +++ b/polkadot/node/service/src/tests.rs @@ -18,9 +18,9 @@ use super::{relay_chain_selection::*, *}; use futures::channel::oneshot::Receiver; use polkadot_node_primitives::approval::{VRFOutput, VRFProof}; +use polkadot_node_subsystem::messages::{AllMessages, BlockDescription}; use polkadot_node_subsystem_test_helpers as test_helpers; use polkadot_node_subsystem_util::TimeoutExt; -use polkadot_subsystem::messages::{AllMessages, BlockDescription}; use polkadot_test_client::Sr25519Keyring; use sp_consensus_babe::{ digests::{CompatibleDigestItem, PreDigest, SecondaryVRFPreDigest}, @@ -36,11 +36,11 @@ use assert_matches::assert_matches; use std::{sync::Arc, time::Duration}; use futures::{channel::oneshot, prelude::*}; -use polkadot_primitives::v2::{Block, BlockNumber, Hash, Header}; -use polkadot_subsystem::messages::{ +use polkadot_node_subsystem::messages::{ ApprovalVotingMessage, ChainSelectionMessage, DisputeCoordinatorMessage, HighestApprovedAncestorBlock, }; +use polkadot_primitives::v2::{Block, BlockNumber, Hash, Header}; use polkadot_node_subsystem_test_helpers::TestSubsystemSender; use polkadot_overseer::{SubsystemContext, SubsystemSender}; diff --git a/polkadot/node/subsystem-util/Cargo.toml b/polkadot/node/subsystem-util/Cargo.toml index 0245d1ead4f778bbac7d3ca4f74b8c0d94a64e70..97b0a3687e771a26ad1e72dbaea17e629ceaeb84 100644 --- a/polkadot/node/subsystem-util/Cargo.toml +++ b/polkadot/node/subsystem-util/Cargo.toml @@ -19,7 +19,7 @@ gum = { package = "tracing-gum", path = "../gum" } derive_more = "0.99.17" lru = "0.7.5" -polkadot-node-subsystem = { package = "polkadot-node-subsystem", path = "../subsystem" } +polkadot-node-subsystem = {path = "../subsystem" } polkadot-node-jaeger = { path = "../jaeger" } polkadot-node-metrics = { path = "../metrics" } polkadot-node-network-protocol = { path = "../network/protocol" }