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:
2025-12-14 00:04:10 +03:00
parent e4778b4576
commit 379cb741ed
9082 changed files with 997824 additions and 997542 deletions
@@ -27,8 +27,8 @@ pezkuwi-node-subsystem-util = { workspace = true, default-features = true }
pezkuwi-overseer = { workspace = true, default-features = true }
pezkuwi-primitives = { workspace = true, default-features = true }
sc-keystore = { workspace = true, default-features = false }
sp-consensus = { workspace = true, default-features = false }
pezsc-keystore = { workspace = true, default-features = false }
pezsp-consensus = { workspace = true, default-features = false }
rand = { workspace = true }
rand_core = { workspace = true }
@@ -38,10 +38,10 @@ assert_matches = { workspace = true }
kvdb-memorydb = { workspace = true }
pezkuwi-node-subsystem-test-helpers = { workspace = true, default-features = true }
schnorrkel = { workspace = true, default-features = true }
sp-consensus-babe = { workspace = true, default-features = true }
sp-core = { workspace = true, default-features = true }
sp-keyring = { workspace = true, default-features = true }
sp-tracing = { workspace = true }
pezsp-consensus-babe = { workspace = true, default-features = true }
pezsp-core = { workspace = true, default-features = true }
pezsp-keyring = { workspace = true, default-features = true }
pezsp-tracing = { workspace = true }
[features]
runtime-benchmarks = [
@@ -56,7 +56,7 @@ runtime-benchmarks = [
"pezkuwi-node-subsystem/runtime-benchmarks",
"pezkuwi-overseer/runtime-benchmarks",
"pezkuwi-primitives/runtime-benchmarks",
"sp-consensus-babe/runtime-benchmarks",
"sp-consensus/runtime-benchmarks",
"sp-keyring/runtime-benchmarks",
"pezsp-consensus-babe/runtime-benchmarks",
"pezsp-consensus/runtime-benchmarks",
"pezsp-keyring/runtime-benchmarks",
]
@@ -45,8 +45,8 @@ use pezkuwi_overseer::{OverseerSignal, Priority, SubsystemSender, TimeoutExt};
use pezkuwi_primitives::{CandidateIndex, Hash, ValidatorIndex, ValidatorSignature};
use rand::SeedableRng;
use sc_keystore::LocalKeystore;
use sp_consensus::SyncOracle;
use pezsc_keystore::LocalKeystore;
use pezsp_consensus::SyncOracle;
use futures::{channel::oneshot, prelude::*, StreamExt};
pub use metrics::Metrics;
@@ -47,11 +47,11 @@ use pezkuwi_node_subsystem::{
use pezkuwi_node_subsystem_test_helpers::{mock::new_leaf, TestSubsystemContext};
use pezkuwi_overseer::{ActiveLeavesUpdate, OverseerSignal, SpawnGlue, TimeoutExt};
use pezkuwi_primitives::{CandidateHash, CoreIndex, Hash, ValidatorIndex};
use sc_keystore::{Keystore, LocalKeystore};
use sp_consensus::SyncOracle;
use sp_consensus_babe::{VrfPreOutput, VrfProof, VrfSignature};
use sp_core::{testing::TaskExecutor, H256};
use sp_keyring::Sr25519Keyring;
use pezsc_keystore::{Keystore, LocalKeystore};
use pezsp_consensus::SyncOracle;
use pezsp_consensus_babe::{VrfPreOutput, VrfProof, VrfSignature};
use pezsp_core::{testing::TaskExecutor, H256};
use pezsp_keyring::Sr25519Keyring;
type VirtualOverseer =
pezkuwi_node_subsystem_test_helpers::TestSubsystemContextHandle<ApprovalVotingParallelMessage>;
@@ -86,7 +86,7 @@ fn fake_assignment_cert_v2(
/// Creates a meaningless signature
pub fn dummy_signature() -> pezkuwi_primitives::ValidatorSignature {
sp_core::crypto::UncheckedFrom::unchecked_from([1u8; 64])
pezsp_core::crypto::UncheckedFrom::unchecked_from([1u8; 64])
}
fn build_subsystem(
@@ -96,9 +96,9 @@ fn build_subsystem(
TestSubsystemContext<ApprovalVotingParallelMessage, SpawnGlue<TaskExecutor>>,
VirtualOverseer,
) {
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::<
ApprovalVotingParallelMessage,
_,
+15 -15
View File
@@ -41,11 +41,11 @@ rand = { workspace = true, default-features = true }
rand_chacha = { workspace = true, default-features = true }
# rand_core should match schnorrkel
rand_core = { workspace = true }
sc-keystore = { workspace = true }
sp-application-crypto = { features = ["full_crypto"], workspace = true }
sp-consensus = { workspace = true }
sp-consensus-slots = { workspace = true }
sp-runtime = { workspace = true }
pezsc-keystore = { workspace = true }
pezsp-application-crypto = { features = ["full_crypto"], workspace = true }
pezsp-consensus = { workspace = true }
pezsp-consensus-slots = { workspace = true }
pezsp-runtime = { workspace = true }
[dev-dependencies]
assert_matches = { workspace = true }
@@ -54,11 +54,11 @@ parking_lot = { workspace = true, default-features = true }
pezkuwi-node-subsystem-test-helpers = { workspace = true }
pezkuwi-primitives = { workspace = true, features = ["test"] }
pezkuwi-primitives-test-helpers = { workspace = true }
sp-consensus-babe = { 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-consensus-babe = { 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 }
pezkuwi-subsystem-bench = { workspace = true }
@@ -74,9 +74,9 @@ runtime-benchmarks = [
"pezkuwi-primitives-test-helpers/runtime-benchmarks",
"pezkuwi-primitives/runtime-benchmarks",
"pezkuwi-subsystem-bench/runtime-benchmarks",
"sp-consensus-babe/runtime-benchmarks",
"sp-consensus-slots/runtime-benchmarks",
"sp-consensus/runtime-benchmarks",
"sp-keyring/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"pezsp-consensus-babe/runtime-benchmarks",
"pezsp-consensus-slots/runtime-benchmarks",
"pezsp-consensus/runtime-benchmarks",
"pezsp-keyring/runtime-benchmarks",
"pezsp-runtime/runtime-benchmarks",
]
@@ -28,7 +28,7 @@
//!
//! As such, we provide a function from this module to clear the database on start-up.
//! In the future, we may use a temporary DB which doesn't need to be wiped, but for the
//! time being we share the same DB with the rest of Substrate.
//! time being we share the same DB with the rest of Bizinikiwi.
pub mod common;
pub mod v1;
@@ -28,7 +28,7 @@ use pezkuwi_primitives::{
BlockNumber, CandidateHash, CandidateReceiptV2 as CandidateReceipt, CoreIndex, GroupIndex,
Hash, SessionIndex, ValidatorIndex, ValidatorSignature,
};
use sp_consensus_slots::Slot;
use pezsp_consensus_slots::Slot;
use std::collections::BTreeMap;
use super::v2::Bitfield;
@@ -26,7 +26,7 @@ use crate::{
use pezkuwi_node_primitives::approval::v1::AssignmentCertKind;
use pezkuwi_node_subsystem_util::database::Database;
use sp_application_crypto::sp_core::H256;
use pezsp_application_crypto::pezsp_core::H256;
use std::{collections::HashSet, sync::Arc};
fn make_block_entry_v1(
@@ -25,7 +25,7 @@ use pezkuwi_primitives::{
GroupIndex, Hash, SessionIndex, ValidatorIndex, ValidatorSignature,
};
use sp_consensus_slots::Slot;
use pezsp_consensus_slots::Slot;
use bitvec::{order::Lsb0 as BitOrderLsb0, vec::BitVec};
use std::collections::BTreeMap;
@@ -32,7 +32,7 @@ use pezkuwi_primitives::{
use pezkuwi_node_subsystem_util::database::Database;
use pezkuwi_primitives::Id as ParaId;
use sp_consensus_slots::Slot;
use pezsp_consensus_slots::Slot;
use std::{collections::HashMap, sync::Arc};
use pezkuwi_primitives_test_helpers::{
@@ -26,7 +26,7 @@ use crate::{
};
use pezkuwi_node_primitives::approval::v1::AssignmentCertKind;
use pezkuwi_node_subsystem_util::database::Database;
use sp_application_crypto::sp_core::H256;
use pezsp_application_crypto::pezsp_core::H256;
use std::{collections::HashSet, sync::Arc};
/// Migrates `BlockEntry`, `CandidateEntry`, `ApprovalEntry` and `OurApproval` to version 3.
@@ -29,7 +29,7 @@ use pezkuwi_primitives::{
GroupIndex, Hash, SessionIndex, ValidatorIndex, ValidatorSignature,
};
use sp_consensus_slots::Slot;
use pezsp_consensus_slots::Slot;
use std::collections::BTreeMap;
@@ -31,7 +31,7 @@ use pezkuwi_primitives::{
use pezkuwi_node_subsystem_util::database::Database;
use pezkuwi_primitives::Id as ParaId;
use sp_consensus_slots::Slot;
use pezsp_consensus_slots::Slot;
use std::{collections::HashMap, sync::Arc};
use pezkuwi_primitives_test_helpers::{
@@ -34,8 +34,8 @@ use pezkuwi_primitives::{
};
use rand::{seq::SliceRandom, SeedableRng};
use rand_chacha::ChaCha20Rng;
use sc_keystore::LocalKeystore;
use sp_application_crypto::ByteArray;
use pezsc_keystore::LocalKeystore;
use pezsp_application_crypto::ByteArray;
use merlin::Transcript;
use schnorrkel::vrf::VRFInOut;
@@ -261,8 +261,8 @@ pub fn compute_assignments(
match keystore.key_pair(p) {
Ok(Some(pair)) => Some((ValidatorIndex(i as _), pair)),
Ok(None) => None,
Err(sc_keystore::Error::Unavailable) => None,
Err(sc_keystore::Error::Io(e)) if e.kind() == std::io::ErrorKind::NotFound => None,
Err(pezsc_keystore::Error::Unavailable) => None,
Err(pezsc_keystore::Error::Io(e)) if e.kind() == std::io::ErrorKind::NotFound => None,
Err(e) => {
gum::warn!(target: LOG_TARGET, "Encountered keystore error: {:?}", e);
None
@@ -292,7 +292,7 @@ pub fn compute_assignments(
"Assigning to candidates from different backing groups"
);
let assignments_key: &sp_application_crypto::sr25519::Pair = assignments_key.as_ref();
let assignments_key: &pezsp_application_crypto::sr25519::Pair = assignments_key.as_ref();
let assignments_key: &schnorrkel::Keypair = assignments_key.as_ref();
let mut assignments = HashMap::new();
@@ -719,10 +719,10 @@ mod tests {
use super::*;
use crate::import::tests::garbage_vrf_signature;
use pezkuwi_primitives::{AssignmentId, Hash, ASSIGNMENT_KEY_TYPE_ID};
use sp_application_crypto::sr25519;
use sp_core::crypto::Pair as PairT;
use sp_keyring::sr25519::Keyring as Sr25519Keyring;
use sp_keystore::Keystore;
use pezsp_application_crypto::sr25519;
use pezsp_core::crypto::Pair as PairT;
use pezsp_keyring::sr25519::Keyring as Sr25519Keyring;
use pezsp_keystore::Keystore;
// sets up a keystore with the given keyring accounts.
fn make_keystore(accounts: &[Sr25519Keyring]) -> LocalKeystore {
@@ -49,8 +49,8 @@ use pezkuwi_primitives::{
CandidateReceiptV2 as CandidateReceipt, ConsensusLog, CoreIndex, GroupIndex, Hash, Header,
SessionIndex,
};
use sc_keystore::LocalKeystore;
use sp_consensus_slots::Slot;
use pezsc_keystore::LocalKeystore;
use pezsp_consensus_slots::Slot;
use bitvec::order::Lsb0 as BitOrderLsb0;
use futures::{channel::oneshot, prelude::*};
@@ -190,7 +190,7 @@ async fn imported_block_info<Sender: SubsystemSender<RuntimeApiMessage>>(
// want to use the block hash itself, and here's why:
//
// First off, 'epoch' in BABE means 'session' in other places. 'epoch' is the terminology
// from the paper, which we fulfill using 'session's, which are a Substrate consensus
// from the paper, which we fulfill using 'session's, which are a Bizinikiwi consensus
// concept.
//
// In BABE, the on-chain and off-chain view of the current epoch can differ at epoch
@@ -471,7 +471,7 @@ pub(crate) async fn handle_new_head<
let validator_group_lens: Vec<usize> =
session_info.validator_groups.iter().map(|v| v.len()).collect();
// insta-approve candidates on low-node testnets:
// cf. https://github.com/paritytech/polkadot/issues/2411
// cf. https://github.com/pezkuwichain/kurdistan-sdk/issues/134
let num_candidates = included_candidates.len();
let approved_bitfield = {
if needed_approvals == 0 {
@@ -628,13 +628,13 @@ pub(crate) mod tests {
};
use pezkuwi_primitives_test_helpers::{dummy_candidate_receipt_v2, dummy_hash};
use schnellru::{ByLength, LruMap};
pub(crate) use sp_consensus_babe::{
pub(crate) use pezsp_consensus_babe::{
digests::{CompatibleDigestItem, PreDigest, SecondaryVRFPreDigest},
AllowedSlots, BabeEpochConfiguration, Epoch as BabeEpoch,
};
use sp_core::{crypto::VrfSecret, testing::TaskExecutor};
use sp_keyring::sr25519::Keyring as Sr25519Keyring;
pub(crate) use sp_runtime::{Digest, DigestItem};
use pezsp_core::{crypto::VrfSecret, testing::TaskExecutor};
use pezsp_keyring::sr25519::Keyring as Sr25519Keyring;
pub(crate) use pezsp_runtime::{Digest, DigestItem};
use std::{pin::Pin, sync::Arc};
use crate::{approval_db::common::Config as DatabaseConfig, criteria, BlockEntry};
+5 -5
View File
@@ -58,10 +58,10 @@ use pezkuwi_primitives::{
Hash, SessionIndex, SessionInfo, ValidatorId, ValidatorIndex, ValidatorPair,
ValidatorSignature,
};
use sc_keystore::LocalKeystore;
use sp_application_crypto::Pair;
use sp_consensus::SyncOracle;
use sp_consensus_slots::Slot;
use pezsc_keystore::LocalKeystore;
use pezsp_application_crypto::Pair;
use pezsp_consensus::SyncOracle;
use pezsp_consensus_slots::Slot;
use std::time::Instant;
// The max number of blocks we keep track of assignments gathering times. Normally,
@@ -1552,7 +1552,7 @@ pub async fn start_approval_worker<
// of actions are generated by handling a single action.
//
// This particular problem statement is specified in issue 3311:
// https://github.com/paritytech/polkadot/issues/3311
// https://github.com/pezkuwichain/kurdistan-sdk/issues/142
//
// returns `true` if any of the actions was a `Conclude` command.
#[overseer::contextbounds(ApprovalVoting, prefix = self::overseer)]
+1 -1
View File
@@ -175,7 +175,7 @@ pub fn canonicalize(
// due to the fork pruning, this range actually might go too far above where our actual highest
// block is, if a relatively short fork is canonicalized.
// TODO https://github.com/paritytech/polkadot/issues/3389
// TODO https://github.com/pezkuwichain/kurdistan-sdk/issues/143
let new_range = StoredBlockRange(canon_number + 1, std::cmp::max(range.1, canon_number + 2));
overlay_db.write_stored_block_range(new_range);
@@ -29,7 +29,7 @@ use pezkuwi_primitives::{
BlockNumber, CandidateHash, CandidateIndex, CandidateReceiptV2 as CandidateReceipt, CoreIndex,
GroupIndex, Hash, SessionIndex, ValidatorIndex, ValidatorSignature,
};
use sp_consensus_slots::Slot;
use pezsp_consensus_slots::Slot;
use bitvec::{order::Lsb0 as BitOrderLsb0, slice::BitSlice};
use std::collections::BTreeMap;
@@ -50,8 +50,8 @@ use std::{cmp::max, time::Duration};
use assert_matches::assert_matches;
use parking_lot::Mutex;
use sp_keyring::sr25519::Keyring as Sr25519Keyring;
use sp_keystore::Keystore;
use pezsp_keyring::sr25519::Keyring as Sr25519Keyring;
use pezsp_keystore::Keystore;
use std::{
pin::Pin,
sync::{
@@ -540,12 +540,12 @@ fn test_harness<T: Future<Output = VirtualOverseer>>(
config: HarnessConfig,
test: impl FnOnce(TestHarness) -> T,
) {
sp_tracing::init_for_tests();
pezsp_tracing::init_for_tests();
let HarnessConfig { sync_oracle, sync_oracle_handle, clock, backend, assignment_criteria } =
config;
let pool = sp_core::testing::TaskExecutor::new();
let pool = pezsp_core::testing::TaskExecutor::new();
let (mut context, virtual_overseer) =
pezkuwi_node_subsystem_test_helpers::make_subsystem_context(pool.clone());
+6 -6
View File
@@ -24,18 +24,18 @@ 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-consensus = { workspace = true }
pezsp-consensus = { workspace = true }
[dev-dependencies]
assert_matches = { workspace = true }
kvdb-memorydb = { workspace = true }
sp-tracing = { workspace = true }
pezsp-tracing = { workspace = true }
parking_lot = { workspace = true, default-features = true }
pezkuwi-node-subsystem-test-helpers = { workspace = 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 = [
@@ -47,6 +47,6 @@ runtime-benchmarks = [
"pezkuwi-node-subsystem/runtime-benchmarks",
"pezkuwi-primitives-test-helpers/runtime-benchmarks",
"pezkuwi-primitives/runtime-benchmarks",
"sp-consensus/runtime-benchmarks",
"sp-keyring/runtime-benchmarks",
"pezsp-consensus/runtime-benchmarks",
"pezsp-keyring/runtime-benchmarks",
]
+2 -2
View File
@@ -36,7 +36,7 @@ use futures::{
};
use futures_timer::Delay;
use pezkuwi_node_subsystem_util::database::{DBTransaction, Database};
use sp_consensus::SyncOracle;
use pezsp_consensus::SyncOracle;
use bitvec::{order::Lsb0 as BitOrderLsb0, vec::BitVec};
use pezkuwi_node_primitives::{AvailableData, ErasureChunk};
@@ -647,7 +647,7 @@ async fn run_iteration<Context>(
// Start prune-all on a separate thread, so that in the case when the operation takes
// longer than expected we don't keep the whole subsystem blocked.
// See: https://github.com/paritytech/polkadot/issues/7237 for more details.
// See: https://github.com/pezkuwichain/kurdistan-sdk/issues/170 for more details.
#[overseer::contextbounds(AvailabilityStore, prefix = self::overseer)]
async fn start_prune_all<Context>(
ctx: &mut Context,
+4 -4
View File
@@ -35,7 +35,7 @@ use pezkuwi_primitives::{
HeadData, Header, PersistedValidationData, ValidatorId,
};
use pezkuwi_primitives_test_helpers::TestCandidateBuilder;
use sp_keyring::Sr25519Keyring;
use pezsp_keyring::Sr25519Keyring;
mod columns {
pub const DATA: u32 = 0;
@@ -108,7 +108,7 @@ impl Default for TestState {
struct NoSyncOracle;
impl sp_consensus::SyncOracle for NoSyncOracle {
impl pezsp_consensus::SyncOracle for NoSyncOracle {
fn is_major_syncing(&self) -> bool {
false
}
@@ -123,9 +123,9 @@ fn test_harness<T: Future<Output = VirtualOverseer>>(
store: Arc<dyn Database>,
test: impl FnOnce(VirtualOverseer) -> 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());
+7 -7
View File
@@ -24,7 +24,7 @@ pezkuwi-primitives = { workspace = true, default-features = true }
pezkuwi-statement-table = { workspace = true, default-features = true }
pezkuwi-teyrchain-primitives = { workspace = true, default-features = true }
schnellru = { workspace = true }
sp-keystore = { workspace = true, default-features = true }
pezsp-keystore = { workspace = true, default-features = true }
thiserror = { workspace = true }
[dev-dependencies]
@@ -33,11 +33,11 @@ futures = { features = ["thread-pool"], workspace = true }
pezkuwi-node-subsystem-test-helpers = { workspace = true }
pezkuwi-primitives = { workspace = true, features = ["test"] }
pezkuwi-primitives-test-helpers = { workspace = true }
sc-keystore = { workspace = true, default-features = true }
sp-application-crypto = { 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 }
pezsp-application-crypto = { 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]
runtime-benchmarks = [
@@ -51,5 +51,5 @@ runtime-benchmarks = [
"pezkuwi-primitives/runtime-benchmarks",
"pezkuwi-statement-table/runtime-benchmarks",
"pezkuwi-teyrchain-primitives/runtime-benchmarks",
"sp-keyring/runtime-benchmarks",
"pezsp-keyring/runtime-benchmarks",
]
+1 -1
View File
@@ -121,7 +121,7 @@ use pezkuwi_statement_table::{
Context as TableContextTrait, Table,
};
use pezkuwi_teyrchain_primitives::primitives::IsSystem;
use sp_keystore::KeystorePtr;
use pezsp_keystore::KeystorePtr;
mod error;
+9 -9
View File
@@ -35,10 +35,10 @@ use pezkuwi_primitives_test_helpers::{
dummy_committed_candidate_receipt_v2, dummy_hash, validator_pubkeys, CandidateDescriptor,
};
use pezkuwi_statement_table::v2::Misbehavior;
use sp_application_crypto::AppCrypto;
use sp_keyring::Sr25519Keyring;
use sp_keystore::Keystore;
use sp_tracing as _;
use pezsp_application_crypto::AppCrypto;
use pezsp_keyring::Sr25519Keyring;
use pezsp_keystore::Keystore;
use pezsp_tracing as _;
use std::{
collections::{BTreeMap, HashMap, VecDeque},
time::Duration,
@@ -115,7 +115,7 @@ impl Default for TestState {
Sr25519Keyring::One,
];
let keystore = Arc::new(sc_keystore::LocalKeystore::in_memory());
let keystore = Arc::new(pezsc_keystore::LocalKeystore::in_memory());
// Make sure `Alice` key is in the keystore, so this mocked node will be a teyrchain
// validator.
Keystore::sr25519_generate_new(&*keystore, ValidatorId::ID, Some(&validators[0].to_seed()))
@@ -187,9 +187,9 @@ fn test_harness<T: Future<Output = VirtualOverseer>>(
keystore: KeystorePtr,
test: impl FnOnce(VirtualOverseer) -> 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());
@@ -2156,7 +2156,7 @@ fn backing_works_after_failed_validation() {
#[test]
fn candidate_backing_reorders_votes() {
use sp_core::Encode;
use pezsp_core::Encode;
let core_idx = CoreIndex(10);
let validators = vec![
@@ -2419,7 +2419,7 @@ fn retry_works() {
#[test]
fn observes_backing_even_if_not_validator() {
let mut test_state = TestState::default();
let empty_keystore = Arc::new(sc_keystore::LocalKeystore::in_memory());
let empty_keystore = Arc::new(pezsc_keystore::LocalKeystore::in_memory());
test_harness(empty_keystore, |mut virtual_overseer| async move {
let para_id = activate_initial_leaf(&mut virtual_overseer, &mut test_state).await;
@@ -17,7 +17,7 @@ gum = { 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 }
wasm-timer = { workspace = true }
@@ -35,7 +35,7 @@ use pezkuwi_node_subsystem_util::{
self as util, request_availability_cores, runtime::recv_runtime, Validator,
};
use pezkuwi_primitives::{AvailabilityBitfield, CoreState, Hash, ValidatorIndex};
use sp_keystore::{Error as KeystoreError, KeystorePtr};
use pezsp_keystore::{Error as KeystoreError, KeystorePtr};
use std::{collections::HashMap, time::Duration};
use wasm_timer::{Delay, Instant};
@@ -49,7 +49,7 @@ mod tests;
const SPAWNED_TASK_DELAY: Duration = Duration::from_millis(1500);
const LOG_TARGET: &str = "teyrchain::bitfield-signing";
// TODO: use `fatality` (https://github.com/paritytech/polkadot/issues/5540).
// TODO: use `fatality` (https://github.com/pezkuwichain/kurdistan-sdk/issues/158).
/// Errors we may encounter in the course of executing the `BitfieldSigningSubsystem`.
#[derive(Debug, thiserror::Error)]
#[allow(missing_docs)]
@@ -18,8 +18,8 @@ futures-timer = { workspace = true }
gum = { workspace = true, default-features = true }
codec = { features = ["bit-vec", "derive"], workspace = true }
sp-application-crypto = { workspace = true }
sp-keystore = { workspace = true }
pezsp-application-crypto = { workspace = true }
pezsp-keystore = { workspace = true }
pezkuwi-node-metrics = { workspace = true, default-features = true }
pezkuwi-node-primitives = { workspace = true, default-features = true }
@@ -39,9 +39,9 @@ pezkuwi-node-subsystem-test-helpers = { workspace = true }
pezkuwi-primitives = { workspace = true, features = ["test"] }
pezkuwi-primitives-test-helpers = { workspace = true }
rstest = { workspace = true }
sp-core = { workspace = true, default-features = true }
sp-keyring = { workspace = true, default-features = true }
sp-maybe-compressed-blob = { workspace = true, default-features = true }
pezsp-core = { workspace = true, default-features = true }
pezsp-keyring = { workspace = true, default-features = true }
pezsp-maybe-compressed-blob = { workspace = true, default-features = true }
[features]
runtime-benchmarks = [
@@ -56,5 +56,5 @@ runtime-benchmarks = [
"pezkuwi-primitives-test-helpers/runtime-benchmarks",
"pezkuwi-primitives/runtime-benchmarks",
"pezkuwi-teyrchain-primitives/runtime-benchmarks",
"sp-keyring/runtime-benchmarks",
"pezsp-keyring/runtime-benchmarks",
]
@@ -55,8 +55,8 @@ use pezkuwi_primitives::{
ValidationCode, ValidationCodeHash, ValidatorId,
};
use pezkuwi_teyrchain_primitives::primitives::ValidationResult as WasmValidationResult;
use sp_application_crypto::{AppCrypto, ByteArray};
use sp_keystore::KeystorePtr;
use pezsp_application_crypto::{AppCrypto, ByteArray};
use pezsp_keystore::KeystorePtr;
use codec::Encode;
@@ -40,9 +40,9 @@ use pezkuwi_primitives_test_helpers::{
make_valid_candidate_descriptor_v2, CandidateDescriptor,
};
use rstest::rstest;
use sp_core::{sr25519::Public, testing::TaskExecutor};
use sp_keyring::Sr25519Keyring;
use sp_keystore::{testing::MemoryKeystore, Keystore};
use pezsp_core::{sr25519::Public, testing::TaskExecutor};
use pezsp_keyring::Sr25519Keyring;
use pezsp_keystore::{testing::MemoryKeystore, Keystore};
const VALIDATION_CODE_BOMB_LIMIT: u32 = 30 * 1024 * 1024;
@@ -750,7 +750,7 @@ fn invalid_session_or_ump_signals() {
validation_code.hash(),
validation_result.head_data.hash(),
dummy_hash(),
sp_keyring::Sr25519Keyring::Ferdie,
pezsp_keyring::Sr25519Keyring::Ferdie,
);
let descriptor: CandidateDescriptorV2 = descriptor_v1.into();
@@ -1342,7 +1342,7 @@ fn compressed_code_works() {
let raw_code = vec![2u8; 16];
let validation_code =
sp_maybe_compressed_blob::compress_strongly(&raw_code, VALIDATION_CODE_BOMB_LIMIT as usize)
pezsp_maybe_compressed_blob::compress_strongly(&raw_code, VALIDATION_CODE_BOMB_LIMIT as usize)
.map(ValidationCode)
.unwrap();
+7 -7
View File
@@ -17,8 +17,8 @@ gum = { workspace = true, default-features = true }
pezkuwi-node-metrics = { workspace = true, default-features = true }
pezkuwi-node-subsystem = { workspace = true, default-features = true }
pezkuwi-node-subsystem-types = { workspace = true, default-features = true }
sc-client-api = { workspace = true, default-features = true }
sc-consensus-babe = { workspace = true, default-features = true }
pezsc-client-api = { workspace = true, default-features = true }
pezsc-consensus-babe = { workspace = true, default-features = true }
[dev-dependencies]
codec = { workspace = true, default-features = true }
@@ -27,8 +27,8 @@ maplit = { workspace = true }
pezkuwi-node-primitives = { workspace = true, default-features = true }
pezkuwi-node-subsystem-test-helpers = { workspace = true }
pezkuwi-primitives = { workspace = true, default-features = true }
sp-blockchain = { workspace = true, default-features = true }
sp-core = { workspace = true, default-features = true }
pezsp-blockchain = { workspace = true, default-features = true }
pezsp-core = { workspace = true, default-features = true }
[features]
runtime-benchmarks = [
@@ -39,7 +39,7 @@ runtime-benchmarks = [
"pezkuwi-node-subsystem-types/runtime-benchmarks",
"pezkuwi-node-subsystem/runtime-benchmarks",
"pezkuwi-primitives/runtime-benchmarks",
"sc-client-api/runtime-benchmarks",
"sc-consensus-babe/runtime-benchmarks",
"sp-blockchain/runtime-benchmarks",
"pezsc-client-api/runtime-benchmarks",
"pezsc-consensus-babe/runtime-benchmarks",
"pezsp-blockchain/runtime-benchmarks",
]
+2 -2
View File
@@ -34,7 +34,7 @@
use std::sync::Arc;
use futures::prelude::*;
use sc_client_api::AuxStore;
use pezsc_client_api::AuxStore;
use futures::stream::StreamExt;
use pezkuwi_node_subsystem::{
@@ -107,7 +107,7 @@ where
},
ChainApiMessage::BlockWeight(hash, response_channel) => {
let _timer = subsystem.metrics.time_block_weight();
let result = sc_consensus_babe::block_weight(&*subsystem.client, hash)
let result = pezsc_consensus_babe::block_weight(&*subsystem.client, hash)
.map_err(|e| e.to_string().into());
subsystem.metrics.on_request(result.is_ok());
let _ = response_channel.send(result);
+14 -14
View File
@@ -24,8 +24,8 @@ use pezkuwi_node_primitives::BlockWeight;
use pezkuwi_node_subsystem_test_helpers::{make_subsystem_context, TestSubsystemContextHandle};
use pezkuwi_node_subsystem_types::ChainApiBackend;
use pezkuwi_primitives::{Block, BlockNumber, Hash, Header};
use sp_blockchain::Info as BlockInfo;
use sp_core::testing::TaskExecutor;
use pezsp_blockchain::Info as BlockInfo;
use pezsp_core::testing::TaskExecutor;
#[derive(Clone)]
struct TestClient {
@@ -111,7 +111,7 @@ fn last_key_value<K: Clone, V: Clone>(map: &BTreeMap<K, V>) -> (K, V) {
map.iter().last().map(|(k, v)| (k.clone(), v.clone())).unwrap()
}
impl sp_blockchain::HeaderBackend<Block> for TestClient {
impl pezsp_blockchain::HeaderBackend<Block> for TestClient {
fn info(&self) -> BlockInfo<Block> {
let genesis_hash = self.blocks.iter().next().map(|(h, _)| *h).unwrap();
let (best_hash, best_number) = last_key_value(&self.blocks);
@@ -128,20 +128,20 @@ impl sp_blockchain::HeaderBackend<Block> for TestClient {
block_gap: None,
}
}
fn number(&self, hash: Hash) -> sp_blockchain::Result<Option<BlockNumber>> {
fn number(&self, hash: Hash) -> pezsp_blockchain::Result<Option<BlockNumber>> {
Ok(self.blocks.get(&hash).copied())
}
fn hash(&self, number: BlockNumber) -> sp_blockchain::Result<Option<Hash>> {
fn hash(&self, number: BlockNumber) -> pezsp_blockchain::Result<Option<Hash>> {
Ok(self.finalized_blocks.get(&number).copied())
}
fn header(&self, hash: Hash) -> sp_blockchain::Result<Option<Header>> {
fn header(&self, hash: Hash) -> pezsp_blockchain::Result<Option<Header>> {
if hash.is_zero() {
Err(sp_blockchain::Error::Backend("Zero hashes are illegal!".into()))
Err(pezsp_blockchain::Error::Backend("Zero hashes are illegal!".into()))
} else {
Ok(self.headers.get(&hash).cloned())
}
}
fn status(&self, _hash: Hash) -> sp_blockchain::Result<sp_blockchain::BlockStatus> {
fn status(&self, _hash: Hash) -> pezsp_blockchain::Result<pezsp_blockchain::BlockStatus> {
unimplemented!()
}
}
@@ -173,15 +173,15 @@ impl AuxStore for TestClient {
&self,
_insert: I,
_delete: D,
) -> sp_blockchain::Result<()> {
) -> pezsp_blockchain::Result<()> {
unimplemented!()
}
fn get_aux(&self, key: &[u8]) -> sp_blockchain::Result<Option<Vec<u8>>> {
fn get_aux(&self, key: &[u8]) -> pezsp_blockchain::Result<Option<Vec<u8>>> {
Ok(self
.block_weights
.iter()
.find(|(hash, _)| sc_consensus_babe::aux_schema::block_weight_key(hash) == key)
.find(|(hash, _)| pezsc_consensus_babe::aux_schema::block_weight_key(hash) == key)
.map(|(_, weight)| weight.encode()))
}
}
@@ -246,9 +246,9 @@ fn request_block_weight() {
async move {
const NOT_HERE: Hash = Hash::repeat_byte(0x5);
let test_cases = [
(TWO, sc_consensus_babe::block_weight(&*client, TWO).unwrap()),
(FOUR, sc_consensus_babe::block_weight(&*client, FOUR).unwrap()),
(NOT_HERE, sc_consensus_babe::block_weight(&*client, NOT_HERE).unwrap()),
(TWO, pezsc_consensus_babe::block_weight(&*client, TWO).unwrap()),
(FOUR, pezsc_consensus_babe::block_weight(&*client, FOUR).unwrap()),
(NOT_HERE, pezsc_consensus_babe::block_weight(&*client, NOT_HERE).unwrap()),
];
for (hash, expected) in &test_cases {
let (tx, rx) = oneshot::channel();
+1 -1
View File
@@ -27,7 +27,7 @@ assert_matches = { workspace = true }
kvdb-memorydb = { workspace = true }
parking_lot = { workspace = true, default-features = true }
pezkuwi-node-subsystem-test-helpers = { workspace = true }
sp-core = { workspace = true, default-features = true }
pezsp-core = { workspace = true, default-features = true }
[features]
runtime-benchmarks = [
@@ -33,7 +33,7 @@ use assert_matches::assert_matches;
use codec::Encode;
use futures::channel::oneshot;
use parking_lot::Mutex;
use sp_core::testing::TaskExecutor;
use pezsp_core::testing::TaskExecutor;
use pezkuwi_node_subsystem::{messages::AllMessages, ActiveLeavesUpdate};
use pezkuwi_node_subsystem_test_helpers as test_helpers;
@@ -30,7 +30,7 @@ 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-keystore = { workspace = true, default-features = true }
pezsc-keystore = { workspace = true, default-features = true }
[dev-dependencies]
assert_matches = { workspace = true }
@@ -39,11 +39,11 @@ kvdb-memorydb = { workspace = true }
pezkuwi-node-subsystem-test-helpers = { workspace = true }
pezkuwi-primitives = { workspace = true, features = ["test"] }
pezkuwi-primitives-test-helpers = { workspace = true }
sp-application-crypto = { 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, default-features = true }
pezsp-application-crypto = { 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, default-features = true }
pezkuwi-subsystem-bench = { workspace = true }
@@ -60,5 +60,5 @@ runtime-benchmarks = [
"pezkuwi-primitives-test-helpers/runtime-benchmarks",
"pezkuwi-primitives/runtime-benchmarks",
"pezkuwi-subsystem-bench/runtime-benchmarks",
"sp-keyring/runtime-benchmarks",
"pezsp-keyring/runtime-benchmarks",
]
@@ -26,7 +26,7 @@ use futures::{
FutureExt, StreamExt,
};
use sc_keystore::LocalKeystore;
use pezsc_keystore::LocalKeystore;
use pezkuwi_node_primitives::{
disputes::ValidCandidateVotes, CandidateVotes, DisputeStatus, SignedDisputeStatement,
@@ -114,7 +114,7 @@ pub(crate) struct Initialized {
/// blocks) we will be too slow importing all votes from unfinalized chains on startup
/// (dispute-coordinator gets killed because of unresponsiveness).
///
/// https://github.com/paritytech/polkadot/issues/6912
/// https://github.com/pezkuwichain/kurdistan-sdk/issues/168
///
/// To resolve this, we limit the amount of votes imported at once to
/// `CHAIN_IMPORT_MAX_BATCH_SIZE` and put the rest here for later processing.
@@ -771,7 +771,7 @@ impl Initialized {
.handle_import_statements(
ctx,
overlay_db,
// TODO <https://github.com/paritytech/polkadot/issues/4011>
// TODO <https://github.com/pezkuwichain/kurdistan-sdk/issues/147>
MaybeCandidateReceipt::AssumeBackingVotePresent(candidate_hash),
session,
statements,
@@ -31,7 +31,7 @@ use error::FatalError;
use futures::FutureExt;
use gum::CandidateHash;
use sc_keystore::LocalKeystore;
use pezsc_keystore::LocalKeystore;
use pezkuwi_node_primitives::{
CandidateVotes, DisputeMessage, DisputeMessageCheckError, SignedDisputeStatement,
@@ -19,7 +19,7 @@ use futures::StreamExt;
use pezkuwi_node_subsystem_util::TimeoutExt;
use std::{sync::Arc, time::Duration};
use sp_core::testing::TaskExecutor;
use pezsp_core::testing::TaskExecutor;
use super::*;
use codec::Encode;
@@ -20,7 +20,7 @@ use assert_matches::assert_matches;
use codec::Encode;
use futures::future::join;
use sp_core::testing::TaskExecutor;
use pezsp_core::testing::TaskExecutor;
use pezkuwi_node_primitives::DISPUTE_CANDIDATE_LIFETIME_AFTER_FINALIZATION;
use pezkuwi_node_subsystem::{
@@ -45,11 +45,11 @@ use pezkuwi_node_subsystem::{
};
use pezkuwi_node_subsystem_util::TimeoutExt;
use sc_keystore::LocalKeystore;
use sp_application_crypto::AppCrypto;
use sp_core::{sr25519::Pair, testing::TaskExecutor, Pair as PairT};
use sp_keyring::Sr25519Keyring;
use sp_keystore::{Keystore, KeystorePtr};
use pezsc_keystore::LocalKeystore;
use pezsp_application_crypto::AppCrypto;
use pezsp_core::{sr25519::Pair, testing::TaskExecutor, Pair as PairT};
use pezsp_keyring::Sr25519Keyring;
use pezsp_keystore::{Keystore, KeystorePtr};
use pezkuwi_node_primitives::{Timestamp, ACTIVE_DURATION_SECS};
use pezkuwi_node_subsystem::{
@@ -169,8 +169,8 @@ struct TestState {
validators: Vec<Pair>,
validator_public: IndexedVec<ValidatorIndex, ValidatorId>,
validator_groups: IndexedVec<GroupIndex, Vec<ValidatorIndex>>,
master_keystore: Arc<sc_keystore::LocalKeystore>,
subsystem_keystore: Arc<sc_keystore::LocalKeystore>,
master_keystore: Arc<pezsc_keystore::LocalKeystore>,
subsystem_keystore: Arc<pezsc_keystore::LocalKeystore>,
db: Arc<dyn Database>,
config: Config,
clock: MockClock,
@@ -2156,7 +2156,7 @@ fn concluded_supermajority_against_non_active_after_time() {
#[test]
fn resume_dispute_without_local_statement() {
sp_tracing::init_for_tests();
pezsp_tracing::init_for_tests();
let session = 1;
test_harness(|mut test_state, mut virtual_overseer| {
@@ -2308,7 +2308,7 @@ fn resume_dispute_without_local_statement() {
#[test]
fn resume_dispute_with_local_statement() {
sp_tracing::init_for_tests();
pezsp_tracing::init_for_tests();
let session = 1;
test_harness(|mut test_state, mut virtual_overseer| {
@@ -2838,7 +2838,7 @@ fn participation_with_onchain_disabling_confirmed() {
#[test]
fn participation_with_offchain_disabling() {
sp_tracing::init_for_tests();
pezsp_tracing::init_for_tests();
test_harness(|mut test_state, mut virtual_overseer| {
Box::pin(async move {
let session = 1;
@@ -28,8 +28,8 @@ pezkuwi-primitives = { workspace = true, features = ["test"] }
pezkuwi-primitives-test-helpers = { workspace = true }
rand = { workspace = true }
rstest = { workspace = true }
sp-core = { workspace = true, default-features = true }
sp-tracing = { workspace = true }
pezsp-core = { workspace = true, default-features = true }
pezsp-tracing = { workspace = true }
[features]
runtime-benchmarks = [
@@ -116,9 +116,9 @@ fn get_parent_hash(hash: Hash) -> Hash {
fn test_harness<T: Future<Output = VirtualOverseer>>(
test: impl FnOnce(VirtualOverseer) -> T,
) -> View {
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 (mut context, virtual_overseer) =
pezkuwi_node_subsystem_test_helpers::make_subsystem_context(pool.clone());
+4 -4
View File
@@ -21,7 +21,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 }
sc-consensus-slots = { workspace = true }
pezsc-consensus-slots = { workspace = true }
schnellru = { workspace = true }
thiserror = { workspace = true }
@@ -29,8 +29,8 @@ thiserror = { workspace = true }
pezkuwi-node-subsystem-test-helpers = { workspace = true }
pezkuwi-primitives = { workspace = true, features = ["test"] }
pezkuwi-primitives-test-helpers = { workspace = true }
sp-application-crypto = { workspace = true, default-features = true }
sp-keystore = { workspace = true, default-features = true }
pezsp-application-crypto = { workspace = true, default-features = true }
pezsp-keystore = { workspace = true, default-features = true }
[features]
runtime-benchmarks = [
@@ -41,5 +41,5 @@ runtime-benchmarks = [
"pezkuwi-node-subsystem/runtime-benchmarks",
"pezkuwi-primitives-test-helpers/runtime-benchmarks",
"pezkuwi-primitives/runtime-benchmarks",
"sc-consensus-slots/runtime-benchmarks",
"pezsc-consensus-slots/runtime-benchmarks",
]
@@ -221,7 +221,7 @@ fn partitioning_happy_case() {
// achieved with or without the 'help' of a double vote (a validator voting for and against at the
// same time). This makes the test a bit pointless but anyway I'm leaving it here to make this
// decision explicit and have the test code ready in case this behavior needs to be further tested
// in the future. Link to the PR with the discussions: https://github.com/paritytech/polkadot/pull/5567
// in the future. Link to the PR with the discussions: https://github.com/pezkuwichain/kurdistan-sdk/issues/177
#[test]
fn partitioning_doubled_onchain_vote() {
let mut input = BTreeMap::<(SessionIndex, CandidateHash), DisputeStatus>::new();
+2 -2
View File
@@ -41,7 +41,7 @@ use pezkuwi_primitives::{
BackedCandidate, CandidateEvent, CandidateHash, CoreIndex, CoreState, Hash, Id as ParaId,
SignedAvailabilityBitfield, ValidatorIndex,
};
use sc_consensus_slots::time_until_next_slot;
use pezsc_consensus_slots::time_until_next_slot;
use schnellru::{ByLength, LruMap};
use std::{
collections::{BTreeMap, HashMap},
@@ -416,7 +416,7 @@ fn note_provisionable_data(
// parablocks once they are included. But we can do slightly better by
// allowing disagreeing backers to record their disagreement and initiate a
// dispute once the parablock in question has been included. This potential
// change is tracked by: https://github.com/paritytech/polkadot/issues/3232
// change is tracked by: https://github.com/pezkuwichain/kurdistan-sdk/issues/140
ProvisionableData::Dispute(_, _) => {},
}
}
+2 -2
View File
@@ -62,8 +62,8 @@ pub fn scheduled_core(id: u32) -> ScheduledCore {
mod select_availability_bitfields {
use super::{super::*, default_bitvec, occupied_core};
use pezkuwi_primitives::{ScheduledCore, SigningContext, ValidatorId, ValidatorIndex};
use sp_application_crypto::AppCrypto;
use sp_keystore::{testing::MemoryKeystore, Keystore, KeystorePtr};
use pezsp_application_crypto::AppCrypto;
use pezsp_keystore::{testing::MemoryKeystore, Keystore, KeystorePtr};
use std::sync::Arc;
fn signed_bitfield(
+8 -8
View File
@@ -19,17 +19,17 @@ 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 }
[dev-dependencies]
futures-timer = { workspace = true }
pezkuwi-node-subsystem-test-helpers = { workspace = true }
pezkuwi-primitives-test-helpers = { workspace = true }
sc-keystore = { workspace = true, default-features = true }
sp-application-crypto = { workspace = true, default-features = true }
sp-core = { workspace = true, default-features = true }
sp-keyring = { workspace = true, default-features = true }
sp-runtime = { workspace = true, default-features = true }
pezsc-keystore = { workspace = true, default-features = true }
pezsp-application-crypto = { workspace = true, default-features = true }
pezsp-core = { workspace = true, default-features = true }
pezsp-keyring = { workspace = true, default-features = true }
pezsp-runtime = { workspace = true, default-features = true }
[features]
runtime-benchmarks = [
@@ -39,6 +39,6 @@ runtime-benchmarks = [
"pezkuwi-node-subsystem/runtime-benchmarks",
"pezkuwi-primitives-test-helpers/runtime-benchmarks",
"pezkuwi-primitives/runtime-benchmarks",
"sp-keyring/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"pezsp-keyring/runtime-benchmarks",
"pezsp-runtime/runtime-benchmarks",
]
+1 -1
View File
@@ -30,7 +30,7 @@ use pezkuwi_primitives::{
BlockNumber, Hash, PvfCheckStatement, SessionIndex, ValidationCodeHash, ValidatorId,
ValidatorIndex,
};
use sp_keystore::KeystorePtr;
use pezsp_keystore::KeystorePtr;
use std::collections::HashSet;
const LOG_TARGET: &str = "teyrchain::pvf-checker";
+6 -6
View File
@@ -30,11 +30,11 @@ use pezkuwi_primitives::{
ValidatorId,
};
use pezkuwi_primitives_test_helpers::{dummy_digest, dummy_hash, validator_pubkeys};
use sp_application_crypto::AppCrypto;
use sp_core::testing::TaskExecutor;
use sp_keyring::Sr25519Keyring;
use sp_keystore::Keystore;
use sp_runtime::traits::AppVerify;
use pezsp_application_crypto::AppCrypto;
use pezsp_core::testing::TaskExecutor;
use pezsp_keyring::Sr25519Keyring;
use pezsp_keystore::Keystore;
use pezsp_runtime::traits::AppVerify;
use std::{collections::HashMap, sync::Arc, time::Duration};
type VirtualOverseer = TestSubsystemContextHandle<PvfCheckerMessage>;
@@ -353,7 +353,7 @@ impl ExpectSubmitVote {
fn test_harness(test: impl FnOnce(TestState, VirtualOverseer) -> BoxFuture<'static, ()>) {
let pool = TaskExecutor::new();
let (ctx, handle) = make_subsystem_context::<PvfCheckerMessage, _>(pool.clone());
let keystore = Arc::new(sc_keystore::LocalKeystore::in_memory());
let keystore = Arc::new(pezsc_keystore::LocalKeystore::in_memory());
// Add OUR_VALIDATOR (which is Alice) to the keystore.
Keystore::sr25519_generate_new(&*keystore, ValidatorId::ID, Some(&OUR_VALIDATOR.to_seed()))
+7 -7
View File
@@ -44,9 +44,9 @@ pezkuwi-teyrchain-primitives = { workspace = true, default-features = true }
pezkuwi-node-core-pvf-execute-worker = { optional = true, workspace = true, default-features = true }
pezkuwi-node-core-pvf-prepare-worker = { optional = true, workspace = true, default-features = true }
sc-tracing = { workspace = true }
sp-core = { workspace = true, default-features = true }
sp-maybe-compressed-blob = { optional = true, workspace = true, default-features = true }
pezsc-tracing = { workspace = true }
pezsp-core = { workspace = true, default-features = true }
pezsp-maybe-compressed-blob = { optional = true, workspace = true, default-features = true }
[dev-dependencies]
assert_matches = { workspace = true }
@@ -72,7 +72,7 @@ test-teyrchain-halt = { workspace = true }
libc = { workspace = true }
procfs = { workspace = true }
rusty-fork = { workspace = true, default-features = true }
sc-sysinfo = { workspace = true, default-features = true }
pezsc-sysinfo = { workspace = true, default-features = true }
[features]
ci-only-tests = []
@@ -82,7 +82,7 @@ test-utils = [
"dep:is_executable",
"dep:pezkuwi-node-core-pvf-execute-worker",
"dep:pezkuwi-node-core-pvf-prepare-worker",
"dep:sp-maybe-compressed-blob",
"dep:pezsp-maybe-compressed-blob",
]
runtime-benchmarks = [
"gum/runtime-benchmarks",
@@ -97,7 +97,7 @@ runtime-benchmarks = [
"pezkuwi-primitives/runtime-benchmarks",
"pezkuwi-teyrchain-primitives/runtime-benchmarks",
"pezkuwichain-runtime/runtime-benchmarks",
"sc-sysinfo/runtime-benchmarks",
"sc-tracing/runtime-benchmarks",
"pezsc-sysinfo/runtime-benchmarks",
"pezsc-tracing/runtime-benchmarks",
"test-teyrchain-adder/runtime-benchmarks",
]
@@ -65,7 +65,7 @@ impl TestHost {
) -> Result<(), PrepareError> {
let (result_tx, result_rx) = futures::channel::oneshot::channel();
let code = sp_maybe_compressed_blob::decompress(code, 16 * 1024 * 1024)
let code = pezsp_maybe_compressed_blob::decompress(code, 16 * 1024 * 1024)
.expect("Compression works");
self.host
@@ -88,12 +88,12 @@ impl TestHost {
}
fn host_prepare_pezkuwichain_runtime(c: &mut Criterion) {
pezkuwi_node_core_pvf_common::sp_tracing::try_init_simple();
pezkuwi_node_core_pvf_common::pezsp_tracing::try_init_simple();
let rt = tokio::runtime::Runtime::new().unwrap();
let blob = WASM_BINARY.expect("You need to build the WASM binaries to run the tests!");
let pvf = match sp_maybe_compressed_blob::decompress(&blob, 64 * 1024 * 1024) {
let pvf = match pezsp_maybe_compressed_blob::decompress(&blob, 64 * 1024 * 1024) {
Ok(code) => PvfPrepData::from_code(
code.into_owned(),
ExecutorParams::default(),
+11 -11
View File
@@ -25,15 +25,15 @@ pezkuwi-node-primitives = { workspace = true, default-features = true }
pezkuwi-primitives = { workspace = true, default-features = true }
pezkuwi-teyrchain-primitives = { workspace = true, default-features = true }
sc-executor = { workspace = true, default-features = true }
sc-executor-common = { workspace = true, default-features = true }
sc-executor-wasmtime = { workspace = true, default-features = true }
pezsc-executor = { workspace = true, default-features = true }
pezsc-executor-common = { workspace = true, default-features = true }
pezsc-executor-wasmtime = { workspace = true, default-features = true }
sp-core = { workspace = true, default-features = true }
sp-crypto-hashing = { workspace = true, default-features = true }
sp-externalities = { workspace = true, default-features = true }
sp-io = { workspace = true, default-features = true }
sp-tracing = { workspace = true, default-features = true }
pezsp-core = { workspace = true, default-features = true }
pezsp-crypto-hashing = { workspace = true, default-features = true }
pezsp-externalities = { workspace = true, default-features = true }
pezsp-io = { workspace = true, default-features = true }
pezsp-tracing = { workspace = true, default-features = true }
[target.'cfg(target_os = "linux")'.dependencies]
landlock = { workspace = true }
@@ -57,7 +57,7 @@ runtime-benchmarks = [
"pezkuwi-node-primitives/runtime-benchmarks",
"pezkuwi-primitives/runtime-benchmarks",
"pezkuwi-teyrchain-primitives/runtime-benchmarks",
"sc-executor-wasmtime/runtime-benchmarks",
"sc-executor/runtime-benchmarks",
"sp-io/runtime-benchmarks",
"pezsc-executor-wasmtime/runtime-benchmarks",
"pezsc-executor/runtime-benchmarks",
"pezsp-io/runtime-benchmarks",
]
+1 -1
View File
@@ -16,7 +16,7 @@
use crate::prepare::{PrepareSuccess, PrepareWorkerSuccess};
use codec::{Decode, Encode};
pub use sc_executor_common::error::Error as ExecuteError;
pub use pezsc_executor_common::error::Error as ExecuteError;
/// Result of PVF preparation from a worker, with checksum of the compiled PVF and stats of the
/// preparation if successful.
@@ -14,26 +14,26 @@
// You should have received a copy of the GNU General Public License
// along with Pezkuwi. If not, see <http://www.gnu.org/licenses/>.
//! Interface to the Substrate Executor
//! Interface to the Bizinikiwi Executor
use crate::error::ExecuteError;
use pezkuwi_primitives::{
executor_params::{DEFAULT_LOGICAL_STACK_MAX, DEFAULT_NATIVE_STACK_MAX},
ExecutorParam, ExecutorParams,
};
use sc_executor_common::{
use pezsc_executor_common::{
error::WasmError,
runtime_blob::RuntimeBlob,
wasm_runtime::{HeapAllocStrategy, WasmModule as _},
};
use sc_executor_wasmtime::{Config, DeterministicStackLimit, Semantics, WasmtimeRuntime};
use sp_core::storage::{ChildInfo, TrackedStorageKey};
use sp_externalities::MultiRemovalResults;
use pezsc_executor_wasmtime::{Config, DeterministicStackLimit, Semantics, WasmtimeRuntime};
use pezsp_core::storage::{ChildInfo, TrackedStorageKey};
use pezsp_externalities::MultiRemovalResults;
use std::any::{Any, TypeId};
// Memory configuration
//
// When Substrate Runtime is instantiated, a number of WASM pages are allocated for the Substrate
// When Bizinikiwi Runtime is instantiated, a number of WASM pages are allocated for the Bizinikiwi
// Runtime instance's linear memory. The exact number of pages is a sum of whatever the WASM blob
// itself requests (by default at least enough to hold the data section as well as have some space
// left for the stack; this is, of course, overridable at link time when compiling the runtime)
@@ -54,12 +54,12 @@ pub const DEFAULT_CONFIG: Config = Config {
allow_missing_func_imports: true,
cache_path: None,
semantics: Semantics {
heap_alloc_strategy: sc_executor_common::wasm_runtime::HeapAllocStrategy::Dynamic {
heap_alloc_strategy: pezsc_executor_common::wasm_runtime::HeapAllocStrategy::Dynamic {
maximum_pages: Some(DEFAULT_HEAP_PAGES_ESTIMATE + EXTRA_HEAP_PAGES),
},
instantiation_strategy:
sc_executor_wasmtime::InstantiationStrategy::RecreateInstanceCopyOnWrite,
pezsc_executor_wasmtime::InstantiationStrategy::RecreateInstanceCopyOnWrite,
// Enable deterministic stack limit to pin down the exact number of items the wasmtime stack
// can contain before it traps with stack overflow.
@@ -111,13 +111,13 @@ pub unsafe fn execute_artifact(
executor_params: &ExecutorParams,
params: &[u8],
) -> Result<Vec<u8>, ExecuteError> {
let mut extensions = sp_externalities::Extensions::new();
let mut extensions = pezsp_externalities::Extensions::new();
extensions.register(sp_core::traits::ReadRuntimeVersionExt::new(ReadRuntimeVersion));
extensions.register(pezsp_core::traits::ReadRuntimeVersionExt::new(ReadRuntimeVersion));
let mut ext = ValidationExternalities(extensions);
match sc_executor::with_externalities_safe(&mut ext, || {
match pezsc_executor::with_externalities_safe(&mut ext, || {
let runtime = create_runtime_from_artifact_bytes(compiled_artifact_blob, executor_params)?;
runtime.new_instance()?.call("validate_block", params)
}) {
@@ -142,7 +142,7 @@ pub unsafe fn create_runtime_from_artifact_bytes(
let mut config = DEFAULT_CONFIG.clone();
config.semantics = params_to_wasmtime_semantics(executor_params).0;
sc_executor_wasmtime::create_runtime_from_artifact_bytes::<HostFunctions>(
pezsc_executor_wasmtime::create_runtime_from_artifact_bytes::<HostFunctions>(
compiled_artifact_blob,
config,
)
@@ -177,7 +177,7 @@ pub fn params_to_wasmtime_semantics(par: &ExecutorParams) -> (Semantics, Determi
}
/// Runs the prevalidation on the given code. Returns a [`RuntimeBlob`] if it succeeds.
pub fn prevalidate(code: &[u8]) -> Result<RuntimeBlob, sc_executor_common::error::WasmError> {
pub fn prevalidate(code: &[u8]) -> Result<RuntimeBlob, pezsc_executor_common::error::WasmError> {
// Construct the runtime blob and do some basic checks for consistency.
let blob = RuntimeBlob::new(code)?;
// In the future this function should take care of any further prevalidation logic.
@@ -189,9 +189,9 @@ pub fn prevalidate(code: &[u8]) -> Result<RuntimeBlob, sc_executor_common::error
pub fn prepare(
blob: RuntimeBlob,
executor_params: &ExecutorParams,
) -> Result<Vec<u8>, sc_executor_common::error::WasmError> {
) -> Result<Vec<u8>, pezsc_executor_common::error::WasmError> {
let (semantics, _) = params_to_wasmtime_semantics(executor_params);
sc_executor_wasmtime::prepare_runtime_artifact(blob, &semantics)
pezsc_executor_wasmtime::prepare_runtime_artifact(blob, &semantics)
}
/// Available host functions. We leave out:
@@ -202,19 +202,19 @@ pub fn prepare(
/// 4. runtime tasks
/// 5. sandbox
type HostFunctions = (
sp_io::misc::HostFunctions,
sp_io::crypto::HostFunctions,
sp_io::hashing::HostFunctions,
sp_io::allocator::HostFunctions,
sp_io::logging::HostFunctions,
sp_io::trie::HostFunctions,
pezsp_io::misc::HostFunctions,
pezsp_io::crypto::HostFunctions,
pezsp_io::hashing::HostFunctions,
pezsp_io::allocator::HostFunctions,
pezsp_io::logging::HostFunctions,
pezsp_io::trie::HostFunctions,
);
/// The validation externalities that will panic on any storage related access. (PVFs should not
/// have a notion of a persistent storage/trie.)
struct ValidationExternalities(sp_externalities::Extensions);
struct ValidationExternalities(pezsp_externalities::Extensions);
impl sp_externalities::Externalities for ValidationExternalities {
impl pezsp_externalities::Externalities for ValidationExternalities {
fn storage(&mut self, _: &[u8]) -> Option<Vec<u8>> {
panic!("storage: unsupported feature for teyrchain validation")
}
@@ -267,11 +267,11 @@ impl sp_externalities::Externalities for ValidationExternalities {
panic!("place_child_storage: unsupported feature for teyrchain validation")
}
fn storage_root(&mut self, _: sp_core::storage::StateVersion) -> Vec<u8> {
fn storage_root(&mut self, _: pezsp_core::storage::StateVersion) -> Vec<u8> {
panic!("storage_root: unsupported feature for teyrchain validation")
}
fn child_storage_root(&mut self, _: &ChildInfo, _: sp_core::storage::StateVersion) -> Vec<u8> {
fn child_storage_root(&mut self, _: &ChildInfo, _: pezsp_core::storage::StateVersion) -> Vec<u8> {
panic!("child_storage_root: unsupported feature for teyrchain validation")
}
@@ -332,7 +332,7 @@ impl sp_externalities::Externalities for ValidationExternalities {
}
}
impl sp_externalities::ExtensionStore for ValidationExternalities {
impl pezsp_externalities::ExtensionStore for ValidationExternalities {
fn extension_by_type_id(&mut self, type_id: TypeId) -> Option<&mut dyn Any> {
self.0.get_mut(type_id)
}
@@ -340,35 +340,35 @@ impl sp_externalities::ExtensionStore for ValidationExternalities {
fn register_extension_with_type_id(
&mut self,
type_id: TypeId,
extension: Box<dyn sp_externalities::Extension>,
) -> Result<(), sp_externalities::Error> {
extension: Box<dyn pezsp_externalities::Extension>,
) -> Result<(), pezsp_externalities::Error> {
self.0.register_with_type_id(type_id, extension)
}
fn deregister_extension_by_type_id(
&mut self,
type_id: TypeId,
) -> Result<(), sp_externalities::Error> {
) -> Result<(), pezsp_externalities::Error> {
if self.0.deregister(type_id) {
Ok(())
} else {
Err(sp_externalities::Error::ExtensionIsNotRegistered(type_id))
Err(pezsp_externalities::Error::ExtensionIsNotRegistered(type_id))
}
}
}
struct ReadRuntimeVersion;
impl sp_core::traits::ReadRuntimeVersion for ReadRuntimeVersion {
impl pezsp_core::traits::ReadRuntimeVersion for ReadRuntimeVersion {
fn read_runtime_version(
&self,
wasm_code: &[u8],
_ext: &mut dyn sp_externalities::Externalities,
_ext: &mut dyn pezsp_externalities::Externalities,
) -> Result<Vec<u8>, String> {
let blob = RuntimeBlob::uncompress_if_needed(wasm_code)
.map_err(|e| format!("Failed to read the PVF runtime blob: {:?}", e))?;
match sc_executor::read_embedded_version(&blob)
match pezsc_executor::read_embedded_version(&blob)
.map_err(|e| format!("Failed to read the static section from the PVF blob: {:?}", e))?
{
Some(version) => {
+3 -3
View File
@@ -28,12 +28,12 @@ pub mod worker_dir;
pub use cpu_time::ProcessTime;
// Used by `decl_worker_main!`.
pub use sp_tracing;
pub use pezsp_tracing;
const LOG_TARGET: &str = "teyrchain::pvf-common";
use codec::{Decode, Encode};
use sp_core::H256;
use pezsp_core::H256;
use std::{
io::{self, Read, Write},
mem,
@@ -95,7 +95,7 @@ pub struct ArtifactChecksum(H256);
/// Compute the checksum of the given artifact.
pub fn compute_checksum(data: &[u8]) -> ArtifactChecksum {
ArtifactChecksum(H256::from_slice(&sp_crypto_hashing::twox_256(data)))
ArtifactChecksum(H256::from_slice(&pezsp_crypto_hashing::twox_256(data)))
}
#[cfg(all(test, not(feature = "test-utils")))]
+1 -1
View File
@@ -50,7 +50,7 @@ impl PvfPrepData {
validation_code_bomb_limit: u32,
) -> Self {
let maybe_compressed_code = Arc::new(code);
let code_hash = sp_crypto_hashing::blake2_256(&maybe_compressed_code).into();
let code_hash = pezsp_crypto_hashing::blake2_256(&maybe_compressed_code).into();
let executor_params = Arc::new(executor_params);
Self {
maybe_compressed_code,
@@ -59,7 +59,7 @@ macro_rules! decl_worker_main {
#[cfg(target_os = "linux")]
use $crate::worker::security;
$crate::sp_tracing::try_init_simple();
$crate::pezsp_tracing::try_init_simple();
let args = std::env::args().collect::<Vec<_>>();
if args.len() == 1 {
@@ -34,7 +34,7 @@
//! reasons.
//!
//! Considering `io_uring`'s status discussed above, and that it very likely would get detected
//! either by our [static analysis](https://github.com/paritytech/polkadot-sdk/pull/1663) or by
//! either by our [static analysis](https://github.com/pezkuwichain/kurdistan-sdk/issues/106) or by
//! testing, we think it is safe to block it.
//!
//! ## Consensus analysis
@@ -25,7 +25,7 @@ pezkuwi-node-primitives = { workspace = true, default-features = true }
pezkuwi-primitives = { workspace = true, default-features = true }
pezkuwi-teyrchain-primitives = { workspace = true, default-features = true }
sp-maybe-compressed-blob = { workspace = true, default-features = true }
pezsp-maybe-compressed-blob = { workspace = true, default-features = true }
[features]
builder = []
@@ -218,7 +218,7 @@ pub fn worker_entrypoint(
let compiled_artifact_blob = Arc::new(compiled_artifact_blob);
let raw_block_data =
match sp_maybe_compressed_blob::decompress(&pov.block_data.0, POV_BOMB_LIMIT) {
match pezsp_maybe_compressed_blob::decompress(&pov.block_data.0, POV_BOMB_LIMIT) {
Ok(data) => data,
Err(_) => {
send_result::<WorkerResponse, WorkerError>(
@@ -519,7 +519,7 @@ fn handle_child_process(
///
/// # Background
///
/// Wasmtime powers the Substrate Executor. It compiles the wasm bytecode into native code.
/// Wasmtime powers the Bizinikiwi Executor. It compiles the wasm bytecode into native code.
/// That native code does not create any stacks and just reuses the stack of the thread that
/// wasmtime was invoked from.
///
@@ -29,7 +29,7 @@ codec = { features = ["derive"], workspace = true }
pezkuwi-node-core-pvf-common = { workspace = true, default-features = true }
pezkuwi-primitives = { workspace = true, default-features = true }
sp-maybe-compressed-blob = { workspace = true, default-features = true }
pezsp-maybe-compressed-blob = { workspace = true, default-features = true }
[target.'cfg(target_os = "linux")'.dependencies]
tikv-jemallocator = { workspace = true }
@@ -26,7 +26,7 @@ use std::time::Duration;
fn do_prepare_runtime(pvf: PvfPrepData) {
let maybe_compressed_code = pvf.maybe_compressed_code();
let raw_validation_code =
sp_maybe_compressed_blob::decompress(&maybe_compressed_code, usize::MAX).unwrap();
pezsp_maybe_compressed_blob::decompress(&maybe_compressed_code, usize::MAX).unwrap();
let blob = match prevalidate(&raw_validation_code) {
Err(err) => panic!("{:?}", err),
@@ -41,7 +41,7 @@ fn do_prepare_runtime(pvf: PvfPrepData) {
fn prepare_pezkuwichain_runtime(c: &mut Criterion) {
let blob = pezkuwichain_runtime::WASM_BINARY.unwrap();
let pvf = match sp_maybe_compressed_blob::decompress(&blob, 64 * 1024 * 1024) {
let pvf = match pezsp_maybe_compressed_blob::decompress(&blob, 64 * 1024 * 1024) {
Ok(code) => PvfPrepData::from_code(
code.into_owned(),
ExecutorParams::default(),
@@ -298,7 +298,7 @@ pub fn worker_entrypoint(
fn prepare_artifact(pvf: PvfPrepData) -> Result<PrepareOutcome, PrepareError> {
let maybe_compressed_code = pvf.maybe_compressed_code();
let raw_validation_code = sp_maybe_compressed_blob::decompress(
let raw_validation_code = pezsp_maybe_compressed_blob::decompress(
&maybe_compressed_code,
pvf.validation_code_bomb_limit() as usize,
)
@@ -24,7 +24,7 @@
//!
//! Currently we are only logging these for the purposes of gathering data. In the future, we may
//! use these stats to reject PVFs during pre-checking. See
//! <https://github.com/paritytech/polkadot/issues/6472#issuecomment-1381941762> for more
//! <https://github.com/pezkuwichain/kurdistan-sdk/issues/166#issuecomment-1381941762> for more
//! background.
/// Module for the memory tracker. The memory tracker runs in its own thread, where it polls memory
+1 -1
View File
@@ -910,7 +910,7 @@ impl Unscheduled {
mod tests {
use pezkuwi_node_primitives::BlockData;
use pezkuwi_node_subsystem_test_helpers::mock::new_leaf;
use sp_core::H256;
use pezsp_core::H256;
use super::*;
use crate::testing::artifact_id;
+1 -1
View File
@@ -1055,7 +1055,7 @@ pub(crate) mod tests {
use assert_matches::assert_matches;
use futures::future::BoxFuture;
use pezkuwi_node_primitives::BlockData;
use sp_core::H256;
use pezsp_core::H256;
const TEST_EXECUTION_TIMEOUT: Duration = Duration::from_secs(3);
pub(crate) const TEST_PREPARATION_TIMEOUT: Duration = Duration::from_secs(30);
@@ -33,7 +33,7 @@ use pezkuwi_node_core_pvf_common::{
worker_dir, SecurityStatus,
};
use sp_core::hexdisplay::HexDisplay;
use pezsp_core::hexdisplay::HexDisplay;
use std::{
path::{Path, PathBuf},
time::Duration,
+1 -1
View File
@@ -40,7 +40,7 @@ pub fn validate_candidate(
use pezkuwi_node_core_pvf_common::executor_interface::{prepare, prevalidate};
use pezkuwi_node_core_pvf_execute_worker::execute_artifact;
let code = sp_maybe_compressed_blob::decompress(code, 10 * 1024 * 1024)
let code = pezsp_maybe_compressed_blob::decompress(code, 10 * 1024 * 1024)
.expect("Decompressing code failed");
let blob = prevalidate(&code)?;
@@ -238,7 +238,7 @@ impl WorkerHandle {
let mut command = process::Command::new(program.as_ref());
command.env_clear();
command.env("RUST_LOG", sc_tracing::logging::get_directives().join(","));
command.env("RUST_LOG", pezsc_tracing::logging::get_directives().join(","));
let mut child = command
.args(extra_args)
+1 -1
View File
@@ -23,7 +23,7 @@ use pezkuwi_primitives::PersistedValidationData;
use pezkuwi_teyrchain_primitives::primitives::{
BlockData as GenericBlockData, HeadData as GenericHeadData,
};
use sp_core::H256;
use pezsp_core::H256;
use test_teyrchain_adder::{hash_state, BlockData, HeadData};
#[tokio::test]
+4 -4
View File
@@ -31,7 +31,7 @@ use pezkuwi_primitives::{
ExecutorParam, ExecutorParams, Hash, PersistedValidationData, PvfExecKind as RuntimePvfExecKind,
};
use pezkuwi_teyrchain_primitives::primitives::{BlockData, ValidationResult};
use sp_core::H256;
use pezsp_core::H256;
const VALIDATION_CODE_BOMB_LIMIT: u32 = 30 * 1024 * 1024;
@@ -789,7 +789,7 @@ async fn artifact_does_reprepare_on_meaningful_exec_parameter_change() {
async fn invalid_compressed_code_fails_prechecking() {
let host = TestHost::new().await;
let raw_code = vec![2u8; VALIDATION_CODE_BOMB_LIMIT as usize + 1];
let validation_code = sp_maybe_compressed_blob::compress_strongly(
let validation_code = pezsp_maybe_compressed_blob::compress_strongly(
&raw_code,
VALIDATION_CODE_BOMB_LIMIT as usize + 1,
)
@@ -813,7 +813,7 @@ async fn invalid_compressed_code_fails_validation() {
let pov = PoV { block_data: BlockData(Vec::new()) };
let raw_code = vec![2u8; VALIDATION_CODE_BOMB_LIMIT as usize + 1];
let validation_code = sp_maybe_compressed_blob::compress_strongly(
let validation_code = pezsp_maybe_compressed_blob::compress_strongly(
&raw_code,
VALIDATION_CODE_BOMB_LIMIT as usize + 1,
)
@@ -841,7 +841,7 @@ async fn invalid_compressed_pov_fails_validation() {
};
let raw_block_data = vec![1u8; POV_BOMB_LIMIT + 1];
let block_data =
sp_maybe_compressed_blob::compress_weakly(&raw_block_data, POV_BOMB_LIMIT + 1).unwrap();
pezsp_maybe_compressed_blob::compress_weakly(&raw_block_data, POV_BOMB_LIMIT + 1).unwrap();
let pov = PoV { block_data: BlockData(block_data) };
let result = host
+1 -1
View File
@@ -30,7 +30,7 @@ use pezkuwi_teyrchain_primitives::primitives::{
};
use procfs::process;
use rusty_fork::rusty_fork_test;
use sp_core::H256;
use pezsp_core::H256;
use std::{future::Future, sync::Arc, time::Duration};
use test_teyrchain_adder::{hash_state, BlockData, HeadData};
+7 -7
View File
@@ -16,7 +16,7 @@ futures = { workspace = true }
gum = { workspace = true, default-features = true }
schnellru = { workspace = true }
sp-consensus-babe = { workspace = true, default-features = true }
pezsp-consensus-babe = { workspace = true, default-features = true }
pezkuwi-node-metrics = { workspace = true, default-features = true }
pezkuwi-node-subsystem = { workspace = true, default-features = true }
@@ -29,9 +29,9 @@ futures = { features = ["thread-pool"], workspace = true }
pezkuwi-node-primitives = { workspace = true, default-features = true }
pezkuwi-node-subsystem-test-helpers = { workspace = true }
pezkuwi-primitives-test-helpers = { workspace = true }
sp-api = { workspace = true, default-features = true }
sp-core = { workspace = true, default-features = true }
sp-keyring = { workspace = true, default-features = true }
pezsp-api = { workspace = true, default-features = true }
pezsp-core = { workspace = true, default-features = true }
pezsp-keyring = { workspace = true, default-features = true }
[features]
runtime-benchmarks = [
@@ -43,7 +43,7 @@ runtime-benchmarks = [
"pezkuwi-node-subsystem/runtime-benchmarks",
"pezkuwi-primitives-test-helpers/runtime-benchmarks",
"pezkuwi-primitives/runtime-benchmarks",
"sp-api/runtime-benchmarks",
"sp-consensus-babe/runtime-benchmarks",
"sp-keyring/runtime-benchmarks",
"pezsp-api/runtime-benchmarks",
"pezsp-consensus-babe/runtime-benchmarks",
"pezsp-keyring/runtime-benchmarks",
]
+1 -1
View File
@@ -17,7 +17,7 @@
use std::collections::{btree_map::BTreeMap, VecDeque};
use schnellru::{ByLength, LruMap};
use sp_consensus_babe::Epoch;
use pezsp_consensus_babe::Epoch;
use pezkuwi_primitives::{
async_backing::{self, Constraints},
+1 -1
View File
@@ -394,7 +394,7 @@ where
let metrics = self.metrics.clone();
let (sender, receiver) = oneshot::channel();
// TODO: make the cache great again https://github.com/paritytech/polkadot/issues/5546
// TODO: make the cache great again https://github.com/pezkuwichain/kurdistan-sdk/issues/159
let request = match self.query_cache(relay_parent, request) {
Some(request) => request,
None => return,
+24 -24
View File
@@ -31,8 +31,8 @@ use pezkuwi_primitives::{
use pezkuwi_primitives_test_helpers::{
dummy_committed_candidate_receipt_v2, dummy_validation_code,
};
use sp_api::ApiError;
use sp_core::testing::TaskExecutor;
use pezsp_api::ApiError;
use pezsp_core::testing::TaskExecutor;
use std::{
collections::{BTreeMap, HashMap, VecDeque},
sync::{Arc, Mutex},
@@ -270,7 +270,7 @@ impl RuntimeApiSubsystemClient for MockSubsystemClient {
todo!("Not required for tests")
}
async fn current_epoch(&self, _: Hash) -> Result<sp_consensus_babe::Epoch, ApiError> {
async fn current_epoch(&self, _: Hash) -> Result<pezsp_consensus_babe::Epoch, ApiError> {
Ok(self.babe_epoch.as_ref().unwrap().clone())
}
@@ -338,7 +338,7 @@ fn requests_authorities() {
let (ctx, mut ctx_handle) = make_subsystem_context(TaskExecutor::new());
let subsystem_client = Arc::new(MockSubsystemClient::default());
let relay_parent = [1; 32].into();
let spawner = sp_core::testing::TaskExecutor::new();
let spawner = pezsp_core::testing::TaskExecutor::new();
let subsystem =
RuntimeApiSubsystem::new(subsystem_client.clone(), Metrics(None), SpawnGlue(spawner));
@@ -365,7 +365,7 @@ fn requests_validators() {
let (ctx, mut ctx_handle) = make_subsystem_context(TaskExecutor::new());
let subsystem_client = Arc::new(MockSubsystemClient::default());
let relay_parent = [1; 32].into();
let spawner = sp_core::testing::TaskExecutor::new();
let spawner = pezsp_core::testing::TaskExecutor::new();
let subsystem =
RuntimeApiSubsystem::new(subsystem_client.clone(), Metrics(None), SpawnGlue(spawner));
@@ -392,7 +392,7 @@ fn requests_validator_groups() {
let (ctx, mut ctx_handle) = make_subsystem_context(TaskExecutor::new());
let subsystem_client = Arc::new(MockSubsystemClient::default());
let relay_parent = [1; 32].into();
let spawner = sp_core::testing::TaskExecutor::new();
let spawner = pezsp_core::testing::TaskExecutor::new();
let subsystem =
RuntimeApiSubsystem::new(subsystem_client.clone(), Metrics(None), SpawnGlue(spawner));
@@ -419,7 +419,7 @@ fn requests_availability_cores() {
let (ctx, mut ctx_handle) = make_subsystem_context(TaskExecutor::new());
let subsystem_client = Arc::new(MockSubsystemClient::default());
let relay_parent = [1; 32].into();
let spawner = sp_core::testing::TaskExecutor::new();
let spawner = pezsp_core::testing::TaskExecutor::new();
let subsystem =
RuntimeApiSubsystem::new(subsystem_client.clone(), Metrics(None), SpawnGlue(spawner));
@@ -447,7 +447,7 @@ fn requests_persisted_validation_data() {
let relay_parent = [1; 32].into();
let para_a = ParaId::from(5_u32);
let para_b = ParaId::from(6_u32);
let spawner = sp_core::testing::TaskExecutor::new();
let spawner = pezsp_core::testing::TaskExecutor::new();
let mut subsystem_client = MockSubsystemClient::default();
subsystem_client.validation_data.insert(para_a, Default::default());
@@ -494,7 +494,7 @@ fn requests_assumed_validation_data() {
let relay_parent = [1; 32].into();
let para_a = ParaId::from(5_u32);
let para_b = ParaId::from(6_u32);
let spawner = sp_core::testing::TaskExecutor::new();
let spawner = pezsp_core::testing::TaskExecutor::new();
let validation_code = ValidationCode(vec![1, 2, 3]);
let expected_data_hash = <PersistedValidationData as Default>::default().hash();
@@ -549,7 +549,7 @@ fn requests_check_validation_outputs() {
let para_a = ParaId::from(5_u32);
let para_b = ParaId::from(6_u32);
let commitments = pezkuwi_primitives::CandidateCommitments::default();
let spawner = sp_core::testing::TaskExecutor::new();
let spawner = pezsp_core::testing::TaskExecutor::new();
subsystem_client.validation_outputs_results.insert(para_a, false);
subsystem_client.validation_outputs_results.insert(para_b, true);
@@ -600,7 +600,7 @@ fn requests_session_index_for_child() {
let (ctx, mut ctx_handle) = make_subsystem_context(TaskExecutor::new());
let subsystem_client = Arc::new(MockSubsystemClient::default());
let relay_parent = [1; 32].into();
let spawner = sp_core::testing::TaskExecutor::new();
let spawner = pezsp_core::testing::TaskExecutor::new();
let subsystem =
RuntimeApiSubsystem::new(subsystem_client.clone(), Metrics(None), SpawnGlue(spawner));
@@ -646,7 +646,7 @@ fn requests_session_info() {
let session_index = 1;
subsystem_client.session_info.insert(session_index, dummy_session_info());
let subsystem_client = Arc::new(subsystem_client);
let spawner = sp_core::testing::TaskExecutor::new();
let spawner = pezsp_core::testing::TaskExecutor::new();
let relay_parent = [1; 32].into();
@@ -680,7 +680,7 @@ fn requests_validation_code() {
let relay_parent = [1; 32].into();
let para_a = ParaId::from(5_u32);
let para_b = ParaId::from(6_u32);
let spawner = sp_core::testing::TaskExecutor::new();
let spawner = pezsp_core::testing::TaskExecutor::new();
let validation_code = dummy_validation_code();
let mut subsystem_client = MockSubsystemClient::default();
@@ -728,7 +728,7 @@ fn requests_candidate_pending_availability() {
let relay_parent = [1; 32].into();
let para_a = ParaId::from(5_u32);
let para_b = ParaId::from(6_u32);
let spawner = sp_core::testing::TaskExecutor::new();
let spawner = pezsp_core::testing::TaskExecutor::new();
let candidate_receipt = dummy_committed_candidate_receipt_v2(relay_parent);
let mut subsystem_client = MockSubsystemClient::default();
@@ -778,7 +778,7 @@ fn requests_candidate_events() {
let (ctx, mut ctx_handle) = make_subsystem_context(TaskExecutor::new());
let subsystem_client = Arc::new(MockSubsystemClient::default());
let relay_parent = [1; 32].into();
let spawner = sp_core::testing::TaskExecutor::new();
let spawner = pezsp_core::testing::TaskExecutor::new();
let subsystem =
RuntimeApiSubsystem::new(subsystem_client.clone(), Metrics(None), SpawnGlue(spawner));
@@ -807,7 +807,7 @@ fn requests_dmq_contents() {
let relay_parent = [1; 32].into();
let para_a = ParaId::from(5_u32);
let para_b = ParaId::from(6_u32);
let spawner = sp_core::testing::TaskExecutor::new();
let spawner = pezsp_core::testing::TaskExecutor::new();
let subsystem_client = Arc::new({
let mut subsystem_client = MockSubsystemClient::default();
@@ -857,7 +857,7 @@ fn requests_inbound_hrmp_channels_contents() {
let para_a = ParaId::from(99_u32);
let para_b = ParaId::from(66_u32);
let para_c = ParaId::from(33_u32);
let spawner = sp_core::testing::TaskExecutor::new();
let spawner = pezsp_core::testing::TaskExecutor::new();
let para_b_inbound_channels = [
(para_a, vec![]),
@@ -909,7 +909,7 @@ fn requests_inbound_hrmp_channels_contents() {
#[test]
fn requests_validation_code_by_hash() {
let (ctx, mut ctx_handle) = make_subsystem_context(TaskExecutor::new());
let spawner = sp_core::testing::TaskExecutor::new();
let spawner = pezsp_core::testing::TaskExecutor::new();
let (subsystem_client, validation_code) = {
let mut subsystem_client = MockSubsystemClient::default();
@@ -955,7 +955,7 @@ fn multiple_requests_in_parallel_are_working() {
let (ctx, mut ctx_handle) = make_subsystem_context(TaskExecutor::new());
let subsystem_client = Arc::new(MockSubsystemClient::default());
let relay_parent = [1; 32].into();
let spawner = sp_core::testing::TaskExecutor::new();
let spawner = pezsp_core::testing::TaskExecutor::new();
let mutex = subsystem_client.availability_cores_wait.clone();
let subsystem =
@@ -1019,7 +1019,7 @@ fn requests_babe_epoch() {
subsystem_client.babe_epoch = Some(epoch.clone());
let subsystem_client = Arc::new(subsystem_client);
let relay_parent = [1; 32].into();
let spawner = sp_core::testing::TaskExecutor::new();
let spawner = pezsp_core::testing::TaskExecutor::new();
let subsystem =
RuntimeApiSubsystem::new(subsystem_client.clone(), Metrics(None), SpawnGlue(spawner));
@@ -1043,7 +1043,7 @@ fn requests_babe_epoch() {
#[test]
fn requests_submit_pvf_check_statement() {
let (ctx, mut ctx_handle) = make_subsystem_context(TaskExecutor::new());
let spawner = sp_core::testing::TaskExecutor::new();
let spawner = pezsp_core::testing::TaskExecutor::new();
let subsystem_client = Arc::new(MockSubsystemClient::default());
let subsystem =
@@ -1095,7 +1095,7 @@ fn requests_submit_pvf_check_statement() {
session_index: 1,
validator_index: 1.into(),
};
let sig = sp_keyring::Sr25519Keyring::Alice.sign(&stmt.signing_payload()).into();
let sig = pezsp_keyring::Sr25519Keyring::Alice.sign(&stmt.signing_payload()).into();
(stmt, sig)
}
}
@@ -1103,7 +1103,7 @@ fn requests_submit_pvf_check_statement() {
#[test]
fn requests_pvfs_require_precheck() {
let (ctx, mut ctx_handle) = make_subsystem_context(TaskExecutor::new());
let spawner = sp_core::testing::TaskExecutor::new();
let spawner = pezsp_core::testing::TaskExecutor::new();
let subsystem_client = Arc::new({
let mut subsystem_client = MockSubsystemClient::default();
@@ -1139,7 +1139,7 @@ fn requests_validation_code_hash() {
let relay_parent = [1; 32].into();
let para_a = ParaId::from(5_u32);
let para_b = ParaId::from(6_u32);
let spawner = sp_core::testing::TaskExecutor::new();
let spawner = pezsp_core::testing::TaskExecutor::new();
let validation_code_hash = dummy_validation_code().hash();
let mut subsystem_client = MockSubsystemClient::default();
@@ -19,8 +19,8 @@ gum = { 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 }
sp-blockchain = { workspace = true, default-features = true }
sp-inherents = { workspace = true, default-features = true }
pezsp-blockchain = { workspace = true, default-features = true }
pezsp-inherents = { workspace = true, default-features = true }
thiserror = { workspace = true }
[features]
@@ -29,6 +29,6 @@ runtime-benchmarks = [
"pezkuwi-node-subsystem/runtime-benchmarks",
"pezkuwi-overseer/runtime-benchmarks",
"pezkuwi-primitives/runtime-benchmarks",
"sp-blockchain/runtime-benchmarks",
"sp-inherents/runtime-benchmarks",
"pezsp-blockchain/runtime-benchmarks",
"pezsp-inherents/runtime-benchmarks",
]
@@ -38,13 +38,13 @@ pub(crate) const LOG_TARGET: &str = "teyrchain::teyrchains-inherent";
const PROVISIONER_TIMEOUT: time::Duration = core::time::Duration::from_millis(2500);
/// Provides the teyrchains inherent data.
pub struct TeyrchainsInherentDataProvider<C: sp_blockchain::HeaderBackend<Block>> {
pub struct TeyrchainsInherentDataProvider<C: pezsp_blockchain::HeaderBackend<Block>> {
pub client: Arc<C>,
pub overseer: pezkuwi_overseer::Handle,
pub parent: Hash,
}
impl<C: sp_blockchain::HeaderBackend<Block>> TeyrchainsInherentDataProvider<C> {
impl<C: pezsp_blockchain::HeaderBackend<Block>> TeyrchainsInherentDataProvider<C> {
/// Create a new [`Self`].
pub fn new(client: Arc<C>, overseer: pezkuwi_overseer::Handle, parent: Hash) -> Self {
TeyrchainsInherentDataProvider { client, overseer, parent }
@@ -125,20 +125,20 @@ impl<C: sp_blockchain::HeaderBackend<Block>> TeyrchainsInherentDataProvider<C> {
}
#[async_trait::async_trait]
impl<C: sp_blockchain::HeaderBackend<Block>> sp_inherents::InherentDataProvider
impl<C: pezsp_blockchain::HeaderBackend<Block>> pezsp_inherents::InherentDataProvider
for TeyrchainsInherentDataProvider<C>
{
async fn provide_inherent_data(
&self,
dst_inherent_data: &mut sp_inherents::InherentData,
) -> Result<(), sp_inherents::Error> {
dst_inherent_data: &mut pezsp_inherents::InherentData,
) -> Result<(), pezsp_inherents::Error> {
let inherent_data = TeyrchainsInherentDataProvider::create(
self.client.clone(),
self.overseer.clone(),
self.parent,
)
.await
.map_err(|e| sp_inherents::Error::Application(Box::new(e)))?;
.map_err(|e| pezsp_inherents::Error::Application(Box::new(e)))?;
dst_inherent_data
.put_data(pezkuwi_primitives::TEYRCHAINS_INHERENT_IDENTIFIER, &inherent_data)
@@ -146,9 +146,9 @@ impl<C: sp_blockchain::HeaderBackend<Block>> sp_inherents::InherentDataProvider
async fn try_handle_error(
&self,
_identifier: &sp_inherents::InherentIdentifier,
_identifier: &pezsp_inherents::InherentIdentifier,
_error: &[u8],
) -> Option<Result<(), sp_inherents::Error>> {
) -> Option<Result<(), pezsp_inherents::Error>> {
// Inherent isn't checked and can not return any error
None
}
@@ -157,7 +157,7 @@ impl<C: sp_blockchain::HeaderBackend<Block>> sp_inherents::InherentDataProvider
#[derive(thiserror::Error, Debug)]
pub enum Error {
#[error("Blockchain error")]
Blockchain(#[from] sp_blockchain::Error),
Blockchain(#[from] pezsp_blockchain::Error),
#[error("Timeout: provisioner did not return inherent data after {:?}", PROVISIONER_TIMEOUT)]
Timeout,
#[error("Could not find the parent header in the blockchain: {:?}", _0)]