feat: Rebrand Polkadot/Substrate references to PezkuwiChain
This commit systematically rebrands various references from Parity Technologies' Polkadot/Substrate ecosystem to PezkuwiChain within the kurdistan-sdk. Key changes include: - Updated external repository URLs (zombienet-sdk, parity-db, parity-scale-codec, wasm-instrument) to point to pezkuwichain forks. - Modified internal documentation and code comments to reflect PezkuwiChain naming and structure. - Replaced direct references to with or specific paths within the for XCM, Pezkuwi, and other modules. - Cleaned up deprecated issue and PR references in various and files, particularly in and modules. - Adjusted image and logo URLs in documentation to point to PezkuwiChain assets. - Removed or rephrased comments related to external Polkadot/Substrate PRs and issues. This is a significant step towards fully customizing the SDK for the PezkuwiChain ecosystem.
This commit is contained in:
@@ -26,10 +26,10 @@ futures-timer = { workspace = true }
|
||||
gum = { workspace = true, default-features = true }
|
||||
|
||||
[dev-dependencies]
|
||||
sc-keystore = { workspace = true }
|
||||
sp-application-crypto = { workspace = true, default-features = true }
|
||||
sp-authority-discovery = { workspace = true, default-features = true }
|
||||
sp-core = { features = ["std"], workspace = true, default-features = true }
|
||||
pezsc-keystore = { workspace = true }
|
||||
pezsp-application-crypto = { workspace = true, default-features = true }
|
||||
pezsp-authority-discovery = { workspace = true, default-features = true }
|
||||
pezsp-core = { features = ["std"], workspace = true, default-features = true }
|
||||
|
||||
pezkuwi-node-subsystem-test-helpers = { workspace = true }
|
||||
pezkuwi-primitives-test-helpers = { workspace = true }
|
||||
@@ -39,7 +39,7 @@ rand_chacha = { workspace = true, default-features = true }
|
||||
schnorrkel = { workspace = true }
|
||||
# rand_core should match schnorrkel
|
||||
rand_core = { workspace = true }
|
||||
sp-tracing = { workspace = true }
|
||||
pezsp-tracing = { workspace = true }
|
||||
|
||||
[features]
|
||||
runtime-benchmarks = [
|
||||
@@ -52,5 +52,5 @@ runtime-benchmarks = [
|
||||
"pezkuwi-node-subsystem/runtime-benchmarks",
|
||||
"pezkuwi-primitives-test-helpers/runtime-benchmarks",
|
||||
"pezkuwi-primitives/runtime-benchmarks",
|
||||
"sp-authority-discovery/runtime-benchmarks",
|
||||
"pezsp-authority-discovery/runtime-benchmarks",
|
||||
]
|
||||
|
||||
@@ -41,10 +41,10 @@ use pezkuwi_primitives::{
|
||||
};
|
||||
use pezkuwi_primitives_test_helpers::dummy_signature;
|
||||
use rand::SeedableRng;
|
||||
use sc_keystore::{Keystore, LocalKeystore};
|
||||
use sp_application_crypto::AppCrypto;
|
||||
use sp_authority_discovery::AuthorityPair as AuthorityDiscoveryPair;
|
||||
use sp_core::crypto::Pair as PairT;
|
||||
use pezsc_keystore::{Keystore, LocalKeystore};
|
||||
use pezsp_application_crypto::AppCrypto;
|
||||
use pezsp_authority_discovery::AuthorityPair as AuthorityDiscoveryPair;
|
||||
use pezsp_core::crypto::Pair as PairT;
|
||||
use std::time::Duration;
|
||||
type VirtualOverseer =
|
||||
pezkuwi_node_subsystem_test_helpers::TestSubsystemContextHandle<ApprovalDistributionMessage>;
|
||||
@@ -55,9 +55,9 @@ fn test_harness<T: Future<Output = VirtualOverseer>>(
|
||||
mut state: State,
|
||||
test_fn: impl FnOnce(VirtualOverseer) -> T,
|
||||
) -> State {
|
||||
sp_tracing::init_for_tests();
|
||||
pezsp_tracing::init_for_tests();
|
||||
|
||||
let pool = sp_core::testing::TaskExecutor::new();
|
||||
let pool = pezsp_core::testing::TaskExecutor::new();
|
||||
let (context, virtual_overseer) =
|
||||
pezkuwi_node_subsystem_test_helpers::make_subsystem_context(pool.clone());
|
||||
|
||||
@@ -675,7 +675,7 @@ fn delay_reputation_change() {
|
||||
);
|
||||
}
|
||||
|
||||
/// <https://github.com/paritytech/polkadot/pull/2160#discussion_r547594835>
|
||||
/// <https://github.com/pezkuwichain/kurdistan-sdk/issues/172#discussion_r547594835>
|
||||
///
|
||||
/// 1. Send a view update that removes block B from their view.
|
||||
/// 2. Send a message from B that they incur `COST_UNEXPECTED_MESSAGE` for, but then they receive
|
||||
@@ -779,7 +779,7 @@ fn spam_attack_results_in_negative_reputation_change() {
|
||||
/// Upon receiving them, they both will try to send the message each other.
|
||||
/// This test makes sure they will not punish each other for such duplicate messages.
|
||||
///
|
||||
/// See <https://github.com/paritytech/polkadot/issues/2499>.
|
||||
/// See <https://github.com/pezkuwichain/kurdistan-sdk/issues/135>.
|
||||
#[test]
|
||||
fn peer_sending_us_the_same_we_just_sent_them_is_ok() {
|
||||
let parent_hash = Hash::repeat_byte(0xFF);
|
||||
@@ -2358,7 +2358,7 @@ fn sends_assignments_even_when_state_is_approved_v2() {
|
||||
);
|
||||
}
|
||||
|
||||
/// <https://github.com/paritytech/polkadot/pull/5089>
|
||||
/// <https://github.com/pezkuwichain/kurdistan-sdk/issues/176>
|
||||
///
|
||||
/// 1. Receive remote peer view update with an unknown head
|
||||
/// 2. Receive assignments for that unknown head
|
||||
@@ -3850,7 +3850,7 @@ fn import_versioned_approval() {
|
||||
|
||||
fn batch_test_round(message_count: usize) {
|
||||
use pezkuwi_node_subsystem::SubsystemContext;
|
||||
let pool = sp_core::testing::TaskExecutor::new();
|
||||
let pool = pezsp_core::testing::TaskExecutor::new();
|
||||
let mut state = State::default();
|
||||
|
||||
let (mut context, mut virtual_overseer) =
|
||||
@@ -4250,7 +4250,7 @@ fn subsystem_rejects_wrong_claimed_assignments() {
|
||||
/// assignment and Delay tranche assignments land on the same candidate. The delay tranche0 can be
|
||||
/// safely ignored and we don't need to gossip it however, the compact tranche0 assignment should be
|
||||
/// gossiped, because other candidates are included in it, this test makes sure this invariant is
|
||||
/// upheld, see https://github.com/paritytech/polkadot/pull/2160#discussion_r557628699, for
|
||||
/// upheld, see https://github.com/pezkuwichain/kurdistan-sdk/issues/172#discussion_r557628699, for
|
||||
/// this edge case.
|
||||
#[test]
|
||||
fn subsystem_accepts_tranche0_duplicate_assignments() {
|
||||
|
||||
@@ -29,10 +29,10 @@ pezkuwi-node-subsystem = { workspace = true, default-features = true }
|
||||
pezkuwi-node-subsystem-util = { workspace = true, default-features = true }
|
||||
pezkuwi-primitives = { workspace = true, default-features = true }
|
||||
rand = { workspace = true, default-features = true }
|
||||
sc-network = { workspace = true, default-features = true }
|
||||
pezsc-network = { workspace = true, default-features = true }
|
||||
schnellru = { workspace = true }
|
||||
sp-core = { features = ["std"], workspace = true, default-features = true }
|
||||
sp-keystore = { workspace = true, default-features = true }
|
||||
pezsp-core = { features = ["std"], workspace = true, default-features = true }
|
||||
pezsp-keystore = { workspace = true, default-features = true }
|
||||
thiserror = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
@@ -42,8 +42,8 @@ pezkuwi-node-subsystem-test-helpers = { workspace = true }
|
||||
pezkuwi-primitives-test-helpers = { workspace = true }
|
||||
pezkuwi-subsystem-bench = { workspace = true }
|
||||
rstest = { workspace = true }
|
||||
sp-keyring = { workspace = true, default-features = true }
|
||||
sp-tracing = { workspace = true, default-features = true }
|
||||
pezsp-keyring = { workspace = true, default-features = true }
|
||||
pezsp-tracing = { workspace = true, default-features = true }
|
||||
|
||||
[features]
|
||||
subsystem-benchmarks = []
|
||||
@@ -58,6 +58,6 @@ runtime-benchmarks = [
|
||||
"pezkuwi-primitives-test-helpers/runtime-benchmarks",
|
||||
"pezkuwi-primitives/runtime-benchmarks",
|
||||
"pezkuwi-subsystem-bench/runtime-benchmarks",
|
||||
"sc-network/runtime-benchmarks",
|
||||
"sp-keyring/runtime-benchmarks",
|
||||
"pezsc-network/runtime-benchmarks",
|
||||
"pezsp-keyring/runtime-benchmarks",
|
||||
]
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
use futures::{future::Either, FutureExt, StreamExt, TryFutureExt};
|
||||
|
||||
use sp_keystore::KeystorePtr;
|
||||
use pezsp_keystore::KeystorePtr;
|
||||
|
||||
use pezkuwi_node_network_protocol::request_response::{
|
||||
v1, v2, IncomingRequestReceiver, ReqProtocolNames,
|
||||
|
||||
@@ -125,8 +125,8 @@ mod tests {
|
||||
use futures::{executor, future};
|
||||
|
||||
use codec::Encode;
|
||||
use sc_network::ProtocolName;
|
||||
use sp_core::testing::TaskExecutor;
|
||||
use pezsc_network::ProtocolName;
|
||||
use pezsp_core::testing::TaskExecutor;
|
||||
|
||||
use pezkuwi_node_primitives::BlockData;
|
||||
use pezkuwi_node_subsystem::messages::{
|
||||
@@ -141,14 +141,14 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn rejects_invalid_pov() {
|
||||
sp_tracing::try_init_simple();
|
||||
pezsp_tracing::try_init_simple();
|
||||
let pov = PoV { block_data: BlockData(vec![1, 2, 3, 4, 5, 6]) };
|
||||
test_run(Hash::default(), pov);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn accepts_valid_pov() {
|
||||
sp_tracing::try_init_simple();
|
||||
pezsp_tracing::try_init_simple();
|
||||
let pov = PoV { block_data: BlockData(vec![1, 2, 3, 4, 5, 6]) };
|
||||
test_run(pov.hash(), pov);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ use pezkuwi_primitives::{
|
||||
AuthorityDiscoveryId, BlakeTwo256, CandidateHash, ChunkIndex, GroupIndex, Hash, HashT,
|
||||
OccupiedCore, SessionIndex,
|
||||
};
|
||||
use sc_network::ProtocolName;
|
||||
use pezsc_network::ProtocolName;
|
||||
|
||||
use crate::{
|
||||
error::{FatalError, Result},
|
||||
|
||||
@@ -26,8 +26,8 @@ use futures::{
|
||||
};
|
||||
use rstest::rstest;
|
||||
|
||||
use sc_network::{self as network, ProtocolName};
|
||||
use sp_keyring::Sr25519Keyring;
|
||||
use pezsc_network::{self as network, ProtocolName};
|
||||
use pezsp_keyring::Sr25519Keyring;
|
||||
|
||||
use pezkuwi_node_network_protocol::request_response::{
|
||||
v1::{self, ChunkResponse},
|
||||
@@ -245,7 +245,7 @@ struct TestRun {
|
||||
|
||||
impl TestRun {
|
||||
fn run(self, task: RunningTask, rx: mpsc::Receiver<FromFetchTask>) {
|
||||
sp_tracing::init_for_tests();
|
||||
pezsp_tracing::init_for_tests();
|
||||
let mut rx = rx.fuse();
|
||||
let task = task.run_inner().fuse();
|
||||
futures::pin_mut!(task);
|
||||
|
||||
@@ -24,7 +24,7 @@ use pezkuwi_primitives::{
|
||||
BlockNumber, ChunkIndex, CoreState, ExecutorParams, GroupIndex, Hash, Id as ParaId,
|
||||
ScheduledCore, SessionIndex, SessionInfo,
|
||||
};
|
||||
use sp_core::{testing::TaskExecutor, traits::SpawnNamed};
|
||||
use pezsp_core::{testing::TaskExecutor, traits::SpawnNamed};
|
||||
|
||||
use pezkuwi_node_subsystem::{
|
||||
messages::{
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
use sp_keyring::Sr25519Keyring;
|
||||
use pezsp_keyring::Sr25519Keyring;
|
||||
|
||||
use pezkuwi_erasure_coding::{branches, obtain_chunks_v1 as obtain_chunks};
|
||||
use pezkuwi_node_primitives::{AvailableData, BlockData, ErasureChunk, PoV, Proof};
|
||||
|
||||
@@ -23,7 +23,7 @@ use pezkuwi_node_network_protocol::request_response::{
|
||||
IncomingRequest, Protocol, ReqProtocolNames,
|
||||
};
|
||||
use pezkuwi_primitives::{node_features, Block, CoreState, Hash, NodeFeatures};
|
||||
use sp_keystore::KeystorePtr;
|
||||
use pezsp_keystore::KeystorePtr;
|
||||
|
||||
use super::*;
|
||||
|
||||
@@ -39,23 +39,23 @@ fn test_harness<T: Future<Output = ()>>(
|
||||
req_protocol_names: ReqProtocolNames,
|
||||
test_fx: impl FnOnce(TestHarness) -> T,
|
||||
) -> std::result::Result<(), FatalError> {
|
||||
sp_tracing::init_for_tests();
|
||||
pezsp_tracing::init_for_tests();
|
||||
|
||||
let pool = sp_core::testing::TaskExecutor::new();
|
||||
let pool = pezsp_core::testing::TaskExecutor::new();
|
||||
let (context, virtual_overseer) =
|
||||
pezkuwi_node_subsystem_test_helpers::make_subsystem_context(pool.clone());
|
||||
|
||||
let (pov_req_receiver, _pov_req_cfg) = IncomingRequest::get_config_receiver::<
|
||||
Block,
|
||||
sc_network::NetworkWorker<Block, Hash>,
|
||||
pezsc_network::NetworkWorker<Block, Hash>,
|
||||
>(&req_protocol_names);
|
||||
let (chunk_req_v1_receiver, chunk_req_v1_cfg) = IncomingRequest::get_config_receiver::<
|
||||
Block,
|
||||
sc_network::NetworkWorker<Block, Hash>,
|
||||
pezsc_network::NetworkWorker<Block, Hash>,
|
||||
>(&req_protocol_names);
|
||||
let (chunk_req_v2_receiver, chunk_req_v2_cfg) = IncomingRequest::get_config_receiver::<
|
||||
Block,
|
||||
sc_network::NetworkWorker<Block, Hash>,
|
||||
pezsc_network::NetworkWorker<Block, Hash>,
|
||||
>(&req_protocol_names);
|
||||
let subsystem = AvailabilityDistributionSubsystem::new(
|
||||
keystore,
|
||||
|
||||
@@ -29,10 +29,10 @@ use futures::{
|
||||
};
|
||||
use futures_timer::Delay;
|
||||
|
||||
use sc_network as network;
|
||||
use sc_network::{config as netconfig, config::RequestResponseConfig, IfDisconnected};
|
||||
use sp_core::{testing::TaskExecutor, traits::SpawnNamed};
|
||||
use sp_keystore::KeystorePtr;
|
||||
use pezsc_network as network;
|
||||
use pezsc_network::{config as netconfig, config::RequestResponseConfig, IfDisconnected};
|
||||
use pezsp_core::{testing::TaskExecutor, traits::SpawnNamed};
|
||||
use pezsp_keystore::KeystorePtr;
|
||||
|
||||
use pezkuwi_node_network_protocol::request_response::{
|
||||
v1, v2, IncomingRequest, OutgoingRequest, Protocol, ReqProtocolNames, Requests,
|
||||
|
||||
@@ -34,16 +34,16 @@ pezkuwi-node-primitives = { workspace = true, default-features = true }
|
||||
pezkuwi-node-subsystem = { workspace = true, default-features = true }
|
||||
pezkuwi-node-subsystem-util = { workspace = true, default-features = true }
|
||||
pezkuwi-primitives = { workspace = true, default-features = true }
|
||||
sc-network = { workspace = true, default-features = true }
|
||||
pezsc-network = { workspace = true, default-features = true }
|
||||
|
||||
[dev-dependencies]
|
||||
assert_matches = { workspace = true }
|
||||
futures-timer = { workspace = true }
|
||||
rstest = { workspace = true }
|
||||
|
||||
sp-core = { workspace = true, default-features = true }
|
||||
sp-keyring = { workspace = true, default-features = true }
|
||||
sp-tracing = { workspace = true, default-features = true }
|
||||
pezsp-core = { workspace = true, default-features = true }
|
||||
pezsp-keyring = { workspace = true, default-features = true }
|
||||
pezsp-tracing = { workspace = true, default-features = true }
|
||||
|
||||
pezkuwi-node-subsystem-test-helpers = { workspace = true }
|
||||
pezkuwi-primitives-test-helpers = { workspace = true }
|
||||
@@ -62,6 +62,6 @@ runtime-benchmarks = [
|
||||
"pezkuwi-primitives-test-helpers/runtime-benchmarks",
|
||||
"pezkuwi-primitives/runtime-benchmarks",
|
||||
"pezkuwi-subsystem-bench/runtime-benchmarks",
|
||||
"sc-network/runtime-benchmarks",
|
||||
"sp-keyring/runtime-benchmarks",
|
||||
"pezsc-network/runtime-benchmarks",
|
||||
"pezsp-keyring/runtime-benchmarks",
|
||||
]
|
||||
|
||||
@@ -34,7 +34,7 @@ use futures::{
|
||||
stream::{FuturesUnordered, StreamExt},
|
||||
task::{Context, Poll},
|
||||
};
|
||||
use sc_network::ProtocolName;
|
||||
use pezsc_network::ProtocolName;
|
||||
use schnellru::{ByLength, LruMap};
|
||||
use task::{
|
||||
FetchChunks, FetchChunksParams, FetchFull, FetchFullParams, FetchSystematicChunks,
|
||||
|
||||
@@ -34,7 +34,7 @@ use codec::Encode;
|
||||
use pezkuwi_node_primitives::AvailableData;
|
||||
use pezkuwi_node_subsystem::{messages::AvailabilityStoreMessage, overseer, RecoveryError};
|
||||
use pezkuwi_primitives::{AuthorityDiscoveryId, CandidateHash, Hash};
|
||||
use sc_network::ProtocolName;
|
||||
use pezsc_network::ProtocolName;
|
||||
|
||||
use futures::channel::{mpsc, oneshot};
|
||||
use std::collections::VecDeque;
|
||||
|
||||
@@ -25,7 +25,7 @@ use pezkuwi_node_network_protocol::request_response::{
|
||||
use pezkuwi_node_primitives::AvailableData;
|
||||
use pezkuwi_node_subsystem::{messages::NetworkBridgeTxMessage, overseer, RecoveryError};
|
||||
use pezkuwi_primitives::ValidatorIndex;
|
||||
use sc_network::{IfDisconnected, OutboundFailure, RequestFailure};
|
||||
use pezsc_network::{IfDisconnected, OutboundFailure, RequestFailure};
|
||||
|
||||
use futures::{channel::oneshot, SinkExt};
|
||||
use rand::seq::SliceRandom;
|
||||
|
||||
@@ -43,7 +43,7 @@ use pezkuwi_node_subsystem::{
|
||||
overseer, RecoveryError,
|
||||
};
|
||||
use pezkuwi_primitives::{AuthorityDiscoveryId, BlakeTwo256, ChunkIndex, HashT, ValidatorIndex};
|
||||
use sc_network::{IfDisconnected, OutboundFailure, ProtocolName, RequestFailure};
|
||||
use pezsc_network::{IfDisconnected, OutboundFailure, ProtocolName, RequestFailure};
|
||||
use std::{
|
||||
collections::{BTreeMap, HashMap, VecDeque},
|
||||
time::Duration,
|
||||
@@ -652,7 +652,7 @@ mod tests {
|
||||
};
|
||||
use pezkuwi_primitives::{CandidateHash, HeadData, PersistedValidationData};
|
||||
use pezkuwi_primitives_test_helpers::dummy_hash;
|
||||
use sp_keyring::Sr25519Keyring;
|
||||
use pezsp_keyring::Sr25519Keyring;
|
||||
use std::sync::Arc;
|
||||
|
||||
const TIMEOUT: Duration = Duration::from_secs(1);
|
||||
|
||||
@@ -45,8 +45,8 @@ use pezkuwi_primitives::{
|
||||
MutateDescriptorV2, NodeFeatures, PersistedValidationData, SessionInfo, ValidatorId,
|
||||
};
|
||||
use pezkuwi_primitives_test_helpers::{dummy_candidate_receipt, dummy_hash};
|
||||
use sc_network::{IfDisconnected, OutboundFailure, ProtocolName, RequestFailure};
|
||||
use sp_keyring::Sr25519Keyring;
|
||||
use pezsc_network::{IfDisconnected, OutboundFailure, ProtocolName, RequestFailure};
|
||||
use pezsp_keyring::Sr25519Keyring;
|
||||
|
||||
type VirtualOverseer = TestSubsystemContextHandle<AvailabilityRecoveryMessage>;
|
||||
|
||||
@@ -149,7 +149,7 @@ fn request_receiver(
|
||||
) -> IncomingRequestReceiver<AvailableDataFetchingRequest> {
|
||||
let receiver = IncomingRequest::get_config_receiver::<
|
||||
Block,
|
||||
sc_network::NetworkWorker<Block, Hash>,
|
||||
pezsc_network::NetworkWorker<Block, Hash>,
|
||||
>(req_protocol_names);
|
||||
// Don't close the sending end of the request protocol. Otherwise, the subsystem will terminate.
|
||||
std::mem::forget(receiver.1.inbound_queue);
|
||||
@@ -160,9 +160,9 @@ fn test_harness<Fut: Future<Output = VirtualOverseer>>(
|
||||
subsystem: AvailabilityRecoverySubsystem,
|
||||
test: impl FnOnce(VirtualOverseer) -> Fut,
|
||||
) {
|
||||
sp_tracing::init_for_tests();
|
||||
pezsp_tracing::init_for_tests();
|
||||
|
||||
let pool = sp_core::testing::TaskExecutor::new();
|
||||
let pool = pezsp_core::testing::TaskExecutor::new();
|
||||
|
||||
let (context, virtual_overseer) = make_subsystem_context(pool.clone());
|
||||
|
||||
|
||||
@@ -27,12 +27,12 @@ bitvec = { features = ["alloc"], workspace = true }
|
||||
maplit = { workspace = true }
|
||||
pezkuwi-node-subsystem-test-helpers = { workspace = true }
|
||||
rand_chacha = { workspace = true, default-features = true }
|
||||
sp-application-crypto = { workspace = true, default-features = true }
|
||||
sp-authority-discovery = { workspace = true, default-features = true }
|
||||
sp-core = { workspace = true, default-features = true }
|
||||
sp-keyring = { workspace = true, default-features = true }
|
||||
sp-keystore = { workspace = true, default-features = true }
|
||||
sp-tracing = { workspace = true }
|
||||
pezsp-application-crypto = { workspace = true, default-features = true }
|
||||
pezsp-authority-discovery = { workspace = true, default-features = true }
|
||||
pezsp-core = { workspace = true, default-features = true }
|
||||
pezsp-keyring = { workspace = true, default-features = true }
|
||||
pezsp-keystore = { workspace = true, default-features = true }
|
||||
pezsp-tracing = { workspace = true }
|
||||
|
||||
[features]
|
||||
runtime-benchmarks = [
|
||||
@@ -42,6 +42,6 @@ runtime-benchmarks = [
|
||||
"pezkuwi-node-subsystem-util/runtime-benchmarks",
|
||||
"pezkuwi-node-subsystem/runtime-benchmarks",
|
||||
"pezkuwi-primitives/runtime-benchmarks",
|
||||
"sp-authority-discovery/runtime-benchmarks",
|
||||
"sp-keyring/runtime-benchmarks",
|
||||
"pezsp-authority-discovery/runtime-benchmarks",
|
||||
"pezsp-keyring/runtime-benchmarks",
|
||||
]
|
||||
|
||||
@@ -30,11 +30,11 @@ use pezkuwi_node_subsystem_test_helpers::make_subsystem_context;
|
||||
use pezkuwi_node_subsystem_util::TimeoutExt;
|
||||
use pezkuwi_primitives::{AvailabilityBitfield, Signed, ValidatorIndex};
|
||||
use rand_chacha::ChaCha12Rng;
|
||||
use sp_application_crypto::AppCrypto;
|
||||
use sp_authority_discovery::AuthorityPair as AuthorityDiscoveryPair;
|
||||
use sp_core::Pair as PairT;
|
||||
use sp_keyring::Sr25519Keyring;
|
||||
use sp_keystore::{testing::MemoryKeystore, Keystore, KeystorePtr};
|
||||
use pezsp_application_crypto::AppCrypto;
|
||||
use pezsp_authority_discovery::AuthorityPair as AuthorityDiscoveryPair;
|
||||
use pezsp_core::Pair as PairT;
|
||||
use pezsp_keyring::Sr25519Keyring;
|
||||
use pezsp_keystore::{testing::MemoryKeystore, Keystore, KeystorePtr};
|
||||
|
||||
use std::{sync::Arc, time::Duration};
|
||||
|
||||
@@ -131,7 +131,7 @@ fn state_with_view(
|
||||
|
||||
#[test]
|
||||
fn receive_invalid_signature() {
|
||||
sp_tracing::init_for_tests();
|
||||
pezsp_tracing::init_for_tests();
|
||||
|
||||
let hash_a: Hash = [0; 32].into();
|
||||
|
||||
@@ -192,7 +192,7 @@ fn receive_invalid_signature() {
|
||||
let valid_msg =
|
||||
BitfieldGossipMessage { relay_parent: hash_a, signed_availability: valid_signed.clone() };
|
||||
|
||||
let pool = sp_core::testing::TaskExecutor::new();
|
||||
let pool = pezsp_core::testing::TaskExecutor::new();
|
||||
let (mut ctx, mut handle) = make_subsystem_context::<BitfieldDistributionMessage, _>(pool);
|
||||
|
||||
let mut state =
|
||||
@@ -245,7 +245,7 @@ fn receive_invalid_signature() {
|
||||
|
||||
#[test]
|
||||
fn receive_invalid_validator_index() {
|
||||
sp_tracing::init_for_tests();
|
||||
pezsp_tracing::init_for_tests();
|
||||
|
||||
let hash_a: Hash = [0; 32].into();
|
||||
let hash_b: Hash = [1; 32].into(); // other
|
||||
@@ -274,7 +274,7 @@ fn receive_invalid_validator_index() {
|
||||
|
||||
let msg = BitfieldGossipMessage { relay_parent: hash_a, signed_availability: signed.clone() };
|
||||
|
||||
let pool = sp_core::testing::TaskExecutor::new();
|
||||
let pool = pezsp_core::testing::TaskExecutor::new();
|
||||
let (mut ctx, mut handle) = make_subsystem_context::<BitfieldDistributionMessage, _>(pool);
|
||||
let mut rng = dummy_rng();
|
||||
|
||||
@@ -305,7 +305,7 @@ fn receive_invalid_validator_index() {
|
||||
|
||||
#[test]
|
||||
fn receive_duplicate_messages() {
|
||||
sp_tracing::init_for_tests();
|
||||
pezsp_tracing::init_for_tests();
|
||||
|
||||
let hash_a: Hash = [0; 32].into();
|
||||
let hash_b: Hash = [1; 32].into();
|
||||
@@ -336,7 +336,7 @@ fn receive_duplicate_messages() {
|
||||
signed_availability: signed_bitfield.clone(),
|
||||
};
|
||||
|
||||
let pool = sp_core::testing::TaskExecutor::new();
|
||||
let pool = pezsp_core::testing::TaskExecutor::new();
|
||||
let (mut ctx, mut handle) = make_subsystem_context::<BitfieldDistributionMessage, _>(pool);
|
||||
let mut rng = dummy_rng();
|
||||
|
||||
@@ -427,7 +427,7 @@ fn receive_duplicate_messages() {
|
||||
fn delay_reputation_change() {
|
||||
use pezkuwi_node_subsystem_util::reputation::add_reputation;
|
||||
|
||||
sp_tracing::init_for_tests();
|
||||
pezsp_tracing::init_for_tests();
|
||||
|
||||
let hash_a: Hash = [0; 32].into();
|
||||
let hash_b: Hash = [1; 32].into();
|
||||
@@ -456,7 +456,7 @@ fn delay_reputation_change() {
|
||||
signed_availability: signed_bitfield.clone(),
|
||||
};
|
||||
|
||||
let pool = sp_core::testing::TaskExecutor::new();
|
||||
let pool = pezsp_core::testing::TaskExecutor::new();
|
||||
let (ctx, mut handle) = make_subsystem_context::<BitfieldDistributionMessage, _>(pool);
|
||||
let mut rng = dummy_rng();
|
||||
let reputation_interval = Duration::from_millis(100);
|
||||
@@ -532,7 +532,7 @@ fn delay_reputation_change() {
|
||||
|
||||
#[test]
|
||||
fn do_not_relay_message_twice() {
|
||||
sp_tracing::init_for_tests();
|
||||
pezsp_tracing::init_for_tests();
|
||||
|
||||
let hash = Hash::random();
|
||||
|
||||
@@ -563,7 +563,7 @@ fn do_not_relay_message_twice() {
|
||||
let msg =
|
||||
BitfieldGossipMessage { relay_parent: hash, signed_availability: signed_bitfield.clone() };
|
||||
|
||||
let pool = sp_core::testing::TaskExecutor::new();
|
||||
let pool = pezsp_core::testing::TaskExecutor::new();
|
||||
let (mut ctx, mut handle) = make_subsystem_context::<BitfieldDistributionMessage, _>(pool);
|
||||
let mut rng = dummy_rng();
|
||||
|
||||
@@ -637,7 +637,7 @@ fn do_not_relay_message_twice() {
|
||||
|
||||
#[test]
|
||||
fn changing_view() {
|
||||
sp_tracing::init_for_tests();
|
||||
pezsp_tracing::init_for_tests();
|
||||
|
||||
let hash_a: Hash = [0; 32].into();
|
||||
let hash_b: Hash = [1; 32].into();
|
||||
@@ -668,7 +668,7 @@ fn changing_view() {
|
||||
signed_availability: signed_bitfield.clone(),
|
||||
};
|
||||
|
||||
let pool = sp_core::testing::TaskExecutor::new();
|
||||
let pool = pezsp_core::testing::TaskExecutor::new();
|
||||
let (mut ctx, mut handle) = make_subsystem_context::<BitfieldDistributionMessage, _>(pool);
|
||||
let mut rng = dummy_rng();
|
||||
|
||||
@@ -809,7 +809,7 @@ fn changing_view() {
|
||||
|
||||
#[test]
|
||||
fn do_not_send_message_back_to_origin() {
|
||||
sp_tracing::init_for_tests();
|
||||
pezsp_tracing::init_for_tests();
|
||||
|
||||
let hash: Hash = [0; 32].into();
|
||||
|
||||
@@ -840,7 +840,7 @@ fn do_not_send_message_back_to_origin() {
|
||||
let msg =
|
||||
BitfieldGossipMessage { relay_parent: hash, signed_availability: signed_bitfield.clone() };
|
||||
|
||||
let pool = sp_core::testing::TaskExecutor::new();
|
||||
let pool = pezsp_core::testing::TaskExecutor::new();
|
||||
let (mut ctx, mut handle) = make_subsystem_context::<BitfieldDistributionMessage, _>(pool);
|
||||
let mut rng = dummy_rng();
|
||||
|
||||
@@ -893,7 +893,7 @@ fn do_not_send_message_back_to_origin() {
|
||||
|
||||
#[test]
|
||||
fn topology_test() {
|
||||
sp_tracing::init_for_tests();
|
||||
pezsp_tracing::init_for_tests();
|
||||
|
||||
let hash: Hash = [0; 32].into();
|
||||
|
||||
@@ -955,7 +955,7 @@ fn topology_test() {
|
||||
let msg =
|
||||
BitfieldGossipMessage { relay_parent: hash, signed_availability: signed_bitfield.clone() };
|
||||
|
||||
let pool = sp_core::testing::TaskExecutor::new();
|
||||
let pool = pezsp_core::testing::TaskExecutor::new();
|
||||
let (mut ctx, mut handle) = make_subsystem_context::<BitfieldDistributionMessage, _>(pool);
|
||||
let mut rng = dummy_rng();
|
||||
|
||||
|
||||
@@ -25,8 +25,8 @@ pezkuwi-node-network-protocol = { workspace = true, default-features = true }
|
||||
pezkuwi-node-subsystem = { workspace = true, default-features = true }
|
||||
pezkuwi-overseer = { workspace = true, default-features = true }
|
||||
pezkuwi-primitives = { workspace = true, default-features = true }
|
||||
sc-network = { workspace = true, default-features = true }
|
||||
sp-consensus = { workspace = true, default-features = true }
|
||||
pezsc-network = { workspace = true, default-features = true }
|
||||
pezsp-consensus = { workspace = true, default-features = true }
|
||||
thiserror = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
@@ -35,8 +35,8 @@ futures-timer = { workspace = true }
|
||||
pezkuwi-node-subsystem-test-helpers = { workspace = true }
|
||||
pezkuwi-node-subsystem-util = { workspace = true, default-features = true }
|
||||
pezkuwi-primitives-test-helpers = { workspace = true }
|
||||
sp-core = { workspace = true, default-features = true }
|
||||
sp-keyring = { workspace = true, default-features = true }
|
||||
pezsp-core = { workspace = true, default-features = true }
|
||||
pezsp-keyring = { workspace = true, default-features = true }
|
||||
|
||||
[features]
|
||||
runtime-benchmarks = [
|
||||
@@ -49,7 +49,7 @@ runtime-benchmarks = [
|
||||
"pezkuwi-overseer/runtime-benchmarks",
|
||||
"pezkuwi-primitives-test-helpers/runtime-benchmarks",
|
||||
"pezkuwi-primitives/runtime-benchmarks",
|
||||
"sc-network/runtime-benchmarks",
|
||||
"sp-consensus/runtime-benchmarks",
|
||||
"sp-keyring/runtime-benchmarks",
|
||||
"pezsc-network/runtime-benchmarks",
|
||||
"pezsp-consensus/runtime-benchmarks",
|
||||
"pezsp-keyring/runtime-benchmarks",
|
||||
]
|
||||
|
||||
@@ -25,7 +25,7 @@ use codec::{Decode, Encode};
|
||||
use futures::prelude::*;
|
||||
use parking_lot::Mutex;
|
||||
|
||||
use sp_consensus::SyncOracle;
|
||||
use pezsp_consensus::SyncOracle;
|
||||
|
||||
use pezkuwi_node_network_protocol::{
|
||||
peer_set::{PeerSet, ProtocolVersion},
|
||||
|
||||
@@ -24,7 +24,7 @@ use parking_lot::Mutex;
|
||||
|
||||
use codec::Encode;
|
||||
|
||||
use sc_network::{
|
||||
use pezsc_network::{
|
||||
config::parse_addr, multiaddr::Multiaddr, service::traits::NetworkService, types::ProtocolName,
|
||||
IfDisconnected, MessageSink, OutboundFailure, ReputationChange, RequestFailure,
|
||||
};
|
||||
@@ -196,7 +196,7 @@ pub trait Network: Clone + Send + 'static {
|
||||
fn disconnect_peer(&self, who: PeerId, protocol: ProtocolName);
|
||||
|
||||
/// Get peer role.
|
||||
fn peer_role(&self, who: PeerId, handshake: Vec<u8>) -> Option<sc_network::ObservedRole>;
|
||||
fn peer_role(&self, who: PeerId, handshake: Vec<u8>) -> Option<pezsc_network::ObservedRole>;
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
@@ -308,7 +308,7 @@ impl Network for Arc<dyn NetworkService> {
|
||||
);
|
||||
}
|
||||
|
||||
fn peer_role(&self, who: PeerId, handshake: Vec<u8>) -> Option<sc_network::ObservedRole> {
|
||||
fn peer_role(&self, who: PeerId, handshake: Vec<u8>) -> Option<pezsc_network::ObservedRole> {
|
||||
<dyn NetworkService>::peer_role(&**self, who, handshake)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,11 +24,11 @@ use codec::{Decode, DecodeAll};
|
||||
use net_protocol::filter_by_peer_version;
|
||||
use parking_lot::Mutex;
|
||||
|
||||
use sc_network::{
|
||||
use pezsc_network::{
|
||||
service::traits::{NotificationEvent, ValidationResult},
|
||||
MessageSink, NotificationService,
|
||||
};
|
||||
use sp_consensus::SyncOracle;
|
||||
use pezsp_consensus::SyncOracle;
|
||||
|
||||
use pezkuwi_node_network_protocol::{
|
||||
self as net_protocol,
|
||||
|
||||
@@ -29,9 +29,9 @@ use std::{
|
||||
time::Duration,
|
||||
};
|
||||
|
||||
use sc_network::{
|
||||
use pezsc_network::{
|
||||
service::traits::{Direction, MessageSink, NotificationService},
|
||||
IfDisconnected, Multiaddr, ObservedRole as SubstrateObservedRole, ProtocolName,
|
||||
IfDisconnected, Multiaddr, ObservedRole as BizinikiwiObservedRole, ProtocolName,
|
||||
ReputationChange, Roles,
|
||||
};
|
||||
|
||||
@@ -53,7 +53,7 @@ use pezkuwi_node_subsystem_test_helpers::{
|
||||
use pezkuwi_node_subsystem_util::metered;
|
||||
use pezkuwi_primitives::{AuthorityDiscoveryId, Hash};
|
||||
|
||||
use sp_keyring::Sr25519Keyring;
|
||||
use pezsp_keyring::Sr25519Keyring;
|
||||
|
||||
use crate::{network::Network, validator_discovery::AuthorityDiscovery};
|
||||
|
||||
@@ -167,10 +167,10 @@ impl Network for TestNetwork {
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
fn peer_role(&self, _peer_id: PeerId, handshake: Vec<u8>) -> Option<SubstrateObservedRole> {
|
||||
fn peer_role(&self, _peer_id: PeerId, handshake: Vec<u8>) -> Option<BizinikiwiObservedRole> {
|
||||
Roles::decode_all(&mut &handshake[..])
|
||||
.ok()
|
||||
.and_then(|role| Some(SubstrateObservedRole::from(role)))
|
||||
.and_then(|role| Some(BizinikiwiObservedRole::from(role)))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -352,7 +352,7 @@ impl MessageSink for TestMessageSink {
|
||||
async fn send_async_notification(
|
||||
&self,
|
||||
_notification: Vec<u8>,
|
||||
) -> Result<(), sc_network::error::Error> {
|
||||
) -> Result<(), pezsc_network::error::Error> {
|
||||
unimplemented!();
|
||||
}
|
||||
}
|
||||
@@ -379,7 +379,7 @@ impl NotificationService for TestNotificationService {
|
||||
&mut self,
|
||||
_peer: &PeerId,
|
||||
_notification: Vec<u8>,
|
||||
) -> Result<(), sc_network::error::Error> {
|
||||
) -> Result<(), pezsc_network::error::Error> {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
@@ -507,7 +507,7 @@ fn test_harness<T: Future<Output = VirtualOverseer>>(
|
||||
let fork_id = None;
|
||||
let peerset_protocol_names = PeerSetProtocolNames::new(genesis_hash, fork_id);
|
||||
|
||||
let pool = sp_core::testing::TaskExecutor::new();
|
||||
let pool = pezsp_core::testing::TaskExecutor::new();
|
||||
let (network, network_handle, discovery, validation_service, collation_service) =
|
||||
new_test_network(peerset_protocol_names.clone());
|
||||
let (context, virtual_overseer) =
|
||||
@@ -1193,7 +1193,7 @@ fn relays_collation_protocol_messages() {
|
||||
let collator_protocol_message = protocol_v1::CollatorProtocolMessage::Declare(
|
||||
Sr25519Keyring::Alice.public().into(),
|
||||
Default::default(),
|
||||
sp_core::crypto::UncheckedFrom::unchecked_from([1u8; 64]),
|
||||
pezsp_core::crypto::UncheckedFrom::unchecked_from([1u8; 64]),
|
||||
);
|
||||
|
||||
let message_v1 =
|
||||
@@ -1691,7 +1691,7 @@ fn network_protocol_versioning_subsystem_msg() {
|
||||
let collator_protocol_message = protocol_v1::CollatorProtocolMessage::Declare(
|
||||
Sr25519Keyring::Alice.public().into(),
|
||||
Default::default(),
|
||||
sp_core::crypto::UncheckedFrom::unchecked_from([1u8; 64]),
|
||||
pezsp_core::crypto::UncheckedFrom::unchecked_from([1u8; 64]),
|
||||
);
|
||||
|
||||
let msg =
|
||||
|
||||
@@ -29,7 +29,7 @@ use pezkuwi_node_subsystem::{
|
||||
};
|
||||
|
||||
use pezkuwi_node_network_protocol::request_response::Requests;
|
||||
use sc_network::{MessageSink, ReputationChange};
|
||||
use pezsc_network::{MessageSink, ReputationChange};
|
||||
|
||||
use crate::validator_discovery;
|
||||
|
||||
|
||||
@@ -22,8 +22,8 @@ use async_trait::async_trait;
|
||||
use parking_lot::Mutex;
|
||||
use std::collections::HashSet;
|
||||
|
||||
use sc_network::{
|
||||
IfDisconnected, ObservedRole as SubstrateObservedRole, ProtocolName, ReputationChange, Roles,
|
||||
use pezsc_network::{
|
||||
IfDisconnected, ObservedRole as BizinikiwiObservedRole, ProtocolName, ReputationChange, Roles,
|
||||
};
|
||||
|
||||
use codec::DecodeAll;
|
||||
@@ -37,8 +37,8 @@ use pezkuwi_node_subsystem_test_helpers::TestSubsystemContextHandle;
|
||||
use pezkuwi_node_subsystem_util::metered;
|
||||
use pezkuwi_primitives::{AuthorityDiscoveryId, Hash};
|
||||
use pezkuwi_primitives_test_helpers::dummy_collator_signature;
|
||||
use sc_network::Multiaddr;
|
||||
use sp_keyring::Sr25519Keyring;
|
||||
use pezsc_network::Multiaddr;
|
||||
use pezsp_keyring::Sr25519Keyring;
|
||||
|
||||
const TIMEOUT: std::time::Duration = pezkuwi_node_subsystem_test_helpers::TestSubsystemContextHandle::<NetworkBridgeTxMessage>::TIMEOUT;
|
||||
|
||||
@@ -105,7 +105,7 @@ impl MessageSink for TestMessageSink {
|
||||
async fn send_async_notification(
|
||||
&self,
|
||||
_notification: Vec<u8>,
|
||||
) -> Result<(), sc_network::error::Error> {
|
||||
) -> Result<(), pezsc_network::error::Error> {
|
||||
unimplemented!();
|
||||
}
|
||||
}
|
||||
@@ -190,10 +190,10 @@ impl Network for TestNetwork {
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
fn peer_role(&self, _peer_id: PeerId, handshake: Vec<u8>) -> Option<SubstrateObservedRole> {
|
||||
fn peer_role(&self, _peer_id: PeerId, handshake: Vec<u8>) -> Option<BizinikiwiObservedRole> {
|
||||
Roles::decode_all(&mut &handshake[..])
|
||||
.ok()
|
||||
.and_then(|role| Some(SubstrateObservedRole::from(role)))
|
||||
.and_then(|role| Some(BizinikiwiObservedRole::from(role)))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -241,7 +241,7 @@ fn test_harness<T: Future<Output = VirtualOverseer>>(test: impl FnOnce(TestHarne
|
||||
let req_protocol_names = ReqProtocolNames::new(genesis_hash, fork_id);
|
||||
let peerset_protocol_names = PeerSetProtocolNames::new(genesis_hash, fork_id);
|
||||
|
||||
let pool = sp_core::testing::TaskExecutor::new();
|
||||
let pool = pezsp_core::testing::TaskExecutor::new();
|
||||
let (network, network_handle, discovery, network_notification_sinks) =
|
||||
new_test_network(peerset_protocol_names.clone());
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ use std::collections::HashSet;
|
||||
|
||||
use futures::channel::oneshot;
|
||||
|
||||
use sc_network::multiaddr::{self, Multiaddr};
|
||||
use pezsc_network::multiaddr::{self, Multiaddr};
|
||||
|
||||
pub use pezkuwi_node_network_protocol::authority_discovery::AuthorityDiscovery;
|
||||
use pezkuwi_node_network_protocol::{
|
||||
@@ -202,8 +202,8 @@ mod tests {
|
||||
PeerId,
|
||||
};
|
||||
use pezkuwi_primitives::Hash;
|
||||
use sc_network::{IfDisconnected, ProtocolName, ReputationChange};
|
||||
use sp_keyring::Sr25519Keyring;
|
||||
use pezsc_network::{IfDisconnected, ProtocolName, ReputationChange};
|
||||
use pezsp_keyring::Sr25519Keyring;
|
||||
use std::collections::{HashMap, HashSet};
|
||||
|
||||
fn new_service() -> Service<TestNetwork, TestAuthorityDiscovery> {
|
||||
@@ -299,7 +299,7 @@ mod tests {
|
||||
&self,
|
||||
_peer_id: PeerId,
|
||||
_handshake: Vec<u8>,
|
||||
) -> Option<sc_network::ObservedRole> {
|
||||
) -> Option<pezsc_network::ObservedRole> {
|
||||
panic!()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,9 +19,9 @@ futures-timer = { workspace = true }
|
||||
gum = { workspace = true, default-features = true }
|
||||
schnellru = { workspace = true }
|
||||
|
||||
sp-core = { workspace = true, default-features = true }
|
||||
sp-keystore = { workspace = true, default-features = true }
|
||||
sp-runtime = { workspace = true, default-features = true }
|
||||
pezsp-core = { workspace = true, default-features = true }
|
||||
pezsp-keystore = { workspace = true, default-features = true }
|
||||
pezsp-runtime = { workspace = true, default-features = true }
|
||||
|
||||
fatality = { workspace = true }
|
||||
pezkuwi-node-network-protocol = { workspace = true, default-features = true }
|
||||
@@ -41,13 +41,13 @@ tokio = { features = [
|
||||
[dev-dependencies]
|
||||
assert_matches = { workspace = true }
|
||||
rstest = { workspace = true }
|
||||
sp-tracing = { workspace = true }
|
||||
pezsp-tracing = { workspace = true }
|
||||
|
||||
codec = { features = ["std"], workspace = true, default-features = true }
|
||||
sc-keystore = { workspace = true, default-features = true }
|
||||
sc-network = { workspace = true, default-features = true }
|
||||
sp-core = { features = ["std"], workspace = true, default-features = true }
|
||||
sp-keyring = { workspace = true, default-features = true }
|
||||
pezsc-keystore = { workspace = true, default-features = true }
|
||||
pezsc-network = { workspace = true, default-features = true }
|
||||
pezsp-core = { features = ["std"], workspace = true, default-features = true }
|
||||
pezsp-keyring = { workspace = true, default-features = true }
|
||||
|
||||
itertools = { workspace = true }
|
||||
pezkuwi-node-subsystem-test-helpers = { workspace = true }
|
||||
@@ -65,7 +65,7 @@ runtime-benchmarks = [
|
||||
"pezkuwi-node-subsystem/runtime-benchmarks",
|
||||
"pezkuwi-primitives-test-helpers/runtime-benchmarks",
|
||||
"pezkuwi-primitives/runtime-benchmarks",
|
||||
"sc-network/runtime-benchmarks",
|
||||
"sp-keyring/runtime-benchmarks",
|
||||
"sp-runtime/runtime-benchmarks",
|
||||
"pezsc-network/runtime-benchmarks",
|
||||
"pezsp-keyring/runtime-benchmarks",
|
||||
"pezsp-runtime/runtime-benchmarks",
|
||||
]
|
||||
|
||||
@@ -22,7 +22,7 @@ use std::{
|
||||
use pezkuwi_node_subsystem::prometheus::prometheus::HistogramTimer;
|
||||
use pezkuwi_node_subsystem_util::metrics::{self, prometheus};
|
||||
use pezkuwi_primitives::{BlockNumber, CandidateReceiptV2 as CandidateReceipt, Hash};
|
||||
use sp_core::H256;
|
||||
use pezsp_core::H256;
|
||||
|
||||
use super::collation::CollationStatus;
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ use futures::{
|
||||
};
|
||||
use metrics::{CollationStats, CollationTracker};
|
||||
use schnellru::{ByLength, LruMap};
|
||||
use sp_core::Pair;
|
||||
use pezsp_core::Pair;
|
||||
|
||||
use pezkuwi_node_network_protocol::{
|
||||
self as net_protocol,
|
||||
@@ -85,7 +85,7 @@ const COST_APPARENT_FLOOD: Rep =
|
||||
///
|
||||
/// This is to protect from a single slow validator preventing collations from happening.
|
||||
///
|
||||
/// For considerations on this value, see: https://github.com/paritytech/polkadot/issues/4386
|
||||
/// For considerations on this value, see: https://github.com/pezkuwichain/kurdistan-sdk/issues/148
|
||||
const MAX_UNSHARED_UPLOAD_TIME: Duration = Duration::from_millis(150);
|
||||
|
||||
/// A timeout for resetting validators' interests in collations.
|
||||
|
||||
@@ -27,10 +27,10 @@ use futures_timer::Delay;
|
||||
|
||||
use codec::{Decode, Encode};
|
||||
|
||||
use sc_network::config::IncomingRequest as RawIncomingRequest;
|
||||
use sp_core::crypto::Pair;
|
||||
use sp_keyring::Sr25519Keyring;
|
||||
use sp_runtime::traits::AppVerify;
|
||||
use pezsc_network::config::IncomingRequest as RawIncomingRequest;
|
||||
use pezsp_core::crypto::Pair;
|
||||
use pezsp_keyring::Sr25519Keyring;
|
||||
use pezsp_runtime::traits::AppVerify;
|
||||
|
||||
use itertools::Itertools;
|
||||
use pezkuwi_node_network_protocol::{
|
||||
@@ -200,7 +200,7 @@ type VirtualOverseer =
|
||||
|
||||
struct TestHarness {
|
||||
virtual_overseer: VirtualOverseer,
|
||||
req_v2_cfg: sc_network::config::RequestResponseConfig,
|
||||
req_v2_cfg: pezsc_network::config::RequestResponseConfig,
|
||||
}
|
||||
|
||||
fn test_harness<T: Future<Output = TestHarness>>(
|
||||
@@ -209,9 +209,9 @@ fn test_harness<T: Future<Output = TestHarness>>(
|
||||
reputation: ReputationAggregator,
|
||||
test: impl FnOnce(TestHarness) -> T,
|
||||
) {
|
||||
let _ = sp_tracing::init_for_tests();
|
||||
let _ = pezsp_tracing::init_for_tests();
|
||||
|
||||
let pool = sp_core::testing::TaskExecutor::new();
|
||||
let pool = pezsp_core::testing::TaskExecutor::new();
|
||||
|
||||
let (context, virtual_overseer) =
|
||||
pezkuwi_node_subsystem_test_helpers::make_subsystem_context(pool.clone());
|
||||
@@ -221,7 +221,7 @@ fn test_harness<T: Future<Output = TestHarness>>(
|
||||
|
||||
let (collation_req_v2_receiver, req_v2_cfg) = IncomingRequest::get_config_receiver::<
|
||||
Block,
|
||||
sc_network::NetworkWorker<Block, Hash>,
|
||||
pezsc_network::NetworkWorker<Block, Hash>,
|
||||
>(&req_protocol_names);
|
||||
let subsystem = async {
|
||||
run_inner(
|
||||
@@ -1325,8 +1325,8 @@ fn collators_reject_declare_messages() {
|
||||
/// successful completion.
|
||||
fn test_validator_send_sequence<T, F>(handle_first_response: T)
|
||||
where
|
||||
T: FnOnce(oneshot::Receiver<sc_network::config::OutgoingResponse>, oneshot::Sender<()>) -> F,
|
||||
F: Future<Output = oneshot::Receiver<sc_network::config::OutgoingResponse>>,
|
||||
T: FnOnce(oneshot::Receiver<pezsc_network::config::OutgoingResponse>, oneshot::Sender<()>) -> F,
|
||||
F: Future<Output = oneshot::Receiver<pezsc_network::config::OutgoingResponse>>,
|
||||
{
|
||||
let test_state = TestState::default();
|
||||
let local_peer_id = test_state.local_peer_id;
|
||||
|
||||
@@ -32,7 +32,7 @@ use futures::{
|
||||
};
|
||||
|
||||
use pezkuwi_node_subsystem_util::reputation::ReputationAggregator;
|
||||
use sp_keystore::KeystorePtr;
|
||||
use pezsp_keystore::KeystorePtr;
|
||||
|
||||
use pezkuwi_node_network_protocol::{
|
||||
request_response::{v2 as protocol_v2, IncomingRequestReceiver},
|
||||
|
||||
@@ -25,7 +25,7 @@ use std::{
|
||||
};
|
||||
use tokio_util::sync::CancellationToken;
|
||||
|
||||
use sp_keystore::KeystorePtr;
|
||||
use pezsp_keystore::KeystorePtr;
|
||||
|
||||
use pezkuwi_node_network_protocol::{
|
||||
self as net_protocol,
|
||||
@@ -876,7 +876,7 @@ async fn process_incoming_peer_message<Context>(
|
||||
) {
|
||||
use protocol_v1::CollatorProtocolMessage as V1;
|
||||
use protocol_v2::CollatorProtocolMessage as V2;
|
||||
use sp_runtime::traits::AppVerify;
|
||||
use pezsp_runtime::traits::AppVerify;
|
||||
|
||||
match msg {
|
||||
CollationProtocols::V1(V1::Declare(collator_id, para_id, signature)) |
|
||||
@@ -2366,7 +2366,7 @@ async fn handle_collation_fetch_response(
|
||||
"Request timed out"
|
||||
);
|
||||
// For now we don't want to change reputation on timeout, to mitigate issues like
|
||||
// this: https://github.com/paritytech/polkadot/issues/4617
|
||||
// this: https://github.com/pezkuwichain/kurdistan-sdk/issues/152
|
||||
Err(None)
|
||||
},
|
||||
Err(RequestError::NetworkError(err)) => {
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
use super::*;
|
||||
use assert_matches::assert_matches;
|
||||
use futures::{executor, future, Future};
|
||||
use sc_network::ProtocolName;
|
||||
use sp_core::{crypto::Pair, Encode};
|
||||
use sp_keyring::Sr25519Keyring;
|
||||
use sp_keystore::Keystore;
|
||||
use pezsc_network::ProtocolName;
|
||||
use pezsp_core::{crypto::Pair, Encode};
|
||||
use pezsp_keyring::Sr25519Keyring;
|
||||
use pezsp_keystore::Keystore;
|
||||
use std::{
|
||||
collections::{BTreeMap, VecDeque},
|
||||
iter,
|
||||
@@ -208,14 +208,14 @@ fn test_harness<T: Future<Output = VirtualOverseer>>(
|
||||
ah_invulnerable_collators: HashSet<PeerId>,
|
||||
test: impl FnOnce(TestHarness) -> T,
|
||||
) {
|
||||
sp_tracing::init_for_tests();
|
||||
pezsp_tracing::init_for_tests();
|
||||
|
||||
let pool = sp_core::testing::TaskExecutor::new();
|
||||
let pool = pezsp_core::testing::TaskExecutor::new();
|
||||
|
||||
let (context, virtual_overseer) =
|
||||
pezkuwi_node_subsystem_test_helpers::make_subsystem_context(pool.clone());
|
||||
|
||||
let keystore = Arc::new(sc_keystore::LocalKeystore::in_memory());
|
||||
let keystore = Arc::new(pezsc_keystore::LocalKeystore::in_memory());
|
||||
Keystore::sr25519_generate_new(
|
||||
&*keystore,
|
||||
pezkuwi_primitives::TEYRCHAIN_KEY_TYPE_ID,
|
||||
|
||||
@@ -39,7 +39,7 @@ use pezkuwi_node_subsystem_util::{
|
||||
runtime::recv_runtime, signing_key_and_index,
|
||||
};
|
||||
use pezkuwi_primitives::{Hash, Id as ParaId};
|
||||
use sp_keystore::KeystorePtr;
|
||||
use pezsp_keystore::KeystorePtr;
|
||||
use state::State;
|
||||
|
||||
pub use metrics::Metrics;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// along with Pezkuwi. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use crate::validator_side_experimental::{peer_manager::Backend, Metrics, PeerManager};
|
||||
use sp_keystore::KeystorePtr;
|
||||
use pezsp_keystore::KeystorePtr;
|
||||
|
||||
/// All state relevant for the validator side of the protocol lives here.
|
||||
pub struct State<B> {
|
||||
|
||||
@@ -23,9 +23,9 @@ pezkuwi-node-primitives = { workspace = true, default-features = true }
|
||||
pezkuwi-node-subsystem = { workspace = true, default-features = true }
|
||||
pezkuwi-node-subsystem-util = { workspace = true, default-features = true }
|
||||
pezkuwi-primitives = { workspace = true, default-features = true }
|
||||
sc-network = { workspace = true, default-features = true }
|
||||
sp-application-crypto = { workspace = true, default-features = true }
|
||||
sp-keystore = { workspace = true, default-features = true }
|
||||
pezsc-network = { workspace = true, default-features = true }
|
||||
pezsp-application-crypto = { workspace = true, default-features = true }
|
||||
pezsp-keystore = { workspace = true, default-features = true }
|
||||
thiserror = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
@@ -34,9 +34,9 @@ async-channel = { workspace = true }
|
||||
async-trait = { workspace = true }
|
||||
pezkuwi-node-subsystem-test-helpers = { workspace = true }
|
||||
pezkuwi-primitives-test-helpers = { workspace = true }
|
||||
sc-keystore = { workspace = true, default-features = true }
|
||||
sp-keyring = { workspace = true, default-features = true }
|
||||
sp-tracing = { workspace = true, default-features = true }
|
||||
pezsc-keystore = { workspace = true, default-features = true }
|
||||
pezsp-keyring = { workspace = true, default-features = true }
|
||||
pezsp-tracing = { workspace = true, default-features = true }
|
||||
|
||||
[features]
|
||||
runtime-benchmarks = [
|
||||
@@ -48,6 +48,6 @@ runtime-benchmarks = [
|
||||
"pezkuwi-node-subsystem/runtime-benchmarks",
|
||||
"pezkuwi-primitives-test-helpers/runtime-benchmarks",
|
||||
"pezkuwi-primitives/runtime-benchmarks",
|
||||
"sc-network/runtime-benchmarks",
|
||||
"sp-keyring/runtime-benchmarks",
|
||||
"pezsc-network/runtime-benchmarks",
|
||||
"pezsp-keyring/runtime-benchmarks",
|
||||
]
|
||||
|
||||
@@ -30,7 +30,7 @@ use futures::{channel::mpsc, FutureExt, StreamExt, TryFutureExt};
|
||||
|
||||
use pezkuwi_node_network_protocol::authority_discovery::AuthorityDiscovery;
|
||||
use pezkuwi_node_subsystem_util::nesting_sender::NestingSender;
|
||||
use sp_keystore::KeystorePtr;
|
||||
use pezsp_keystore::KeystorePtr;
|
||||
|
||||
use pezkuwi_node_network_protocol::request_response::{incoming::IncomingRequestReceiver, v1};
|
||||
use pezkuwi_node_primitives::DISPUTE_WINDOW;
|
||||
|
||||
@@ -132,7 +132,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn wait_ready_waits_for_earliest_event_always() {
|
||||
sp_tracing::try_init_simple();
|
||||
pezsp_tracing::try_init_simple();
|
||||
let mut queue = WaitingQueue::new();
|
||||
let now = Instant::now();
|
||||
let start = now;
|
||||
|
||||
@@ -26,10 +26,10 @@ use std::{
|
||||
use async_trait::async_trait;
|
||||
|
||||
use pezkuwi_node_network_protocol::{authority_discovery::AuthorityDiscovery, PeerId};
|
||||
use sc_keystore::LocalKeystore;
|
||||
use sp_application_crypto::AppCrypto;
|
||||
use sp_keyring::Sr25519Keyring;
|
||||
use sp_keystore::{Keystore, KeystorePtr};
|
||||
use pezsc_keystore::LocalKeystore;
|
||||
use pezsp_application_crypto::AppCrypto;
|
||||
use pezsp_keyring::Sr25519Keyring;
|
||||
use pezsp_keystore::{Keystore, KeystorePtr};
|
||||
|
||||
use pezkuwi_node_primitives::{DisputeMessage, SignedDisputeStatement};
|
||||
use pezkuwi_primitives::{
|
||||
@@ -203,7 +203,7 @@ impl AuthorityDiscovery for MockAuthorityDiscovery {
|
||||
async fn get_addresses_by_authority_id(
|
||||
&mut self,
|
||||
_authority: pezkuwi_primitives::AuthorityDiscoveryId,
|
||||
) -> Option<HashSet<sc_network::Multiaddr>> {
|
||||
) -> Option<HashSet<pezsc_network::Multiaddr>> {
|
||||
panic!("Not implemented");
|
||||
}
|
||||
|
||||
|
||||
@@ -32,13 +32,13 @@ use futures::{
|
||||
};
|
||||
use futures_timer::Delay;
|
||||
|
||||
use sc_network::{config::RequestResponseConfig, ProtocolName};
|
||||
use pezsc_network::{config::RequestResponseConfig, ProtocolName};
|
||||
|
||||
use pezkuwi_node_network_protocol::{
|
||||
request_response::{v1::DisputeRequest, IncomingRequest, ReqProtocolNames},
|
||||
PeerId,
|
||||
};
|
||||
use sp_keyring::Sr25519Keyring;
|
||||
use pezsp_keyring::Sr25519Keyring;
|
||||
|
||||
use pezkuwi_node_network_protocol::{
|
||||
request_response::{v1::DisputeResponse, Recipient, Requests},
|
||||
@@ -90,7 +90,7 @@ fn send_dispute_sends_dispute() {
|
||||
|
||||
#[test]
|
||||
fn send_honors_rate_limit() {
|
||||
sp_tracing::try_init_simple();
|
||||
pezsp_tracing::try_init_simple();
|
||||
let test = |mut handle: TestSubsystemContextHandle<DisputeDistributionMessage>, _req_cfg| async move {
|
||||
let _ = handle_subsystem_startup(&mut handle, None).await;
|
||||
|
||||
@@ -180,7 +180,7 @@ fn received_non_authorities_are_dropped() {
|
||||
assert_matches!(
|
||||
rx_response.await,
|
||||
Ok(resp) => {
|
||||
let sc_network::config::OutgoingResponse {
|
||||
let pezsc_network::config::OutgoingResponse {
|
||||
result: _,
|
||||
reputation_changes,
|
||||
sent_feedback: _,
|
||||
@@ -276,7 +276,7 @@ fn batching_works() {
|
||||
assert_matches!(
|
||||
rx_response.await,
|
||||
Ok(resp) => {
|
||||
let sc_network::config::OutgoingResponse {
|
||||
let pezsc_network::config::OutgoingResponse {
|
||||
result,
|
||||
reputation_changes,
|
||||
sent_feedback: _,
|
||||
@@ -318,7 +318,7 @@ fn batching_works() {
|
||||
assert_matches!(
|
||||
rx_response.await,
|
||||
Ok(resp) => {
|
||||
let sc_network::config::OutgoingResponse {
|
||||
let pezsc_network::config::OutgoingResponse {
|
||||
result,
|
||||
reputation_changes: _,
|
||||
sent_feedback,
|
||||
@@ -389,7 +389,7 @@ fn receive_rate_limit_is_enforced() {
|
||||
assert_matches!(
|
||||
rx_response_flood.await,
|
||||
Ok(resp) => {
|
||||
let sc_network::config::OutgoingResponse {
|
||||
let pezsc_network::config::OutgoingResponse {
|
||||
result,
|
||||
reputation_changes: _,
|
||||
sent_feedback: _,
|
||||
@@ -426,7 +426,7 @@ fn receive_rate_limit_is_enforced() {
|
||||
assert_matches!(
|
||||
rx_response.await,
|
||||
Ok(resp) => {
|
||||
let sc_network::config::OutgoingResponse {
|
||||
let pezsc_network::config::OutgoingResponse {
|
||||
result,
|
||||
reputation_changes: _,
|
||||
sent_feedback,
|
||||
@@ -505,7 +505,7 @@ fn send_dispute_gets_cleaned_up() {
|
||||
|
||||
#[test]
|
||||
fn dispute_retries_and_works_across_session_boundaries() {
|
||||
sp_tracing::try_init_simple();
|
||||
pezsp_tracing::try_init_simple();
|
||||
let test = |mut handle: TestSubsystemContextHandle<DisputeDistributionMessage>, _| async move {
|
||||
let old_head = handle_subsystem_startup(&mut handle, None).await;
|
||||
|
||||
@@ -586,13 +586,13 @@ fn dispute_retries_and_works_across_session_boundaries() {
|
||||
}
|
||||
|
||||
async fn send_network_dispute_request(
|
||||
req_tx: &mut async_channel::Sender<sc_network::config::IncomingRequest>,
|
||||
req_tx: &mut async_channel::Sender<pezsc_network::config::IncomingRequest>,
|
||||
peer: PeerId,
|
||||
message: DisputeRequest,
|
||||
) -> oneshot::Receiver<sc_network::config::OutgoingResponse> {
|
||||
) -> oneshot::Receiver<pezsc_network::config::OutgoingResponse> {
|
||||
let (pending_response, rx_response) = oneshot::channel();
|
||||
let req =
|
||||
sc_network::config::IncomingRequest { peer, payload: message.encode(), pending_response };
|
||||
pezsc_network::config::IncomingRequest { peer, payload: message.encode(), pending_response };
|
||||
req_tx.send(req).await.unwrap();
|
||||
rx_response
|
||||
}
|
||||
@@ -602,7 +602,7 @@ async fn send_network_dispute_request(
|
||||
/// Passed in function will be called while votes are still being imported.
|
||||
async fn nested_network_dispute_request<'a, F, O>(
|
||||
handle: &'a mut TestSubsystemContextHandle<DisputeDistributionMessage>,
|
||||
req_tx: &'a mut async_channel::Sender<sc_network::config::IncomingRequest>,
|
||||
req_tx: &'a mut async_channel::Sender<pezsc_network::config::IncomingRequest>,
|
||||
peer: PeerId,
|
||||
message: DisputeRequest,
|
||||
import_result: ImportStatementsResult,
|
||||
@@ -611,7 +611,7 @@ async fn nested_network_dispute_request<'a, F, O>(
|
||||
) where
|
||||
F: FnOnce(
|
||||
&'a mut TestSubsystemContextHandle<DisputeDistributionMessage>,
|
||||
&'a mut async_channel::Sender<sc_network::config::IncomingRequest>,
|
||||
&'a mut async_channel::Sender<pezsc_network::config::IncomingRequest>,
|
||||
DisputeRequest,
|
||||
) -> O
|
||||
+ 'a,
|
||||
@@ -681,7 +681,7 @@ async fn nested_network_dispute_request<'a, F, O>(
|
||||
assert_matches!(
|
||||
rx_response.await,
|
||||
Ok(resp) => {
|
||||
let sc_network::config::OutgoingResponse {
|
||||
let pezsc_network::config::OutgoingResponse {
|
||||
result,
|
||||
reputation_changes,
|
||||
sent_feedback,
|
||||
@@ -869,14 +869,14 @@ where
|
||||
) -> Fut,
|
||||
Fut: Future<Output = ()>,
|
||||
{
|
||||
sp_tracing::try_init_simple();
|
||||
pezsp_tracing::try_init_simple();
|
||||
let keystore = make_ferdie_keystore();
|
||||
|
||||
let genesis_hash = Hash::repeat_byte(0xff);
|
||||
let req_protocol_names = ReqProtocolNames::new(&genesis_hash, None);
|
||||
let (req_receiver, req_cfg) = IncomingRequest::get_config_receiver::<
|
||||
Block,
|
||||
sc_network::NetworkWorker<Block, Hash>,
|
||||
pezsc_network::NetworkWorker<Block, Hash>,
|
||||
>(&req_protocol_names);
|
||||
let subsystem = DisputeDistributionSubsystem::new(
|
||||
keystore,
|
||||
|
||||
@@ -12,11 +12,11 @@ repository.workspace = true
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
sc-network = { workspace = true, default-features = true }
|
||||
sp-application-crypto = { workspace = true, default-features = true }
|
||||
sp-core = { workspace = true, default-features = true }
|
||||
sp-crypto-hashing = { workspace = true, default-features = true }
|
||||
sp-keystore = { workspace = true, default-features = true }
|
||||
pezsc-network = { workspace = true, default-features = true }
|
||||
pezsp-application-crypto = { workspace = true, default-features = true }
|
||||
pezsp-core = { workspace = true, default-features = true }
|
||||
pezsp-crypto-hashing = { workspace = true, default-features = true }
|
||||
pezsp-keystore = { workspace = true, default-features = true }
|
||||
|
||||
pezkuwi-node-network-protocol = { workspace = true, default-features = true }
|
||||
pezkuwi-node-subsystem = { workspace = true, default-features = true }
|
||||
@@ -30,10 +30,10 @@ rand = { workspace = true }
|
||||
rand_chacha = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
sp-authority-discovery = { workspace = true, default-features = true }
|
||||
sp-consensus-babe = { workspace = true, default-features = true }
|
||||
sp-keyring = { workspace = true, default-features = true }
|
||||
sp-tracing = { workspace = true, default-features = true }
|
||||
pezsp-authority-discovery = { workspace = true, default-features = true }
|
||||
pezsp-consensus-babe = { workspace = true, default-features = true }
|
||||
pezsp-keyring = { workspace = true, default-features = true }
|
||||
pezsp-tracing = { workspace = true, default-features = true }
|
||||
|
||||
pezkuwi-node-subsystem-test-helpers = { workspace = true }
|
||||
|
||||
@@ -50,8 +50,8 @@ runtime-benchmarks = [
|
||||
"pezkuwi-node-subsystem-util/runtime-benchmarks",
|
||||
"pezkuwi-node-subsystem/runtime-benchmarks",
|
||||
"pezkuwi-primitives/runtime-benchmarks",
|
||||
"sc-network/runtime-benchmarks",
|
||||
"sp-authority-discovery/runtime-benchmarks",
|
||||
"sp-consensus-babe/runtime-benchmarks",
|
||||
"sp-keyring/runtime-benchmarks",
|
||||
"pezsc-network/runtime-benchmarks",
|
||||
"pezsp-authority-discovery/runtime-benchmarks",
|
||||
"pezsp-consensus-babe/runtime-benchmarks",
|
||||
"pezsp-keyring/runtime-benchmarks",
|
||||
]
|
||||
|
||||
@@ -36,9 +36,9 @@ use futures_timer::Delay;
|
||||
use rand::{Rng, SeedableRng};
|
||||
use rand_chacha::ChaCha20Rng;
|
||||
|
||||
use sc_network::{config::parse_addr, Multiaddr};
|
||||
use sp_application_crypto::{AppCrypto, ByteArray};
|
||||
use sp_keystore::{Keystore, KeystorePtr};
|
||||
use pezsc_network::{config::parse_addr, Multiaddr};
|
||||
use pezsp_application_crypto::{AppCrypto, ByteArray};
|
||||
use pezsp_keystore::{Keystore, KeystorePtr};
|
||||
|
||||
use pezkuwi_node_network_protocol::{
|
||||
authority_discovery::AuthorityDiscovery, peer_set::PeerSet, GossipSupportNetworkMessage,
|
||||
@@ -86,7 +86,7 @@ const TRY_RERESOLVE_AUTHORITIES: Duration = Duration::from_secs(2);
|
||||
/// populated). Authority discovery on Kusama takes around 8 minutes, so warning after 10 minutes
|
||||
/// should be fine:
|
||||
///
|
||||
/// https://github.com/paritytech/substrate/blob/fc49802f263529160635471c8a17888846035f5d/client/authority-discovery/src/lib.rs#L88
|
||||
/// https://github.com/paritytech/bizinikiwi/blob/fc49802f263529160635471c8a17888846035f5d/client/authority-discovery/src/lib.rs#L88
|
||||
const LOW_CONNECTIVITY_WARN_DELAY: Duration = Duration::from_secs(600);
|
||||
|
||||
/// If connectivity is lower than this in percent, issue warning in logs.
|
||||
@@ -796,7 +796,7 @@ async fn update_gossip_topology(
|
||||
let random_seed = {
|
||||
let (tx, rx) = oneshot::channel();
|
||||
|
||||
// TODO https://github.com/paritytech/polkadot/issues/5316:
|
||||
// TODO https://github.com/pezkuwichain/kurdistan-sdk/issues/156:
|
||||
// get the random seed from the `SessionInfo` instead.
|
||||
sender
|
||||
.send_message(RuntimeApiMessage::Request(
|
||||
@@ -809,7 +809,7 @@ async fn update_gossip_topology(
|
||||
let mut subject = [0u8; 40];
|
||||
subject[..8].copy_from_slice(b"gossipsu");
|
||||
subject[8..].copy_from_slice(&randomness);
|
||||
sp_crypto_hashing::blake2_256(&subject)
|
||||
pezsp_crypto_hashing::blake2_256(&subject)
|
||||
};
|
||||
|
||||
// shuffle the validators and create the index mapping
|
||||
|
||||
@@ -25,11 +25,11 @@ use quickcheck::quickcheck;
|
||||
use rand::seq::SliceRandom as _;
|
||||
|
||||
use parking_lot::Mutex;
|
||||
use sc_network::multiaddr::Protocol;
|
||||
use sp_authority_discovery::AuthorityPair as AuthorityDiscoveryPair;
|
||||
use sp_consensus_babe::{AllowedSlots, BabeEpochConfiguration, Epoch as BabeEpoch};
|
||||
use sp_core::crypto::Pair as PairT;
|
||||
use sp_keyring::Sr25519Keyring;
|
||||
use pezsc_network::multiaddr::Protocol;
|
||||
use pezsp_authority_discovery::AuthorityPair as AuthorityDiscoveryPair;
|
||||
use pezsp_consensus_babe::{AllowedSlots, BabeEpochConfiguration, Epoch as BabeEpoch};
|
||||
use pezsp_core::crypto::Pair as PairT;
|
||||
use pezsp_keyring::Sr25519Keyring;
|
||||
use std::sync::Arc;
|
||||
|
||||
use pezkuwi_node_network_protocol::{
|
||||
@@ -147,7 +147,7 @@ impl AuthorityDiscovery for MockAuthorityDiscovery {
|
||||
async fn get_addresses_by_authority_id(
|
||||
&mut self,
|
||||
authority: pezkuwi_primitives::AuthorityDiscoveryId,
|
||||
) -> Option<HashSet<sc_network::Multiaddr>> {
|
||||
) -> Option<HashSet<pezsc_network::Multiaddr>> {
|
||||
self.addrs.lock().get(&authority).cloned()
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ fn test_harness<T: Future<Output = VirtualOverseer>, AD: AuthorityDiscovery>(
|
||||
subsystem: GossipSupport<AD>,
|
||||
test_fn: impl FnOnce(VirtualOverseer) -> T,
|
||||
) -> GossipSupport<AD> {
|
||||
let pool = sp_core::testing::TaskExecutor::new();
|
||||
let pool = pezsp_core::testing::TaskExecutor::new();
|
||||
let (context, virtual_overseer) =
|
||||
pezkuwi_node_subsystem_test_helpers::make_subsystem_context(pool.clone());
|
||||
|
||||
@@ -1151,7 +1151,7 @@ fn test_quickly_connect_to_authorities_that_changed_address() {
|
||||
|
||||
#[test]
|
||||
fn disconnect_when_not_in_past_present_future() {
|
||||
sp_tracing::try_init_simple();
|
||||
pezsp_tracing::try_init_simple();
|
||||
let mock_authority_discovery =
|
||||
MockAuthorityDiscovery::new(PAST_PRESENT_FUTURE_AUTHORITIES.clone());
|
||||
let hash = Hash::repeat_byte(0xAA);
|
||||
@@ -1215,7 +1215,7 @@ fn disconnect_when_not_in_past_present_future() {
|
||||
|
||||
#[test]
|
||||
fn test_log_output() {
|
||||
sp_tracing::try_init_simple();
|
||||
pezsp_tracing::try_init_simple();
|
||||
let alice: AuthorityDiscoveryId = Sr25519Keyring::Alice.public().into();
|
||||
let bob = Sr25519Keyring::Bob.public().into();
|
||||
let unconnected_authorities = {
|
||||
|
||||
@@ -24,10 +24,10 @@ hex = { workspace = true, default-features = true }
|
||||
pezkuwi-node-primitives = { workspace = true, default-features = true }
|
||||
pezkuwi-primitives = { workspace = true, default-features = true }
|
||||
rand = { workspace = true, default-features = true }
|
||||
sc-authority-discovery = { workspace = true, default-features = true }
|
||||
sc-network = { workspace = true, default-features = true }
|
||||
sc-network-types = { workspace = true, default-features = true }
|
||||
sp-runtime = { workspace = true, default-features = true }
|
||||
pezsc-authority-discovery = { workspace = true, default-features = true }
|
||||
pezsc-network = { workspace = true, default-features = true }
|
||||
pezsc-network-types = { workspace = true, default-features = true }
|
||||
pezsp-runtime = { workspace = true, default-features = true }
|
||||
strum = { features = ["derive"], workspace = true, default-features = true }
|
||||
thiserror = { workspace = true }
|
||||
|
||||
@@ -39,7 +39,7 @@ runtime-benchmarks = [
|
||||
"gum/runtime-benchmarks",
|
||||
"pezkuwi-node-primitives/runtime-benchmarks",
|
||||
"pezkuwi-primitives/runtime-benchmarks",
|
||||
"sc-authority-discovery/runtime-benchmarks",
|
||||
"sc-network/runtime-benchmarks",
|
||||
"sp-runtime/runtime-benchmarks",
|
||||
"pezsc-authority-discovery/runtime-benchmarks",
|
||||
"pezsc-network/runtime-benchmarks",
|
||||
"pezsp-runtime/runtime-benchmarks",
|
||||
]
|
||||
|
||||
@@ -20,11 +20,11 @@ use std::{collections::HashSet, fmt::Debug};
|
||||
|
||||
use async_trait::async_trait;
|
||||
|
||||
use sc_authority_discovery::Service as AuthorityDiscoveryService;
|
||||
use pezsc_authority_discovery::Service as AuthorityDiscoveryService;
|
||||
|
||||
use pezkuwi_primitives::AuthorityDiscoveryId;
|
||||
use sc_network::Multiaddr;
|
||||
use sc_network_types::PeerId;
|
||||
use pezsc_network::Multiaddr;
|
||||
use pezsc_network_types::PeerId;
|
||||
|
||||
/// An abstraction over the authority discovery service.
|
||||
///
|
||||
|
||||
@@ -24,8 +24,8 @@ use pezkuwi_primitives::{BlockNumber, Hash};
|
||||
use std::fmt;
|
||||
|
||||
#[doc(hidden)]
|
||||
pub use sc_network::IfDisconnected;
|
||||
pub use sc_network_types::PeerId;
|
||||
pub use pezsc_network::IfDisconnected;
|
||||
pub use pezsc_network_types::PeerId;
|
||||
#[doc(hidden)]
|
||||
pub use std::sync::Arc;
|
||||
|
||||
@@ -69,22 +69,22 @@ pub enum ObservedRole {
|
||||
Authority,
|
||||
}
|
||||
|
||||
impl From<sc_network::ObservedRole> for ObservedRole {
|
||||
fn from(role: sc_network::ObservedRole) -> ObservedRole {
|
||||
impl From<pezsc_network::ObservedRole> for ObservedRole {
|
||||
fn from(role: pezsc_network::ObservedRole) -> ObservedRole {
|
||||
match role {
|
||||
sc_network::ObservedRole::Light => ObservedRole::Light,
|
||||
sc_network::ObservedRole::Authority => ObservedRole::Authority,
|
||||
sc_network::ObservedRole::Full => ObservedRole::Full,
|
||||
pezsc_network::ObservedRole::Light => ObservedRole::Light,
|
||||
pezsc_network::ObservedRole::Authority => ObservedRole::Authority,
|
||||
pezsc_network::ObservedRole::Full => ObservedRole::Full,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Into<sc_network::ObservedRole> for ObservedRole {
|
||||
fn into(self) -> sc_network::ObservedRole {
|
||||
impl Into<pezsc_network::ObservedRole> for ObservedRole {
|
||||
fn into(self) -> pezsc_network::ObservedRole {
|
||||
match self {
|
||||
ObservedRole::Light => sc_network::ObservedRole::Light,
|
||||
ObservedRole::Full => sc_network::ObservedRole::Full,
|
||||
ObservedRole::Authority => sc_network::ObservedRole::Authority,
|
||||
ObservedRole::Light => pezsc_network::ObservedRole::Light,
|
||||
ObservedRole::Full => pezsc_network::ObservedRole::Full,
|
||||
ObservedRole::Authority => pezsc_network::ObservedRole::Authority,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -502,7 +502,7 @@ pub mod v1 {
|
||||
///
|
||||
/// The payload is the local peer id of the node, which serves to prove that it
|
||||
/// controls the collator key it is declaring an intention to collate under.
|
||||
pub fn declare_signature_payload(peer_id: &sc_network_types::PeerId) -> Vec<u8> {
|
||||
pub fn declare_signature_payload(peer_id: &pezsc_network_types::PeerId) -> Vec<u8> {
|
||||
let mut payload = peer_id.to_bytes();
|
||||
payload.extend_from_slice(b"COLL");
|
||||
payload
|
||||
|
||||
@@ -18,11 +18,11 @@
|
||||
|
||||
use derive_more::Display;
|
||||
use pezkuwi_primitives::Hash;
|
||||
use sc_network::{
|
||||
use pezsc_network::{
|
||||
config::SetConfig, peer_store::PeerStoreProvider, service::NotificationMetrics,
|
||||
types::ProtocolName, NetworkBackend, NotificationService,
|
||||
};
|
||||
use sp_runtime::traits::Block;
|
||||
use pezsp_runtime::traits::Block;
|
||||
use std::{
|
||||
collections::{hash_map::Entry, HashMap},
|
||||
ops::{Index, IndexMut},
|
||||
@@ -64,7 +64,7 @@ pub enum IsAuthority {
|
||||
}
|
||||
|
||||
impl PeerSet {
|
||||
/// Get `sc_network` peer set configurations for each peerset on the default version.
|
||||
/// Get `pezsc_network` peer set configurations for each peerset on the default version.
|
||||
///
|
||||
/// Those should be used in the network configuration to register the protocols with the
|
||||
/// network service.
|
||||
@@ -100,7 +100,7 @@ impl PeerSet {
|
||||
in_peers: super::MIN_GOSSIP_PEERS as u32 / 2 - 1,
|
||||
out_peers: super::MIN_GOSSIP_PEERS as u32 / 2 - 1,
|
||||
reserved_nodes: Vec::new(),
|
||||
non_reserved_mode: sc_network::config::NonReservedPeerMode::Accept,
|
||||
non_reserved_mode: pezsc_network::config::NonReservedPeerMode::Accept,
|
||||
},
|
||||
metrics,
|
||||
peer_store_handle,
|
||||
@@ -125,9 +125,9 @@ impl PeerSet {
|
||||
out_peers: 0,
|
||||
reserved_nodes: Vec::new(),
|
||||
non_reserved_mode: if is_authority == IsAuthority::Yes {
|
||||
sc_network::config::NonReservedPeerMode::Accept
|
||||
pezsc_network::config::NonReservedPeerMode::Accept
|
||||
} else {
|
||||
sc_network::config::NonReservedPeerMode::Deny
|
||||
pezsc_network::config::NonReservedPeerMode::Deny
|
||||
},
|
||||
},
|
||||
metrics,
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Pezkuwi. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
pub use sc_network::ReputationChange;
|
||||
pub use pezsc_network::ReputationChange;
|
||||
|
||||
/// Unified annoyance cost and good behavior benefits.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
//! Error handling related code and Error/Result definitions.
|
||||
|
||||
use sc_network_types::PeerId;
|
||||
use pezsc_network_types::PeerId;
|
||||
|
||||
use codec::Error as DecodingError;
|
||||
|
||||
|
||||
@@ -20,9 +20,9 @@ use futures::{channel::oneshot, StreamExt};
|
||||
|
||||
use codec::{Decode, Encode};
|
||||
|
||||
use sc_network::{config as netconfig, NetworkBackend};
|
||||
use sc_network_types::PeerId;
|
||||
use sp_runtime::traits::Block;
|
||||
use pezsc_network::{config as netconfig, NetworkBackend};
|
||||
use pezsc_network_types::PeerId;
|
||||
use pezsp_runtime::traits::Block;
|
||||
|
||||
use super::{IsRequest, ReqProtocolNames};
|
||||
use crate::UnifiedReputationChange;
|
||||
@@ -32,7 +32,7 @@ pub use error::{Error, FatalError, JfyiError, Result};
|
||||
|
||||
/// A request coming in, including a sender for sending responses.
|
||||
///
|
||||
/// Typed `IncomingRequest`s, see `IncomingRequest::get_config_receiver` and substrate
|
||||
/// Typed `IncomingRequest`s, see `IncomingRequest::get_config_receiver` and bizinikiwi
|
||||
/// `NetworkConfiguration` for more information.
|
||||
#[derive(Debug)]
|
||||
pub struct IncomingRequest<Req> {
|
||||
@@ -52,7 +52,7 @@ where
|
||||
/// Create configuration for `NetworkConfiguration::request_response_protocols` and a
|
||||
/// corresponding typed receiver.
|
||||
///
|
||||
/// This Register that config with substrate networking and receive incoming requests via the
|
||||
/// This Register that config with bizinikiwi networking and receive incoming requests via the
|
||||
/// returned `IncomingRequestReceiver`.
|
||||
pub fn get_config_receiver<B: Block, N: NetworkBackend<B, <B as Block>::Hash>>(
|
||||
req_protocol_names: &ReqProtocolNames,
|
||||
@@ -74,7 +74,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
/// Try building from raw substrate request.
|
||||
/// Try building from raw bizinikiwi request.
|
||||
///
|
||||
/// This function will fail if the request cannot be decoded and will apply passed in
|
||||
/// reputation changes in that case.
|
||||
@@ -83,15 +83,15 @@ where
|
||||
/// - The raw request to decode
|
||||
/// - Reputation changes to apply for the peer in case decoding fails.
|
||||
fn try_from_raw(
|
||||
raw: sc_network::config::IncomingRequest,
|
||||
raw: pezsc_network::config::IncomingRequest,
|
||||
reputation_changes: Vec<UnifiedReputationChange>,
|
||||
) -> std::result::Result<Self, JfyiError> {
|
||||
let sc_network::config::IncomingRequest { payload, peer, pending_response } = raw;
|
||||
let pezsc_network::config::IncomingRequest { payload, peer, pending_response } = raw;
|
||||
let payload = match Req::decode(&mut payload.as_ref()) {
|
||||
Ok(payload) => payload,
|
||||
Err(err) => {
|
||||
let reputation_changes = reputation_changes.into_iter().map(|r| r.into()).collect();
|
||||
let response = sc_network::config::OutgoingResponse {
|
||||
let response = pezsc_network::config::OutgoingResponse {
|
||||
result: Err(()),
|
||||
reputation_changes,
|
||||
sent_feedback: None,
|
||||
@@ -106,11 +106,11 @@ where
|
||||
Ok(Self::new(peer, payload, pending_response))
|
||||
}
|
||||
|
||||
/// Convert into raw untyped substrate `IncomingRequest`.
|
||||
/// Convert into raw untyped bizinikiwi `IncomingRequest`.
|
||||
///
|
||||
/// This is mostly useful for testing.
|
||||
pub fn into_raw(self) -> sc_network::config::IncomingRequest {
|
||||
sc_network::config::IncomingRequest {
|
||||
pub fn into_raw(self) -> pezsc_network::config::IncomingRequest {
|
||||
pezsc_network::config::IncomingRequest {
|
||||
peer: self.peer,
|
||||
payload: self.payload.encode(),
|
||||
pending_response: self.pending_response.pending_response,
|
||||
|
||||
@@ -52,11 +52,11 @@
|
||||
use std::{collections::HashMap, time::Duration, u64};
|
||||
|
||||
use pezkuwi_primitives::MAX_CODE_SIZE;
|
||||
use sc_network::{NetworkBackend, MAX_RESPONSE_SIZE};
|
||||
use sp_runtime::traits::Block;
|
||||
use pezsc_network::{NetworkBackend, MAX_RESPONSE_SIZE};
|
||||
use pezsp_runtime::traits::Block;
|
||||
use strum::{EnumIter, IntoEnumIterator};
|
||||
|
||||
pub use sc_network::{config as network, config::RequestResponseConfig, ProtocolName};
|
||||
pub use pezsc_network::{config as network, config::RequestResponseConfig, ProtocolName};
|
||||
|
||||
/// Everything related to handling of incoming requests.
|
||||
pub mod incoming;
|
||||
@@ -137,7 +137,7 @@ const POV_REQUEST_TIMEOUT_CONNECTED: Duration = Duration::from_millis(2000);
|
||||
/// We supply leniency because there are often large candidates and asynchronous
|
||||
/// backing allows them to be included over a longer window of time. Exponential back-off
|
||||
/// up to a maximum of 10 seconds would be ideal, but isn't supported by the
|
||||
/// infrastructure here yet: see https://github.com/paritytech/polkadot/issues/6009
|
||||
/// infrastructure here yet: see https://github.com/pezkuwichain/kurdistan-sdk/issues/164
|
||||
const ATTESTED_CANDIDATE_TIMEOUT: Duration = Duration::from_millis(2500);
|
||||
|
||||
/// We don't want a slow peer to slow down all the others, at the same time we want to get out the
|
||||
@@ -148,7 +148,7 @@ pub const MAX_PARALLEL_ATTESTED_CANDIDATE_REQUESTS: u32 = 5;
|
||||
|
||||
/// Response size limit for responses of POV like data.
|
||||
///
|
||||
/// Same as what we use in substrate networking.
|
||||
/// Same as what we use in bizinikiwi networking.
|
||||
const POV_RESPONSE_SIZE: u64 = MAX_RESPONSE_SIZE;
|
||||
|
||||
/// Maximum response sizes for `AttestedCandidateV2`.
|
||||
|
||||
@@ -19,8 +19,8 @@ use futures::{channel::oneshot, prelude::Future, FutureExt};
|
||||
use codec::{Decode, Encode, Error as DecodingError};
|
||||
use network::ProtocolName;
|
||||
|
||||
use sc_network as network;
|
||||
use sc_network_types::PeerId;
|
||||
use pezsc_network as network;
|
||||
use pezsc_network_types::PeerId;
|
||||
|
||||
use pezkuwi_primitives::AuthorityDiscoveryId;
|
||||
|
||||
@@ -78,7 +78,7 @@ pub enum RequestError {
|
||||
#[error("Response could not be decoded: {0}")]
|
||||
InvalidResponse(#[from] DecodingError),
|
||||
|
||||
/// Some error in substrate/libp2p happened.
|
||||
/// Some error in bizinikiwi/libp2p happened.
|
||||
#[error("{0}")]
|
||||
NetworkError(#[from] network::RequestFailure),
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ pezkuwi-node-primitives = { workspace = true, default-features = true }
|
||||
pezkuwi-node-subsystem = { workspace = true, default-features = true }
|
||||
pezkuwi-node-subsystem-util = { workspace = true, default-features = true }
|
||||
pezkuwi-primitives = { workspace = true, default-features = true }
|
||||
sp-keystore = { workspace = true, default-features = true }
|
||||
pezsp-keystore = { workspace = true, default-features = true }
|
||||
thiserror = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
@@ -41,13 +41,13 @@ pezkuwi-primitives-test-helpers = { workspace = true }
|
||||
pezkuwi-subsystem-bench = { workspace = true }
|
||||
rand_chacha = { workspace = true, default-features = true }
|
||||
rstest = { workspace = true }
|
||||
sc-keystore = { workspace = true, default-features = true }
|
||||
sc-network = { workspace = true, default-features = true }
|
||||
sp-application-crypto = { workspace = true, default-features = true }
|
||||
sp-authority-discovery = { workspace = true, default-features = true }
|
||||
sp-core = { workspace = true, default-features = true }
|
||||
sp-keyring = { workspace = true, default-features = true }
|
||||
sp-tracing = { workspace = true, default-features = true }
|
||||
pezsc-keystore = { workspace = true, default-features = true }
|
||||
pezsc-network = { workspace = true, default-features = true }
|
||||
pezsp-application-crypto = { workspace = true, default-features = true }
|
||||
pezsp-authority-discovery = { workspace = true, default-features = true }
|
||||
pezsp-core = { workspace = true, default-features = true }
|
||||
pezsp-keyring = { workspace = true, default-features = true }
|
||||
pezsp-tracing = { workspace = true, default-features = true }
|
||||
|
||||
[features]
|
||||
subsystem-benchmarks = []
|
||||
@@ -61,7 +61,7 @@ runtime-benchmarks = [
|
||||
"pezkuwi-primitives-test-helpers/runtime-benchmarks",
|
||||
"pezkuwi-primitives/runtime-benchmarks",
|
||||
"pezkuwi-subsystem-bench/runtime-benchmarks",
|
||||
"sc-network/runtime-benchmarks",
|
||||
"sp-authority-discovery/runtime-benchmarks",
|
||||
"sp-keyring/runtime-benchmarks",
|
||||
"pezsc-network/runtime-benchmarks",
|
||||
"pezsp-authority-discovery/runtime-benchmarks",
|
||||
"pezsp-keyring/runtime-benchmarks",
|
||||
]
|
||||
|
||||
@@ -34,7 +34,7 @@ use pezkuwi_node_subsystem::{
|
||||
use pezkuwi_node_subsystem_util::reputation::{ReputationAggregator, REPUTATION_CHANGE_INTERVAL};
|
||||
|
||||
use futures::{channel::mpsc, prelude::*};
|
||||
use sp_keystore::KeystorePtr;
|
||||
use pezsp_keystore::KeystorePtr;
|
||||
|
||||
use fatality::Nested;
|
||||
|
||||
|
||||
@@ -1096,8 +1096,8 @@ mod tests {
|
||||
use super::*;
|
||||
use assert_matches::assert_matches;
|
||||
use pezkuwi_node_network_protocol::grid_topology::TopologyPeerInfo;
|
||||
use sp_authority_discovery::AuthorityPair as AuthorityDiscoveryPair;
|
||||
use sp_core::crypto::Pair as PairT;
|
||||
use pezsp_authority_discovery::AuthorityPair as AuthorityDiscoveryPair;
|
||||
use pezsp_core::crypto::Pair as PairT;
|
||||
|
||||
fn dummy_groups(group_size: usize) -> Groups {
|
||||
let groups = vec![(0..(group_size as u32)).map(ValidatorIndex).collect()].into();
|
||||
|
||||
@@ -53,7 +53,7 @@ use pezkuwi_primitives::{
|
||||
SigningContext, TransposedClaimQueue, UncheckedSignedStatement, ValidatorId, ValidatorIndex,
|
||||
};
|
||||
|
||||
use sp_keystore::KeystorePtr;
|
||||
use pezsp_keystore::KeystorePtr;
|
||||
|
||||
use fatality::Nested;
|
||||
use futures::{
|
||||
@@ -483,7 +483,7 @@ pub(crate) async fn handle_network_update<Context>(
|
||||
state.unused_topologies.insert(*new_session_index, topology);
|
||||
}
|
||||
|
||||
// TODO [https://github.com/paritytech/polkadot/issues/6194]
|
||||
// TODO [https://github.com/pezkuwichain/kurdistan-sdk/issues/165]
|
||||
// technically, we should account for the fact that the session topology might
|
||||
// come late, and for all relay-parents with this session, send all grid peers
|
||||
// any `BackedCandidateInv` messages they might need.
|
||||
|
||||
@@ -293,7 +293,7 @@ mod tests {
|
||||
use super::*;
|
||||
|
||||
use pezkuwi_primitives::{Hash, SigningContext, ValidatorPair};
|
||||
use sp_application_crypto::Pair as PairT;
|
||||
use pezsp_application_crypto::Pair as PairT;
|
||||
|
||||
#[test]
|
||||
fn always_provides_fresh_statements_in_order() {
|
||||
|
||||
@@ -1231,7 +1231,7 @@ fn delayed_reputation_changes() {
|
||||
let req_protocol_names = ReqProtocolNames::new(&GENESIS_HASH, None);
|
||||
let (candidate_req_receiver, req_cfg) = IncomingRequest::get_config_receiver::<
|
||||
Block,
|
||||
sc_network::NetworkWorker<Block, Hash>,
|
||||
pezsc_network::NetworkWorker<Block, Hash>,
|
||||
>(&req_protocol_names);
|
||||
let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0);
|
||||
|
||||
@@ -1240,7 +1240,7 @@ fn delayed_reputation_changes() {
|
||||
// We can't use the test harness as we need to spawn our own subsystem with custom config.
|
||||
let (context, mut virtual_overseer) =
|
||||
pezkuwi_node_subsystem_test_helpers::make_subsystem_context(
|
||||
sp_core::testing::TaskExecutor::new(),
|
||||
pezsp_core::testing::TaskExecutor::new(),
|
||||
);
|
||||
let subsystem = async move {
|
||||
let subsystem = crate::StatementDistributionSubsystem {
|
||||
|
||||
@@ -2040,7 +2040,7 @@ fn elastic_scaling_grid_statements_imported_to_backing() {
|
||||
|
||||
#[test]
|
||||
fn advertisements_rejected_from_incorrect_peers() {
|
||||
sp_tracing::try_init_simple();
|
||||
pezsp_tracing::try_init_simple();
|
||||
let validator_count = 6;
|
||||
let group_size = 3;
|
||||
let config = TestConfig {
|
||||
|
||||
@@ -37,11 +37,11 @@ use pezkuwi_primitives::{
|
||||
GroupRotationInfo, HeadData, Header, IndexedVec, NodeFeatures, PersistedValidationData,
|
||||
SessionIndex, SessionInfo, ValidatorPair, DEFAULT_SCHEDULING_LOOKAHEAD,
|
||||
};
|
||||
use sc_keystore::LocalKeystore;
|
||||
use sc_network::ProtocolName;
|
||||
use sp_application_crypto::Pair as PairT;
|
||||
use sp_authority_discovery::AuthorityPair as AuthorityDiscoveryPair;
|
||||
use sp_keyring::Sr25519Keyring;
|
||||
use pezsc_keystore::LocalKeystore;
|
||||
use pezsc_network::ProtocolName;
|
||||
use pezsp_application_crypto::Pair as PairT;
|
||||
use pezsp_authority_discovery::AuthorityPair as AuthorityDiscoveryPair;
|
||||
use pezsp_keyring::Sr25519Keyring;
|
||||
|
||||
use assert_matches::assert_matches;
|
||||
use codec::Encode;
|
||||
@@ -93,14 +93,14 @@ struct TestState {
|
||||
local: Option<TestLocalValidator>,
|
||||
validators: Vec<ValidatorPair>,
|
||||
session_info: SessionInfo,
|
||||
req_sender: async_channel::Sender<sc_network::config::IncomingRequest>,
|
||||
req_sender: async_channel::Sender<pezsc_network::config::IncomingRequest>,
|
||||
node_features: NodeFeatures,
|
||||
}
|
||||
|
||||
impl TestState {
|
||||
fn from_config(
|
||||
config: TestConfig,
|
||||
req_sender: async_channel::Sender<sc_network::config::IncomingRequest>,
|
||||
req_sender: async_channel::Sender<pezsc_network::config::IncomingRequest>,
|
||||
rng: &mut impl Rng,
|
||||
) -> Self {
|
||||
if config.group_size == 0 {
|
||||
@@ -364,9 +364,9 @@ impl TestState {
|
||||
&mut self,
|
||||
peer: PeerId,
|
||||
request: AttestedCandidateRequest,
|
||||
) -> impl Future<Output = Option<sc_network::config::OutgoingResponse>> {
|
||||
) -> impl Future<Output = Option<pezsc_network::config::OutgoingResponse>> {
|
||||
let (tx, rx) = futures::channel::oneshot::channel();
|
||||
let req = sc_network::config::IncomingRequest {
|
||||
let req = pezsc_network::config::IncomingRequest {
|
||||
peer,
|
||||
payload: request.encode(),
|
||||
pending_response: tx,
|
||||
@@ -381,7 +381,7 @@ fn test_harness<T: Future<Output = VirtualOverseer>>(
|
||||
config: TestConfig,
|
||||
test: impl FnOnce(TestState, VirtualOverseer) -> T,
|
||||
) {
|
||||
let pool = sp_core::testing::TaskExecutor::new();
|
||||
let pool = pezsp_core::testing::TaskExecutor::new();
|
||||
let keystore = if let LocalRole::Validator = config.local_validator {
|
||||
test_helpers::mock::make_ferdie_keystore()
|
||||
} else {
|
||||
@@ -390,7 +390,7 @@ fn test_harness<T: Future<Output = VirtualOverseer>>(
|
||||
let req_protocol_names = ReqProtocolNames::new(&GENESIS_HASH, None);
|
||||
let (candidate_req_receiver, req_cfg) = IncomingRequest::get_config_receiver::<
|
||||
Block,
|
||||
sc_network::NetworkWorker<Block, Hash>,
|
||||
pezsc_network::NetworkWorker<Block, Hash>,
|
||||
>(&req_protocol_names);
|
||||
let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0);
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ use pezkuwi_node_network_protocol::{
|
||||
request_response::v2 as request_v2, v3::BackedCandidateManifest,
|
||||
};
|
||||
use pezkuwi_primitives_test_helpers::{make_candidate, make_candidate_v2};
|
||||
use sc_network::config::{
|
||||
use pezsc_network::config::{
|
||||
IncomingRequest as RawIncomingRequest, OutgoingResponse as RawOutgoingResponse,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user