1c0e57d984
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.
87 lines
2.9 KiB
Rust
87 lines
2.9 KiB
Rust
// Copyright (C) Parity Technologies (UK) Ltd.
|
|
// This file is part of Pezcumulus.
|
|
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
|
|
|
|
// Pezcumulus is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU General Public License as published by
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
// (at your option) any later version.
|
|
|
|
// Pezcumulus is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU General Public License for more details.
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
// along with Pezcumulus. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
//! The AuRa consensus algorithm for teyrchains.
|
|
//!
|
|
//! This extends the Bizinikiwi provided AuRa consensus implementation to make it compatible for
|
|
//! teyrchains.
|
|
//!
|
|
//! For more information about AuRa, the Bizinikiwi crate should be checked.
|
|
|
|
use codec::Encode;
|
|
use cumulus_primitives_core::PersistedValidationData;
|
|
|
|
use cumulus_primitives_core::relay_chain::HeadData;
|
|
use pezkuwi_primitives::{BlockNumber as RBlockNumber, Hash as RHash};
|
|
use pezsp_runtime::traits::{Block as BlockT, NumberFor};
|
|
use std::{fs, fs::File, path::PathBuf};
|
|
|
|
mod import_queue;
|
|
|
|
pub use import_queue::{build_verifier, import_queue, BuildVerifierParams, ImportQueueParams};
|
|
use pezkuwi_node_primitives::PoV;
|
|
pub use pezsc_consensus_aura::{
|
|
slot_duration, standalone::slot_duration_at, AuraVerifier, BuildAuraWorkerParams,
|
|
SlotProportion,
|
|
};
|
|
pub use pezsc_consensus_slots::InherentDataProviderExt;
|
|
|
|
pub mod collator;
|
|
pub mod collators;
|
|
pub mod equivocation_import_queue;
|
|
|
|
const LOG_TARGET: &str = "aura::pezcumulus";
|
|
|
|
/// Export the given `pov` to the file system at `path`.
|
|
///
|
|
/// The file will be named `block_hash_block_number.pov`.
|
|
///
|
|
/// The `parent_header`, `relay_parent_storage_root` and `relay_parent_number` will also be
|
|
/// stored in the file alongside the `pov`. This enables stateless validation of the `pov`.
|
|
pub(crate) fn export_pov_to_path<Block: BlockT>(
|
|
path: PathBuf,
|
|
pov: PoV,
|
|
block_hash: Block::Hash,
|
|
block_number: NumberFor<Block>,
|
|
parent_header: Block::Header,
|
|
relay_parent_storage_root: RHash,
|
|
relay_parent_number: RBlockNumber,
|
|
max_pov_size: u32,
|
|
) {
|
|
if let Err(error) = fs::create_dir_all(&path) {
|
|
tracing::error!(target: LOG_TARGET, %error, path = %path.display(), "Failed to create PoV export directory");
|
|
return;
|
|
}
|
|
|
|
let mut file = match File::create(path.join(format!("{block_hash:?}_{block_number}.pov"))) {
|
|
Ok(f) => f,
|
|
Err(error) => {
|
|
tracing::error!(target: LOG_TARGET, %error, "Failed to export PoV.");
|
|
return;
|
|
},
|
|
};
|
|
|
|
pov.encode_to(&mut file);
|
|
PersistedValidationData {
|
|
parent_head: HeadData(parent_header.encode()),
|
|
relay_parent_number,
|
|
relay_parent_storage_root,
|
|
max_pov_size,
|
|
}
|
|
.encode_to(&mut file);
|
|
}
|