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
+38 -38
View File
@@ -17,9 +17,9 @@
//! Code related to benchmarking a node.
use pezkuwi_primitives::AccountId;
use sc_client_api::UsageProvider;
use sp_keyring::Sr25519Keyring;
use sp_runtime::OpaqueExtrinsic;
use pezsc_client_api::UsageProvider;
use pezsp_keyring::Sr25519Keyring;
use pezsp_runtime::OpaqueExtrinsic;
use crate::*;
@@ -102,7 +102,7 @@ impl TransferKeepAliveBuilder {
}
}
impl frame_benchmarking_cli::ExtrinsicBuilder for TransferKeepAliveBuilder {
impl pezframe_benchmarking_cli::ExtrinsicBuilder for TransferKeepAliveBuilder {
fn pallet(&self) -> &str {
"balances"
}
@@ -142,28 +142,28 @@ fn zagros_sign_call(
nonce: u32,
current_block: u64,
period: u64,
genesis: sp_core::H256,
acc: sp_core::sr25519::Pair,
genesis: pezsp_core::H256,
acc: pezsp_core::sr25519::Pair,
) -> OpaqueExtrinsic {
use codec::Encode;
use sp_core::Pair;
use pezsp_core::Pair;
use zagros_runtime as runtime;
let tx_ext: runtime::TxExtension = (
frame_system::AuthorizeCall::<runtime::Runtime>::new(),
frame_system::CheckNonZeroSender::<runtime::Runtime>::new(),
frame_system::CheckSpecVersion::<runtime::Runtime>::new(),
frame_system::CheckTxVersion::<runtime::Runtime>::new(),
frame_system::CheckGenesis::<runtime::Runtime>::new(),
frame_system::CheckMortality::<runtime::Runtime>::from(sp_runtime::generic::Era::mortal(
pezframe_system::AuthorizeCall::<runtime::Runtime>::new(),
pezframe_system::CheckNonZeroSender::<runtime::Runtime>::new(),
pezframe_system::CheckSpecVersion::<runtime::Runtime>::new(),
pezframe_system::CheckTxVersion::<runtime::Runtime>::new(),
pezframe_system::CheckGenesis::<runtime::Runtime>::new(),
pezframe_system::CheckMortality::<runtime::Runtime>::from(pezsp_runtime::generic::Era::mortal(
period,
current_block,
)),
frame_system::CheckNonce::<runtime::Runtime>::from(nonce),
frame_system::CheckWeight::<runtime::Runtime>::new(),
pallet_transaction_payment::ChargeTransactionPayment::<runtime::Runtime>::from(0),
frame_metadata_hash_extension::CheckMetadataHash::<runtime::Runtime>::new(false),
frame_system::WeightReclaim::<runtime::Runtime>::new(),
pezframe_system::CheckNonce::<runtime::Runtime>::from(nonce),
pezframe_system::CheckWeight::<runtime::Runtime>::new(),
pezpallet_transaction_payment::ChargeTransactionPayment::<runtime::Runtime>::from(0),
pezframe_metadata_hash_extension::CheckMetadataHash::<runtime::Runtime>::new(false),
pezframe_system::WeightReclaim::<runtime::Runtime>::new(),
)
.into();
@@ -188,7 +188,7 @@ fn zagros_sign_call(
let signature = payload.using_encoded(|p| acc.sign(p));
runtime::UncheckedExtrinsic::new_signed(
call,
sp_runtime::AccountId32::from(acc.public()).into(),
pezsp_runtime::AccountId32::from(acc.public()).into(),
pezkuwi_core_primitives::Signature::Sr25519(signature),
tx_ext,
)
@@ -201,28 +201,28 @@ fn pezkuwichain_sign_call(
nonce: u32,
current_block: u64,
period: u64,
genesis: sp_core::H256,
acc: sp_core::sr25519::Pair,
genesis: pezsp_core::H256,
acc: pezsp_core::sr25519::Pair,
) -> OpaqueExtrinsic {
use codec::Encode;
use pezkuwichain_runtime as runtime;
use sp_core::Pair;
use pezsp_core::Pair;
let tx_ext: runtime::TxExtension = (
frame_system::AuthorizeCall::<runtime::Runtime>::new(),
frame_system::CheckNonZeroSender::<runtime::Runtime>::new(),
frame_system::CheckSpecVersion::<runtime::Runtime>::new(),
frame_system::CheckTxVersion::<runtime::Runtime>::new(),
frame_system::CheckGenesis::<runtime::Runtime>::new(),
frame_system::CheckMortality::<runtime::Runtime>::from(sp_runtime::generic::Era::mortal(
pezframe_system::AuthorizeCall::<runtime::Runtime>::new(),
pezframe_system::CheckNonZeroSender::<runtime::Runtime>::new(),
pezframe_system::CheckSpecVersion::<runtime::Runtime>::new(),
pezframe_system::CheckTxVersion::<runtime::Runtime>::new(),
pezframe_system::CheckGenesis::<runtime::Runtime>::new(),
pezframe_system::CheckMortality::<runtime::Runtime>::from(pezsp_runtime::generic::Era::mortal(
period,
current_block,
)),
frame_system::CheckNonce::<runtime::Runtime>::from(nonce),
frame_system::CheckWeight::<runtime::Runtime>::new(),
pallet_transaction_payment::ChargeTransactionPayment::<runtime::Runtime>::from(0),
frame_metadata_hash_extension::CheckMetadataHash::<runtime::Runtime>::new(false),
frame_system::WeightReclaim::<runtime::Runtime>::new(),
pezframe_system::CheckNonce::<runtime::Runtime>::from(nonce),
pezframe_system::CheckWeight::<runtime::Runtime>::new(),
pezpallet_transaction_payment::ChargeTransactionPayment::<runtime::Runtime>::from(0),
pezframe_metadata_hash_extension::CheckMetadataHash::<runtime::Runtime>::new(false),
pezframe_system::WeightReclaim::<runtime::Runtime>::new(),
)
.into();
@@ -247,7 +247,7 @@ fn pezkuwichain_sign_call(
let signature = payload.using_encoded(|p| acc.sign(p));
runtime::UncheckedExtrinsic::new_signed(
call,
sp_runtime::AccountId32::from(acc.public()).into(),
pezsp_runtime::AccountId32::from(acc.public()).into(),
pezkuwi_core_primitives::Signature::Sr25519(signature),
tx_ext,
)
@@ -259,13 +259,13 @@ fn pezkuwichain_sign_call(
/// Not to be used outside of benchmarking since it returns mocked values.
pub fn benchmark_inherent_data(
header: pezkuwi_core_primitives::Header,
) -> std::result::Result<sp_inherents::InherentData, sp_inherents::Error> {
use sp_inherents::InherentDataProvider;
let mut inherent_data = sp_inherents::InherentData::new();
) -> std::result::Result<pezsp_inherents::InherentData, pezsp_inherents::Error> {
use pezsp_inherents::InherentDataProvider;
let mut inherent_data = pezsp_inherents::InherentData::new();
// Assume that all runtimes have the `timestamp` pallet.
let d = std::time::Duration::from_millis(0);
let timestamp = sp_timestamp::InherentDataProvider::new(d.into());
let timestamp = pezsp_timestamp::InherentDataProvider::new(d.into());
futures::executor::block_on(timestamp.provide_inherent_data(&mut inherent_data))?;
let para_data = pezkuwi_primitives::InherentData {
+59 -59
View File
@@ -29,7 +29,7 @@ use crate::{
teyrchains_db, workers, Chain, Error, FullBackend, FullClient, IdentifyVariant,
IsTeyrchainNode, GRANDPA_JUSTIFICATION_PERIOD, KEEP_FINALIZED_FOR_LIVE_NETWORKS,
};
use frame_benchmarking_cli::SUBSTRATE_REFERENCE_HARDWARE;
use pezframe_benchmarking_cli::BIZINIKIWI_REFERENCE_HARDWARE;
use gum::info;
use mmr_gadget::MmrGadget;
use pezkuwi_availability_recovery::FETCH_CHUNKS_THRESHOLD;
@@ -47,15 +47,15 @@ use pezkuwi_node_network_protocol::{
use pezkuwi_node_subsystem_types::DefaultSubsystemClient;
use pezkuwi_overseer::{Handle, OverseerConnector};
use pezkuwi_primitives::Block;
use sc_client_api::Backend;
use sc_network::config::FullNetworkConfiguration;
use sc_network_sync::WarpSyncConfig;
use sc_service::{Configuration, RpcHandlers, TaskManager};
use sc_sysinfo::Metric;
use sc_telemetry::TelemetryWorkerHandle;
use sc_transaction_pool_api::OffchainTransactionPoolFactory;
use sp_consensus_beefy::ecdsa_crypto;
use sp_runtime::traits::Block as BlockT;
use pezsc_client_api::Backend;
use pezsc_network::config::FullNetworkConfiguration;
use pezsc_network_sync::WarpSyncConfig;
use pezsc_service::{Configuration, RpcHandlers, TaskManager};
use pezsc_sysinfo::Metric;
use pezsc_telemetry::TelemetryWorkerHandle;
use pezsc_transaction_pool_api::OffchainTransactionPoolFactory;
use pezsp_consensus_beefy::ecdsa_crypto;
use pezsp_runtime::traits::Block as BlockT;
use std::{
collections::{HashMap, HashSet},
sync::Arc,
@@ -92,7 +92,7 @@ pub struct NewFullParams<OverseerGenerator: OverseerGen> {
pub overseer_message_channel_capacity_override: Option<usize>,
#[allow(dead_code)]
pub malus_finality_delay: Option<u32>,
pub hwbench: Option<sc_sysinfo::HwBench>,
pub hwbench: Option<pezsc_sysinfo::HwBench>,
/// Set of invulnerable AH collator `PeerId`s
pub invulnerable_ah_collators: HashSet<pezkuwi_node_network_protocol::PeerId>,
/// Override for `HOLD_OFF_DURATION` constant .
@@ -104,8 +104,8 @@ pub struct NewFull {
pub task_manager: TaskManager,
pub client: Arc<FullClient>,
pub overseer_handle: Option<Handle>,
pub network: Arc<dyn sc_network::service::traits::NetworkService>,
pub sync_service: Arc<sc_network_sync::SyncingService<Block>>,
pub network: Arc<dyn pezsc_network::service::traits::NetworkService>,
pub sync_service: Arc<pezsc_network_sync::SyncingService<Block>>,
pub rpc_handlers: RpcHandlers,
pub backend: Arc<FullBackend>,
}
@@ -113,7 +113,7 @@ pub struct NewFull {
pub struct PezkuwiServiceBuilder<OverseerGenerator, Network>
where
OverseerGenerator: OverseerGen,
Network: sc_network::NetworkBackend<Block, <Block as BlockT>::Hash>,
Network: pezsc_network::NetworkBackend<Block, <Block as BlockT>::Hash>,
{
config: Configuration,
params: NewFullParams<OverseerGenerator>,
@@ -125,7 +125,7 @@ where
impl<OverseerGenerator, Network> PezkuwiServiceBuilder<OverseerGenerator, Network>
where
OverseerGenerator: OverseerGen,
Network: sc_network::NetworkBackend<Block, <Block as BlockT>::Hash>,
Network: pezsc_network::NetworkBackend<Block, <Block as BlockT>::Hash>,
{
/// Create new pezkuwi service builder.
pub fn new(
@@ -157,7 +157,7 @@ where
let partial_components =
new_partial::<SelectRelayChain<_>>(&mut config, basics, select_chain)?;
let net_config = sc_network::config::FullNetworkConfiguration::<_, _, Network>::new(
let net_config = pezsc_network::config::FullNetworkConfiguration::<_, _, Network>::new(
&config.network,
config.prometheus_config.as_ref().map(|cfg| cfg.registry.clone()),
);
@@ -211,7 +211,7 @@ where
},
overseer_connector,
partial_components:
sc_service::PartialComponents::<_, _, SelectRelayChain<_>, _, _, _> {
pezsc_service::PartialComponents::<_, _, SelectRelayChain<_>, _, _, _> {
client,
backend,
mut task_manager,
@@ -237,7 +237,7 @@ where
// the block authoring backoff is disabled by default on production networks
None
} else {
let mut backoff = sc_consensus_slots::BackoffAuthoringOnFinalizedHeadLagging::default();
let mut backoff = pezsc_consensus_slots::BackoffAuthoringOnFinalizedHeadLagging::default();
if config.chain_spec.is_pezkuwichain() ||
config.chain_spec.is_versi() ||
@@ -265,11 +265,11 @@ where
// Note: GrandPa is pushed before the Pezkuwi-specific protocols. This doesn't change
// anything in terms of behaviour, but makes the logs more consistent with the other
// Substrate nodes.
// Bizinikiwi nodes.
let grandpa_protocol_name =
sc_consensus_grandpa::protocol_standard_name(&genesis_hash, &config.chain_spec);
pezsc_consensus_grandpa::protocol_standard_name(&genesis_hash, &config.chain_spec);
let (grandpa_protocol_config, grandpa_notification_service) =
sc_consensus_grandpa::grandpa_peers_set_config::<_, Network>(
pezsc_consensus_grandpa::grandpa_peers_set_config::<_, Network>(
grandpa_protocol_name.clone(),
metrics.clone(),
Arc::clone(&peer_store_handle),
@@ -277,11 +277,11 @@ where
net_config.add_notification_protocol(grandpa_protocol_config);
let beefy_gossip_proto_name =
sc_consensus_beefy::gossip_protocol_name(&genesis_hash, config.chain_spec.fork_id());
pezsc_consensus_beefy::gossip_protocol_name(&genesis_hash, config.chain_spec.fork_id());
// `beefy_on_demand_justifications_handler` is given to `beefy-gadget` task to be run,
// while `beefy_req_resp_cfg` is added to `config.network.request_response_protocols`.
let (beefy_on_demand_justifications_handler, beefy_req_resp_cfg) =
sc_consensus_beefy::communication::request_response::BeefyJustifsRequestHandler::new::<
pezsc_consensus_beefy::communication::request_response::BeefyJustifsRequestHandler::new::<
_,
Network,
>(
@@ -294,7 +294,7 @@ where
false => None,
true => {
let (beefy_notification_config, beefy_notification_service) =
sc_consensus_beefy::communication::beefy_peers_set_config::<_, Network>(
pezsc_consensus_beefy::communication::beefy_peers_set_config::<_, Network>(
beefy_gossip_proto_name.clone(),
metrics.clone(),
Arc::clone(&peer_store_handle),
@@ -332,7 +332,7 @@ where
net_config.add_notification_protocol(config);
(peerset, service)
})
.collect::<HashMap<PeerSet, Box<dyn sc_network::NotificationService>>>()
.collect::<HashMap<PeerSet, Box<dyn pezsc_network::NotificationService>>>()
} else {
std::collections::HashMap::new()
};
@@ -364,7 +364,7 @@ where
Vec::new()
};
let warp_sync = Arc::new(sc_consensus_grandpa::warp_proof::NetworkProvider::new(
let warp_sync = Arc::new(pezsc_consensus_grandpa::warp_proof::NetworkProvider::new(
backend.clone(),
import_setup.1.shared_authority_set().clone(),
grandpa_hard_forks,
@@ -458,7 +458,7 @@ where
};
let (network, system_rpc_tx, tx_handler_controller, sync_service) =
sc_service::build_network(sc_service::BuildNetworkParams {
pezsc_service::build_network(pezsc_service::BuildNetworkParams {
config: &config,
net_config,
client: client.clone(),
@@ -477,7 +477,7 @@ where
task_manager.spawn_handle().spawn(
"offchain-workers-runner",
"offchain-work",
sc_offchain::OffchainWorkers::new(sc_offchain::OffchainWorkerOptions {
pezsc_offchain::OffchainWorkers::new(pezsc_offchain::OffchainWorkerOptions {
runtime_api_provider: client.clone(),
keystore: Some(keystore_container.keystore()),
offchain_db: backend.offchain_storage(),
@@ -495,7 +495,7 @@ where
}
let network_config = config.network.clone();
let rpc_handlers = sc_service::spawn_tasks(sc_service::SpawnTasksParams {
let rpc_handlers = pezsc_service::spawn_tasks(pezsc_service::SpawnTasksParams {
config,
backend: backend.clone(),
client: client.clone(),
@@ -512,8 +512,8 @@ where
})?;
if let Some(hwbench) = hwbench {
sc_sysinfo::print_hwbench(&hwbench);
match SUBSTRATE_REFERENCE_HARDWARE.check_hardware(&hwbench, role.is_authority()) {
pezsc_sysinfo::print_hwbench(&hwbench);
match BIZINIKIWI_REFERENCE_HARDWARE.check_hardware(&hwbench, role.is_authority()) {
Err(err) if role.is_authority() => {
if err
.0
@@ -547,7 +547,7 @@ where
task_manager.spawn_handle().spawn(
"telemetry_hwbench",
None,
sc_sysinfo::initialize_hwbench_telemetry(telemetry_handle, hwbench),
pezsc_sysinfo::initialize_hwbench_telemetry(telemetry_handle, hwbench),
);
}
}
@@ -563,13 +563,13 @@ where
// their PoVs or recovering PoVs.
if role.is_authority() || is_teyrchain_node.is_running_alongside_teyrchain_node() {
use futures::StreamExt;
use sc_network::{Event, NetworkEventStream};
use pezsc_network::{Event, NetworkEventStream};
let authority_discovery_role = if role.is_authority() {
sc_authority_discovery::Role::PublishAndDiscover(keystore_container.keystore())
pezsc_authority_discovery::Role::PublishAndDiscover(keystore_container.keystore())
} else {
// don't publish our addresses when we're not an authority (collator, cumulus, ..)
sc_authority_discovery::Role::Discover
// don't publish our addresses when we're not an authority (collator, pezcumulus, ..)
pezsc_authority_discovery::Role::Discover
};
let dht_event_stream =
network.event_stream("authority-discovery").filter_map(|e| async move {
@@ -578,8 +578,8 @@ where
_ => None,
}
});
let (worker, service) = sc_authority_discovery::new_worker_and_service_with_config(
sc_authority_discovery::WorkerConfig {
let (worker, service) = pezsc_authority_discovery::new_worker_and_service_with_config(
pezsc_authority_discovery::WorkerConfig {
publish_non_global_ips: auth_disc_publish_non_global_ips,
public_addresses: auth_disc_public_addresses,
// Require that authority discovery records are signed.
@@ -613,7 +613,7 @@ where
let overseer_handle = if let Some(authority_discovery_service) = authority_discovery_service
{
let (overseer, overseer_handle) = overseer_gen
.generate::<sc_service::SpawnTaskHandle, DefaultSubsystemClient<FullClient>>(
.generate::<pezsc_service::SpawnTaskHandle, DefaultSubsystemClient<FullClient>>(
overseer_connector,
OverseerGenArgs {
runtime_client,
@@ -673,7 +673,7 @@ where
};
if role.is_authority() {
let proposer = sc_basic_authorship::ProposerFactory::new(
let proposer = pezsc_basic_authorship::ProposerFactory::new(
task_manager.spawn_handle(),
client.clone(),
transaction_pool.clone(),
@@ -685,7 +685,7 @@ where
let overseer_handle =
overseer_handle.as_ref().ok_or(Error::AuthoritiesRequireRealOverseer)?.clone();
let slot_duration = babe_link.config().slot_duration();
let babe_config = sc_consensus_babe::BabeParams {
let babe_config = pezsc_consensus_babe::BabeParams {
keystore: keystore_container.keystore(),
client: client.clone(),
select_chain,
@@ -705,10 +705,10 @@ where
parent,
);
let timestamp = sp_timestamp::InherentDataProvider::from_system_time();
let timestamp = pezsp_timestamp::InherentDataProvider::from_system_time();
let slot =
sp_consensus_babe::inherents::InherentDataProvider::from_timestamp_and_slot_duration(
pezsp_consensus_babe::inherents::InherentDataProvider::from_timestamp_and_slot_duration(
*timestamp,
slot_duration,
);
@@ -719,12 +719,12 @@ where
force_authoring,
backoff_authoring_blocks,
babe_link,
block_proposal_slot_portion: sc_consensus_babe::SlotProportion::new(2f32 / 3f32),
block_proposal_slot_portion: pezsc_consensus_babe::SlotProportion::new(2f32 / 3f32),
max_block_proposal_slot_portion: None,
telemetry: telemetry.as_ref().map(|x| x.handle()),
};
let babe = sc_consensus_babe::start_babe(babe_config)?;
let babe = pezsc_consensus_babe::start_babe(babe_config)?;
task_manager.spawn_essential_handle().spawn_blocking("babe", None, babe);
}
@@ -737,7 +737,7 @@ where
if let Some(notification_service) = beefy_notification_service {
let justifications_protocol_name =
beefy_on_demand_justifications_handler.protocol_name();
let network_params = sc_consensus_beefy::BeefyNetworkParams {
let network_params = pezsc_consensus_beefy::BeefyNetworkParams {
network: Arc::new(network.clone()),
sync: sync_service.clone(),
gossip_protocol_name: beefy_gossip_proto_name,
@@ -745,8 +745,8 @@ where
notification_service,
_phantom: core::marker::PhantomData::<Block>,
};
let payload_provider = sp_consensus_beefy::mmr::MmrRootProvider::new(client.clone());
let beefy_params = sc_consensus_beefy::BeefyParams {
let payload_provider = pezsp_consensus_beefy::mmr::MmrRootProvider::new(client.clone());
let beefy_params = pezsc_consensus_beefy::BeefyParams {
client: client.clone(),
backend: backend.clone(),
payload_provider,
@@ -760,7 +760,7 @@ where
is_authority: role.is_authority(),
};
let gadget = sc_consensus_beefy::start_beefy_gadget::<
let gadget = pezsc_consensus_beefy::start_beefy_gadget::<
_,
_,
_,
@@ -785,15 +785,15 @@ where
MmrGadget::start(
client.clone(),
backend.clone(),
sp_mmr_primitives::INDEXING_PREFIX.to_vec(),
pezsp_mmr_primitives::INDEXING_PREFIX.to_vec(),
),
);
}
let config = sc_consensus_grandpa::Config {
// FIXME substrate#1578 make this available through chainspec
let config = pezsc_consensus_grandpa::Config {
// FIXME bizinikiwi#1578 make this available through chainspec
// Grandpa performance can be improved a bit by tuning this parameter, see:
// https://github.com/paritytech/polkadot/issues/5464
// https://github.com/pezkuwichain/kurdistan-sdk/issues/157
gossip_duration: Duration::from_millis(1000),
justification_generation_period: GRANDPA_JUSTIFICATION_PERIOD,
name: Some(name),
@@ -807,13 +807,13 @@ where
let enable_grandpa = !disable_grandpa;
if enable_grandpa {
// start the full GRANDPA voter
// NOTE: unlike in substrate we are currently running the full
// NOTE: unlike in bizinikiwi we are currently running the full
// GRANDPA voter protocol for all full nodes (regardless of whether
// they're validators or not). at this point the full voter should
// provide better guarantees of block and vote data availability than
// the observer.
let mut voting_rules_builder = sc_consensus_grandpa::VotingRulesBuilder::default();
let mut voting_rules_builder = pezsc_consensus_grandpa::VotingRulesBuilder::default();
#[cfg(not(feature = "malus"))]
let _malus_finality_delay = None;
@@ -821,10 +821,10 @@ where
if let Some(delay) = _malus_finality_delay {
info!(?delay, "Enabling malus finality delay",);
voting_rules_builder =
voting_rules_builder.add(sc_consensus_grandpa::BeforeBestBlockBy(delay));
voting_rules_builder.add(pezsc_consensus_grandpa::BeforeBestBlockBy(delay));
};
let grandpa_config = sc_consensus_grandpa::GrandpaParams {
let grandpa_config = pezsc_consensus_grandpa::GrandpaParams {
config,
link: link_half,
network: network.clone(),
@@ -842,7 +842,7 @@ where
task_manager.spawn_essential_handle().spawn_blocking(
"grandpa-voter",
None,
sc_consensus_grandpa::run_grandpa_voter(grandpa_config)?,
pezsc_consensus_grandpa::run_grandpa_voter(grandpa_config)?,
);
}
@@ -869,7 +869,7 @@ where
/// both as preparation and execution worker (supposed to be used for tests only).
pub fn new_full<
OverseerGenerator: OverseerGen,
Network: sc_network::NetworkBackend<Block, <Block as BlockT>::Hash>,
Network: pezsc_network::NetworkBackend<Block, <Block as BlockT>::Hash>,
>(
config: Configuration,
params: NewFullParams<OverseerGenerator>,
+33 -33
View File
@@ -23,21 +23,21 @@ use crate::{
FullClient, IdentifyVariant, GRANDPA_JUSTIFICATION_PERIOD,
};
use pezkuwi_primitives::Block;
use sc_consensus_grandpa::FinalityProofProvider as GrandpaFinalityProofProvider;
use sc_executor::{HeapAllocStrategy, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY};
use sc_service::{Configuration, Error as SubstrateServiceError, KeystoreContainer, TaskManager};
use sc_telemetry::{Telemetry, TelemetryWorker, TelemetryWorkerHandle};
use sc_transaction_pool_api::OffchainTransactionPoolFactory;
use sp_consensus::SelectChain;
use sp_consensus_babe::inherents::BabeCreateInherentDataProviders;
use sp_consensus_beefy::ecdsa_crypto;
use pezsc_consensus_grandpa::FinalityProofProvider as GrandpaFinalityProofProvider;
use pezsc_executor::{HeapAllocStrategy, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY};
use pezsc_service::{Configuration, Error as BizinikiwiServiceError, KeystoreContainer, TaskManager};
use pezsc_telemetry::{Telemetry, TelemetryWorker, TelemetryWorkerHandle};
use pezsc_transaction_pool_api::OffchainTransactionPoolFactory;
use pezsp_consensus::SelectChain;
use pezsp_consensus_babe::inherents::BabeCreateInherentDataProviders;
use pezsp_consensus_beefy::ecdsa_crypto;
use std::sync::Arc;
type FullSelectChain = relay_chain_selection::SelectRelayChain<FullBackend>;
type FullGrandpaBlockImport<ChainSelection = FullSelectChain> =
sc_consensus_grandpa::GrandpaBlockImport<FullBackend, Block, FullClient, ChainSelection>;
pezsc_consensus_grandpa::GrandpaBlockImport<FullBackend, Block, FullClient, ChainSelection>;
type FullBeefyBlockImport<InnerBlockImport, AuthorityId> =
sc_consensus_beefy::import::BeefyBlockImport<
pezsc_consensus_beefy::import::BeefyBlockImport<
Block,
FullBackend,
FullClient,
@@ -45,20 +45,20 @@ type FullBeefyBlockImport<InnerBlockImport, AuthorityId> =
AuthorityId,
>;
pub(crate) type PezkuwiPartialComponents<ChainSelection> = sc_service::PartialComponents<
pub(crate) type PezkuwiPartialComponents<ChainSelection> = pezsc_service::PartialComponents<
FullClient,
FullBackend,
ChainSelection,
sc_consensus::DefaultImportQueue<Block>,
sc_transaction_pool::TransactionPoolHandle<Block, FullClient>,
pezsc_consensus::DefaultImportQueue<Block>,
pezsc_transaction_pool::TransactionPoolHandle<Block, FullClient>,
(
Box<
dyn Fn(
pezkuwi_rpc::SubscriptionTaskExecutor,
) -> Result<pezkuwi_rpc::RpcExtension, SubstrateServiceError>,
) -> Result<pezkuwi_rpc::RpcExtension, BizinikiwiServiceError>,
>,
(
sc_consensus_babe::BabeBlockImport<
pezsc_consensus_babe::BabeBlockImport<
Block,
FullClient,
FullBeefyBlockImport<
@@ -68,12 +68,12 @@ pub(crate) type PezkuwiPartialComponents<ChainSelection> = sc_service::PartialCo
BabeCreateInherentDataProviders<Block>,
ChainSelection,
>,
sc_consensus_grandpa::LinkHalf<Block, FullClient, ChainSelection>,
sc_consensus_babe::BabeLink<Block>,
sc_consensus_beefy::BeefyVoterLinks<Block, ecdsa_crypto::AuthorityId>,
pezsc_consensus_grandpa::LinkHalf<Block, FullClient, ChainSelection>,
pezsc_consensus_babe::BabeLink<Block>,
pezsc_consensus_beefy::BeefyVoterLinks<Block, ecdsa_crypto::AuthorityId>,
),
sc_consensus_grandpa::SharedVoterState,
sp_consensus_babe::SlotDuration,
pezsc_consensus_grandpa::SharedVoterState,
pezsp_consensus_babe::SlotDuration,
Option<Telemetry>,
),
>;
@@ -94,7 +94,7 @@ pub(crate) fn new_partial_basics(
.telemetry_endpoints
.clone()
.filter(|x| !x.is_empty())
.map(move |endpoints| -> Result<_, sc_telemetry::Error> {
.map(move |endpoints| -> Result<_, pezsc_telemetry::Error> {
let (worker, mut worker_handle) = if let Some(worker_handle) = telemetry_worker_handle {
(None, worker_handle)
} else {
@@ -121,7 +121,7 @@ pub(crate) fn new_partial_basics(
.build();
let (client, backend, keystore_container, task_manager) =
sc_service::new_full_parts::<Block, RuntimeApi, _>(
pezsc_service::new_full_parts::<Block, RuntimeApi, _>(
&config,
telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()),
executor,
@@ -151,7 +151,7 @@ where
ChainSelection: 'static + SelectChain<Block>,
{
let transaction_pool = Arc::from(
sc_transaction_pool::Builder::new(
pezsc_transaction_pool::Builder::new(
task_manager.spawn_essential_handle(),
client.clone(),
config.role.is_authority().into(),
@@ -168,7 +168,7 @@ where
};
let (grandpa_block_import, grandpa_link) =
sc_consensus_grandpa::block_import_with_authority_set_hard_forks(
pezsc_consensus_grandpa::block_import_with_authority_set_hard_forks(
client.clone(),
GRANDPA_JUSTIFICATION_PERIOD,
&client.clone(),
@@ -179,22 +179,22 @@ where
let justification_import = grandpa_block_import.clone();
let (beefy_block_import, beefy_voter_links, beefy_rpc_links) =
sc_consensus_beefy::beefy_block_import_and_links(
pezsc_consensus_beefy::beefy_block_import_and_links(
grandpa_block_import,
backend.clone(),
client.clone(),
config.prometheus_registry().cloned(),
);
let babe_config = sc_consensus_babe::configuration(&*client)?;
let babe_config = pezsc_consensus_babe::configuration(&*client)?;
let slot_duration = babe_config.slot_duration();
let (block_import, babe_link) = sc_consensus_babe::block_import(
let (block_import, babe_link) = pezsc_consensus_babe::block_import(
babe_config.clone(),
beefy_block_import,
client.clone(),
Arc::new(move |_, _| async move {
let timestamp = sp_timestamp::InherentDataProvider::from_system_time();
let slot = sp_consensus_babe::inherents::InherentDataProvider::from_timestamp_and_slot_duration(
let timestamp = pezsp_timestamp::InherentDataProvider::from_system_time();
let slot = pezsp_consensus_babe::inherents::InherentDataProvider::from_timestamp_and_slot_duration(
*timestamp,
slot_duration,
);
@@ -205,7 +205,7 @@ where
)?;
let (import_queue, babe_worker_handle) =
sc_consensus_babe::import_queue(sc_consensus_babe::ImportQueueParams {
pezsc_consensus_babe::import_queue(pezsc_consensus_babe::ImportQueueParams {
link: babe_link.clone(),
block_import: block_import.clone(),
justification_import: Some(Box::new(justification_import)),
@@ -218,7 +218,7 @@ where
let justification_stream = grandpa_link.justification_stream();
let shared_authority_set = grandpa_link.shared_authority_set().clone();
let shared_voter_state = sc_consensus_grandpa::SharedVoterState::empty();
let shared_voter_state = pezsc_consensus_grandpa::SharedVoterState::empty();
let finality_proof_provider = GrandpaFinalityProofProvider::new_for_service(
backend.clone(),
Some(shared_authority_set.clone()),
@@ -236,7 +236,7 @@ where
let backend = backend.clone();
move |subscription_executor: pezkuwi_rpc::SubscriptionTaskExecutor|
-> Result<pezkuwi_rpc::RpcExtension, sc_service::Error> {
-> Result<pezkuwi_rpc::RpcExtension, pezsc_service::Error> {
let deps = pezkuwi_rpc::FullDeps {
client: client.clone(),
pool: transaction_pool.clone(),
@@ -265,7 +265,7 @@ where
}
};
Ok(sc_service::PartialComponents {
Ok(pezsc_service::PartialComponents {
client,
backend,
task_manager,
+18 -18
View File
@@ -18,11 +18,11 @@
#[cfg(feature = "pezkuwichain-native")]
use pezkuwichain_runtime as pezkuwichain;
use sc_chain_spec::ChainSpecExtension;
use pezsc_chain_spec::ChainSpecExtension;
#[cfg(any(feature = "zagros-native", feature = "pezkuwichain-native"))]
use sc_chain_spec::ChainType;
use pezsc_chain_spec::ChainType;
#[cfg(any(feature = "zagros-native", feature = "pezkuwichain-native"))]
use sc_telemetry::TelemetryEndpoints;
use pezsc_telemetry::TelemetryEndpoints;
use serde::{Deserialize, Serialize};
#[cfg(feature = "zagros-native")]
use zagros_runtime as zagros;
@@ -38,27 +38,27 @@ const DEFAULT_PROTOCOL_ID: &str = "hez";
/// Node `ChainSpec` extensions.
///
/// Additional parameters for some Substrate core modules,
/// Additional parameters for some Bizinikiwi core modules,
/// customizable from the chain spec.
#[derive(Default, Clone, Serialize, Deserialize, ChainSpecExtension)]
#[serde(rename_all = "camelCase")]
pub struct Extensions {
/// Block numbers with known hashes.
pub fork_blocks: sc_client_api::ForkBlocks<pezkuwi_primitives::Block>,
pub fork_blocks: pezsc_client_api::ForkBlocks<pezkuwi_primitives::Block>,
/// Known bad block hashes.
pub bad_blocks: sc_client_api::BadBlocks<pezkuwi_primitives::Block>,
pub bad_blocks: pezsc_client_api::BadBlocks<pezkuwi_primitives::Block>,
/// The light sync state.
///
/// This value will be set by the `sync-state rpc` implementation.
pub light_sync_state: sc_sync_state_rpc::LightSyncStateExtension,
pub light_sync_state: pezsc_sync_state_rpc::LightSyncStateExtension,
}
// Generic chain spec, in case when we don't have the native runtime.
pub type GenericChainSpec = sc_service::GenericChainSpec<Extensions>;
pub type GenericChainSpec = pezsc_service::GenericChainSpec<Extensions>;
/// The `ChainSpec` parameterized for the zagros runtime.
#[cfg(feature = "zagros-native")]
pub type ZagrosChainSpec = sc_service::GenericChainSpec<Extensions>;
pub type ZagrosChainSpec = pezsc_service::GenericChainSpec<Extensions>;
/// The `ChainSpec` parameterized for the zagros runtime.
// Dummy chain spec, but that is fine when we don't have the native runtime.
@@ -67,7 +67,7 @@ pub type ZagrosChainSpec = GenericChainSpec;
/// The `ChainSpec` parameterized for the pezkuwichain runtime.
#[cfg(feature = "pezkuwichain-native")]
pub type PezkuwichainChainSpec = sc_service::GenericChainSpec<Extensions>;
pub type PezkuwichainChainSpec = pezsc_service::GenericChainSpec<Extensions>;
/// The `ChainSpec` parameterized for the pezkuwichain runtime.
// Dummy chain spec, but that is fine when we don't have the native runtime.
@@ -104,7 +104,7 @@ pub fn zagros_staging_testnet_config() -> Result<ZagrosChainSpec, String> {
.with_name("Zagros Staging Testnet")
.with_id("zagros_staging_testnet")
.with_chain_type(ChainType::Live)
.with_genesis_config_preset_name("staging_testnet")
.with_genesis_config_preset_name("pezstaging_testnet")
.with_telemetry_endpoints(
TelemetryEndpoints::new(vec![(ZAGROS_STAGING_TELEMETRY_URL.to_string(), 0)])
.expect("Zagros Staging telemetry url is valid; qed"),
@@ -123,7 +123,7 @@ pub fn pezkuwichain_staging_testnet_config() -> Result<PezkuwichainChainSpec, St
.with_name("Pezkuwichain Staging Testnet")
.with_id("pezkuwichain_staging_testnet")
.with_chain_type(ChainType::Live)
.with_genesis_config_preset_name("staging_testnet")
.with_genesis_config_preset_name("pezstaging_testnet")
.with_telemetry_endpoints(
TelemetryEndpoints::new(vec![(PEZKUWICHAIN_STAGING_TELEMETRY_URL.to_string(), 0)])
.expect("Pezkuwichain Staging telemetry url is valid; qed"),
@@ -153,7 +153,7 @@ pub fn versi_staging_testnet_config() -> Result<PezkuwichainChainSpec, String> {
.with_name("Versi Staging Testnet")
.with_id("versi_staging_testnet")
.with_chain_type(ChainType::Live)
.with_genesis_config_preset_name("staging_testnet")
.with_genesis_config_preset_name("pezstaging_testnet")
.with_telemetry_endpoints(
TelemetryEndpoints::new(vec![(VERSI_STAGING_TELEMETRY_URL.to_string(), 0)])
.expect("Versi Staging telemetry url is valid; qed"),
@@ -173,7 +173,7 @@ pub fn zagros_development_config() -> Result<ZagrosChainSpec, String> {
.with_name("Development")
.with_id("zagros_dev")
.with_chain_type(ChainType::Development)
.with_genesis_config_preset_name(sp_genesis_builder::DEV_RUNTIME_PRESET)
.with_genesis_config_preset_name(pezsp_genesis_builder::DEV_RUNTIME_PRESET)
.with_protocol_id(DEFAULT_PROTOCOL_ID)
.build())
}
@@ -188,7 +188,7 @@ pub fn pezkuwichain_development_config() -> Result<PezkuwichainChainSpec, String
.with_name("Development")
.with_id("pezkuwichain_dev")
.with_chain_type(ChainType::Development)
.with_genesis_config_preset_name(sp_genesis_builder::DEV_RUNTIME_PRESET)
.with_genesis_config_preset_name(pezsp_genesis_builder::DEV_RUNTIME_PRESET)
.with_protocol_id(DEFAULT_PROTOCOL_ID)
.build())
}
@@ -203,7 +203,7 @@ pub fn versi_development_config() -> Result<PezkuwichainChainSpec, String> {
.with_name("Development")
.with_id("versi_dev")
.with_chain_type(ChainType::Development)
.with_genesis_config_preset_name(sp_genesis_builder::DEV_RUNTIME_PRESET)
.with_genesis_config_preset_name(pezsp_genesis_builder::DEV_RUNTIME_PRESET)
.with_protocol_id("versi")
.build())
}
@@ -218,7 +218,7 @@ pub fn zagros_local_testnet_config() -> Result<ZagrosChainSpec, String> {
.with_name("Zagros Local Testnet")
.with_id("zagros_local_testnet")
.with_chain_type(ChainType::Local)
.with_genesis_config_preset_name(sp_genesis_builder::LOCAL_TESTNET_RUNTIME_PRESET)
.with_genesis_config_preset_name(pezsp_genesis_builder::LOCAL_TESTNET_RUNTIME_PRESET)
.with_protocol_id(DEFAULT_PROTOCOL_ID)
.build())
}
@@ -234,7 +234,7 @@ pub fn pezkuwichain_local_testnet_config() -> Result<PezkuwichainChainSpec, Stri
.with_name("Pezkuwichain Local Testnet")
.with_id("pezkuwichain_local_testnet")
.with_chain_type(ChainType::Local)
.with_genesis_config_preset_name(sp_genesis_builder::LOCAL_TESTNET_RUNTIME_PRESET)
.with_genesis_config_preset_name(pezsp_genesis_builder::LOCAL_TESTNET_RUNTIME_PRESET)
.with_protocol_id(DEFAULT_PROTOCOL_ID)
.build())
}
+62 -62
View File
@@ -19,7 +19,7 @@
//! These are used to provide a type that implements these runtime APIs without requiring to import
//! the native runtimes.
use pallet_transaction_payment::{FeeDetails, RuntimeDispatchInfo};
use pezpallet_transaction_payment::{FeeDetails, RuntimeDispatchInfo};
use pezkuwi_primitives::{
runtime_api, slashing, AccountId, AuthorityDiscoveryId, Balance, Block, BlockNumber,
CandidateCommitments, CandidateEvent, CandidateHash,
@@ -29,22 +29,22 @@ use pezkuwi_primitives::{
ScrapedOnChainVotes, SessionIndex, SessionInfo, ValidationCode, ValidationCodeHash,
ValidatorId, ValidatorIndex, ValidatorSignature,
};
use sp_consensus_beefy::ecdsa_crypto::{AuthorityId as BeefyId, Signature as BeefySignature};
use sp_consensus_grandpa::AuthorityId as GrandpaId;
use pezsp_consensus_beefy::ecdsa_crypto::{AuthorityId as BeefyId, Signature as BeefySignature};
use pezsp_consensus_grandpa::AuthorityId as GrandpaId;
use sp_core::OpaqueMetadata;
use sp_runtime::{
use pezsp_core::OpaqueMetadata;
use pezsp_runtime::{
traits::Block as BlockT,
transaction_validity::{TransactionSource, TransactionValidity},
ApplyExtrinsicResult,
};
use sp_version::RuntimeVersion;
use sp_weights::Weight;
use pezsp_version::RuntimeVersion;
use pezsp_weights::Weight;
use std::collections::BTreeMap;
use xcm::{
Version as XcmVersion, VersionedAssetId, VersionedAssets, VersionedLocation, VersionedXcm,
};
sp_api::decl_runtime_apis! {
pezsp_api::decl_runtime_apis! {
/// This runtime API is only implemented for the test runtime!
pub trait GetLastTimestamp {
/// Returns the last timestamp of a runtime.
@@ -55,8 +55,8 @@ sp_api::decl_runtime_apis! {
#[allow(dead_code)]
struct Runtime;
sp_api::impl_runtime_apis! {
impl sp_api::Core<Block> for Runtime {
pezsp_api::impl_runtime_apis! {
impl pezsp_api::Core<Block> for Runtime {
fn version() -> RuntimeVersion {
unimplemented!()
}
@@ -65,12 +65,12 @@ sp_api::impl_runtime_apis! {
unimplemented!()
}
fn initialize_block(_: &<Block as BlockT>::Header) -> sp_runtime::ExtrinsicInclusionMode {
fn initialize_block(_: &<Block as BlockT>::Header) -> pezsp_runtime::ExtrinsicInclusionMode {
unimplemented!()
}
}
impl sp_api::Metadata<Block> for Runtime {
impl pezsp_api::Metadata<Block> for Runtime {
fn metadata() -> OpaqueMetadata {
unimplemented!()
}
@@ -84,7 +84,7 @@ sp_api::impl_runtime_apis! {
}
}
impl sp_block_builder::BlockBuilder<Block> for Runtime {
impl pezsp_block_builder::BlockBuilder<Block> for Runtime {
fn apply_extrinsic(_: <Block as BlockT>::Extrinsic) -> ApplyExtrinsicResult {
unimplemented!()
}
@@ -93,19 +93,19 @@ sp_api::impl_runtime_apis! {
unimplemented!()
}
fn inherent_extrinsics(_: sp_inherents::InherentData) -> Vec<<Block as BlockT>::Extrinsic> {
fn inherent_extrinsics(_: pezsp_inherents::InherentData) -> Vec<<Block as BlockT>::Extrinsic> {
unimplemented!()
}
fn check_inherents(
_: <Block as BlockT>::LazyBlock,
_: sp_inherents::InherentData,
) -> sp_inherents::CheckInherentsResult {
_: pezsp_inherents::InherentData,
) -> pezsp_inherents::CheckInherentsResult {
unimplemented!()
}
}
impl sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block> for Runtime {
impl pezsp_transaction_pool::runtime_api::TaggedTransactionQueue<Block> for Runtime {
fn validate_transaction(
_: TransactionSource,
_: <Block as BlockT>::Extrinsic,
@@ -115,7 +115,7 @@ sp_api::impl_runtime_apis! {
}
}
impl sp_offchain::OffchainWorkerApi<Block> for Runtime {
impl pezsp_offchain::OffchainWorkerApi<Block> for Runtime {
fn offchain_worker(_: &<Block as BlockT>::Header) {
unimplemented!()
}
@@ -236,174 +236,174 @@ sp_api::impl_runtime_apis! {
}
}
impl sp_consensus_beefy::BeefyApi<Block, BeefyId> for Runtime {
impl pezsp_consensus_beefy::BeefyApi<Block, BeefyId> for Runtime {
fn beefy_genesis() -> Option<BlockNumber> {
unimplemented!()
}
fn validator_set() -> Option<sp_consensus_beefy::ValidatorSet<BeefyId>> {
fn validator_set() -> Option<pezsp_consensus_beefy::ValidatorSet<BeefyId>> {
unimplemented!()
}
fn submit_report_double_voting_unsigned_extrinsic(
_: sp_consensus_beefy::DoubleVotingProof<
_: pezsp_consensus_beefy::DoubleVotingProof<
BlockNumber,
BeefyId,
BeefySignature,
>,
_: sp_consensus_beefy::OpaqueKeyOwnershipProof,
_: pezsp_consensus_beefy::OpaqueKeyOwnershipProof,
) -> Option<()> {
unimplemented!()
}
fn submit_report_fork_voting_unsigned_extrinsic(
_: sp_consensus_beefy::ForkVotingProof<
_: pezsp_consensus_beefy::ForkVotingProof<
<Block as BlockT>::Header,
BeefyId,
sp_runtime::OpaqueValue
pezsp_runtime::OpaqueValue
>,
_: sp_consensus_beefy::OpaqueKeyOwnershipProof,
_: pezsp_consensus_beefy::OpaqueKeyOwnershipProof,
) -> Option<()> {
unimplemented!()
}
fn submit_report_future_block_voting_unsigned_extrinsic(
_: sp_consensus_beefy::FutureBlockVotingProof<BlockNumber, BeefyId>,
_: sp_consensus_beefy::OpaqueKeyOwnershipProof,
_: pezsp_consensus_beefy::FutureBlockVotingProof<BlockNumber, BeefyId>,
_: pezsp_consensus_beefy::OpaqueKeyOwnershipProof,
) -> Option<()> {
unimplemented!()
}
fn generate_key_ownership_proof(
_: sp_consensus_beefy::ValidatorSetId,
_: pezsp_consensus_beefy::ValidatorSetId,
_: BeefyId,
) -> Option<sp_consensus_beefy::OpaqueKeyOwnershipProof> {
) -> Option<pezsp_consensus_beefy::OpaqueKeyOwnershipProof> {
unimplemented!()
}
}
impl sp_mmr_primitives::MmrApi<Block, Hash, BlockNumber> for Runtime {
fn mmr_root() -> Result<Hash, sp_mmr_primitives::Error> {
impl pezsp_mmr_primitives::MmrApi<Block, Hash, BlockNumber> for Runtime {
fn mmr_root() -> Result<Hash, pezsp_mmr_primitives::Error> {
unimplemented!()
}
fn mmr_leaf_count() -> Result<sp_mmr_primitives::LeafIndex, sp_mmr_primitives::Error> {
fn mmr_leaf_count() -> Result<pezsp_mmr_primitives::LeafIndex, pezsp_mmr_primitives::Error> {
unimplemented!()
}
fn generate_proof(
_: Vec<BlockNumber>,
_: Option<BlockNumber>,
) -> Result<(Vec<sp_mmr_primitives::EncodableOpaqueLeaf>, sp_mmr_primitives::LeafProof<Hash>), sp_mmr_primitives::Error> {
) -> Result<(Vec<pezsp_mmr_primitives::EncodableOpaqueLeaf>, pezsp_mmr_primitives::LeafProof<Hash>), pezsp_mmr_primitives::Error> {
unimplemented!()
}
fn generate_ancestry_proof(
_: BlockNumber,
_: Option<BlockNumber>,
) -> Result<sp_mmr_primitives::AncestryProof<Hash>, sp_mmr_primitives::Error> {
) -> Result<pezsp_mmr_primitives::AncestryProof<Hash>, pezsp_mmr_primitives::Error> {
unimplemented!()
}
fn verify_proof(_: Vec<sp_mmr_primitives::EncodableOpaqueLeaf>, _: sp_mmr_primitives::LeafProof<Hash>)
-> Result<(), sp_mmr_primitives::Error>
fn verify_proof(_: Vec<pezsp_mmr_primitives::EncodableOpaqueLeaf>, _: pezsp_mmr_primitives::LeafProof<Hash>)
-> Result<(), pezsp_mmr_primitives::Error>
{
unimplemented!()
}
fn verify_proof_stateless(
_: Hash,
_: Vec<sp_mmr_primitives::EncodableOpaqueLeaf>,
_: sp_mmr_primitives::LeafProof<Hash>
) -> Result<(), sp_mmr_primitives::Error> {
_: Vec<pezsp_mmr_primitives::EncodableOpaqueLeaf>,
_: pezsp_mmr_primitives::LeafProof<Hash>
) -> Result<(), pezsp_mmr_primitives::Error> {
unimplemented!()
}
}
impl sp_consensus_grandpa::GrandpaApi<Block> for Runtime {
impl pezsp_consensus_grandpa::GrandpaApi<Block> for Runtime {
fn grandpa_authorities() -> Vec<(GrandpaId, u64)> {
unimplemented!()
}
fn current_set_id() -> sp_consensus_grandpa::SetId {
fn current_set_id() -> pezsp_consensus_grandpa::SetId {
unimplemented!()
}
fn submit_report_equivocation_unsigned_extrinsic(
_: sp_consensus_grandpa::EquivocationProof<
_: pezsp_consensus_grandpa::EquivocationProof<
<Block as BlockT>::Hash,
sp_runtime::traits::NumberFor<Block>,
pezsp_runtime::traits::NumberFor<Block>,
>,
_: sp_consensus_grandpa::OpaqueKeyOwnershipProof,
_: pezsp_consensus_grandpa::OpaqueKeyOwnershipProof,
) -> Option<()> {
unimplemented!()
}
fn generate_key_ownership_proof(
_: sp_consensus_grandpa::SetId,
_: sp_consensus_grandpa::AuthorityId,
) -> Option<sp_consensus_grandpa::OpaqueKeyOwnershipProof> {
_: pezsp_consensus_grandpa::SetId,
_: pezsp_consensus_grandpa::AuthorityId,
) -> Option<pezsp_consensus_grandpa::OpaqueKeyOwnershipProof> {
unimplemented!()
}
}
impl sp_consensus_babe::BabeApi<Block> for Runtime {
fn configuration() -> sp_consensus_babe::BabeConfiguration {
impl pezsp_consensus_babe::BabeApi<Block> for Runtime {
fn configuration() -> pezsp_consensus_babe::BabeConfiguration {
unimplemented!()
}
fn current_epoch_start() -> sp_consensus_babe::Slot {
fn current_epoch_start() -> pezsp_consensus_babe::Slot {
unimplemented!()
}
fn current_epoch() -> sp_consensus_babe::Epoch {
fn current_epoch() -> pezsp_consensus_babe::Epoch {
unimplemented!()
}
fn next_epoch() -> sp_consensus_babe::Epoch {
fn next_epoch() -> pezsp_consensus_babe::Epoch {
unimplemented!()
}
fn generate_key_ownership_proof(
_: sp_consensus_babe::Slot,
_: sp_consensus_babe::AuthorityId,
) -> Option<sp_consensus_babe::OpaqueKeyOwnershipProof> {
_: pezsp_consensus_babe::Slot,
_: pezsp_consensus_babe::AuthorityId,
) -> Option<pezsp_consensus_babe::OpaqueKeyOwnershipProof> {
unimplemented!()
}
fn submit_report_equivocation_unsigned_extrinsic(
_: sp_consensus_babe::EquivocationProof<<Block as BlockT>::Header>,
_: sp_consensus_babe::OpaqueKeyOwnershipProof,
_: pezsp_consensus_babe::EquivocationProof<<Block as BlockT>::Header>,
_: pezsp_consensus_babe::OpaqueKeyOwnershipProof,
) -> Option<()> {
unimplemented!()
}
}
impl sp_authority_discovery::AuthorityDiscoveryApi<Block> for Runtime {
impl pezsp_authority_discovery::AuthorityDiscoveryApi<Block> for Runtime {
fn authorities() -> Vec<AuthorityDiscoveryId> {
unimplemented!()
}
}
impl sp_session::SessionKeys<Block> for Runtime {
impl pezsp_session::SessionKeys<Block> for Runtime {
fn generate_session_keys(_: Option<Vec<u8>>) -> Vec<u8> {
unimplemented!()
}
fn decode_session_keys(
_: Vec<u8>,
) -> Option<Vec<(Vec<u8>, sp_core::crypto::KeyTypeId)>> {
) -> Option<Vec<(Vec<u8>, pezsp_core::crypto::KeyTypeId)>> {
unimplemented!()
}
}
impl frame_system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Nonce> for Runtime {
impl pezframe_system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Nonce> for Runtime {
fn account_nonce(_: AccountId) -> Nonce {
unimplemented!()
}
}
impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<
impl pezpallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<
Block,
Balance,
> for Runtime {
+6 -6
View File
@@ -16,7 +16,7 @@
//! Pezkuwi-specific GRANDPA integration utilities.
use sp_runtime::traits::{Block as BlockT, Header as _, NumberFor};
use pezsp_runtime::traits::{Block as BlockT, Header as _, NumberFor};
use crate::HeaderProvider;
@@ -29,7 +29,7 @@ pub(super) fn walk_backwards_to_target_block<Block, HP>(
backend: &HP,
target_number: NumberFor<Block>,
current_header: &Block::Header,
) -> Result<(Block::Hash, NumberFor<Block>), sp_blockchain::Error>
) -> Result<(Block::Hash, NumberFor<Block>), pezsp_blockchain::Error>
where
Block: BlockT,
HP: HeaderProvider<Block>,
@@ -64,8 +64,8 @@ where
/// w3f validators and randomly selected validators from the latest session (at
/// #1500988).
#[cfg(feature = "full-node")]
pub(crate) fn kusama_hard_forks() -> Vec<sc_consensus_grandpa::AuthoritySetHardFork<Block>> {
use sp_core::crypto::Ss58Codec;
pub(crate) fn kusama_hard_forks() -> Vec<pezsc_consensus_grandpa::AuthoritySetHardFork<Block>> {
use pezsp_core::crypto::Ss58Codec;
use std::str::FromStr;
let forks = vec![
@@ -141,7 +141,7 @@ pub(crate) fn kusama_hard_forks() -> Vec<sc_consensus_grandpa::AuthoritySetHardF
.into_iter()
.map(|address| {
(
sp_consensus_grandpa::AuthorityId::from_ss58check(address)
pezsp_consensus_grandpa::AuthorityId::from_ss58check(address)
.expect("hard fork authority addresses are static and they should be carefully defined; qed."),
1,
)
@@ -154,7 +154,7 @@ pub(crate) fn kusama_hard_forks() -> Vec<sc_consensus_grandpa::AuthoritySetHardF
let hash = Hash::from_str(hash)
.expect("hard fork hashes are static and they should be carefully defined; qed.");
sc_consensus_grandpa::AuthoritySetHardFork {
pezsc_consensus_grandpa::AuthoritySetHardFork {
set_id,
block: (hash, number),
authorities: authorities.clone(),
+51 -51
View File
@@ -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/>.
//! Pezkuwi service. Specialized wrapper over substrate service.
//! Pezkuwi service. Specialized wrapper over bizinikiwi service.
#![deny(unused_results)]
@@ -62,31 +62,31 @@ pub use {
pezkuwi_overseer::{Handle, Overseer, OverseerConnector, OverseerHandle},
pezkuwi_primitives::runtime_api::TeyrchainHost,
relay_chain_selection::SelectRelayChain,
sc_client_api::AuxStore,
sp_authority_discovery::AuthorityDiscoveryApi,
sp_blockchain::{HeaderBackend, HeaderMetadata},
sp_consensus_babe::BabeApi,
pezsc_client_api::AuxStore,
pezsp_authority_discovery::AuthorityDiscoveryApi,
pezsp_blockchain::{HeaderBackend, HeaderMetadata},
pezsp_consensus_babe::BabeApi,
};
use std::{path::PathBuf, sync::Arc};
use prometheus_endpoint::Registry;
use sc_service::SpawnTaskHandle;
use pezsc_service::SpawnTaskHandle;
pub use chain_spec::{GenericChainSpec, PezkuwichainChainSpec, ZagrosChainSpec};
pub use pezkuwi_primitives::{Block, BlockId, BlockNumber, CollatorPair, Hash, Id as ParaId};
pub use sc_client_api::{Backend, CallExecutor};
pub use sc_consensus::{BlockImport, LongestChain};
pub use sc_executor::NativeExecutionDispatch;
use sc_executor::WasmExecutor;
pub use sc_service::{
pub use pezsc_client_api::{Backend, CallExecutor};
pub use pezsc_consensus::{BlockImport, LongestChain};
pub use pezsc_executor::NativeExecutionDispatch;
use pezsc_executor::WasmExecutor;
pub use pezsc_service::{
config::{DatabaseSource, PrometheusConfig},
ChainSpec, Configuration, Error as SubstrateServiceError, PruningMode, Role, TFullBackend,
ChainSpec, Configuration, Error as BizinikiwiServiceError, PruningMode, Role, TFullBackend,
TFullCallExecutor, TFullClient, TaskManager, TransactionPoolOptions,
};
pub use sp_api::{ApiRef, ConstructRuntimeApi, Core as CoreApi, ProvideRuntimeApi};
pub use sp_consensus::{Proposal, SelectChain};
pub use sp_runtime::{
pub use pezsp_api::{ApiRef, ConstructRuntimeApi, Core as CoreApi, ProvideRuntimeApi};
pub use pezsp_consensus::{Proposal, SelectChain};
pub use pezsp_runtime::{
generic,
traits::{self as runtime_traits, BlakeTwo256, Block as BlockT, Header as HeaderT, NumberFor},
};
@@ -99,13 +99,13 @@ pub use {zagros_runtime, zagros_runtime_constants};
pub use fake_runtime_api::{GetLastTimestamp, RuntimeApi};
#[cfg(feature = "full-node")]
pub type FullBackend = sc_service::TFullBackend<Block>;
pub type FullBackend = pezsc_service::TFullBackend<Block>;
#[cfg(feature = "full-node")]
pub type FullClient = sc_service::TFullClient<
pub type FullClient = pezsc_service::TFullClient<
Block,
RuntimeApi,
WasmExecutor<(sp_io::SubstrateHostFunctions, frame_benchmarking::benchmarking::HostFunctions)>,
WasmExecutor<(pezsp_io::BizinikiwiHostFunctions, pezframe_benchmarking::benchmarking::HostFunctions)>,
>;
/// The minimum period of blocks on which justifications will be
@@ -117,8 +117,8 @@ const KEEP_FINALIZED_FOR_LIVE_NETWORKS: u32 = 25;
/// Provides the header and block number for a hash.
///
/// Decouples `sc_client_api::Backend` and `sp_blockchain::HeaderBackend`.
pub trait HeaderProvider<Block, Error = sp_blockchain::Error>: Send + Sync + 'static
/// Decouples `pezsc_client_api::Backend` and `pezsp_blockchain::HeaderBackend`.
pub trait HeaderProvider<Block, Error = pezsp_blockchain::Error>: Send + Sync + 'static
where
Block: BlockT,
Error: std::fmt::Debug + Send + Sync + 'static,
@@ -138,19 +138,19 @@ where
impl<Block, T> HeaderProvider<Block> for T
where
Block: BlockT,
T: sp_blockchain::HeaderBackend<Block> + 'static,
T: pezsp_blockchain::HeaderBackend<Block> + 'static,
{
fn header(
&self,
hash: Block::Hash,
) -> sp_blockchain::Result<Option<<Block as BlockT>::Header>> {
<Self as sp_blockchain::HeaderBackend<Block>>::header(self, hash)
) -> pezsp_blockchain::Result<Option<<Block as BlockT>::Header>> {
<Self as pezsp_blockchain::HeaderBackend<Block>>::header(self, hash)
}
fn number(
&self,
hash: Block::Hash,
) -> sp_blockchain::Result<Option<<<Block as BlockT>::Header as HeaderT>::Number>> {
<Self as sp_blockchain::HeaderBackend<Block>>::number(self, hash)
) -> pezsp_blockchain::Result<Option<<<Block as BlockT>::Header as HeaderT>::Number>> {
<Self as pezsp_blockchain::HeaderBackend<Block>>::number(self, hash)
}
}
@@ -170,9 +170,9 @@ where
impl<Block, T> HeaderProviderProvider<Block> for T
where
Block: BlockT,
T: sc_client_api::Backend<Block> + 'static,
T: pezsc_client_api::Backend<Block> + 'static,
{
type Provider = <T as sc_client_api::Backend<Block>>::Blockchain;
type Provider = <T as pezsc_client_api::Backend<Block>>::Blockchain;
fn header_provider(&self) -> &Self::Provider {
self.blockchain()
@@ -188,13 +188,13 @@ pub enum Error {
AddrFormatInvalid(#[from] std::net::AddrParseError),
#[error(transparent)]
Sub(#[from] SubstrateServiceError),
Sub(#[from] BizinikiwiServiceError),
#[error(transparent)]
Blockchain(#[from] sp_blockchain::Error),
Blockchain(#[from] pezsp_blockchain::Error),
#[error(transparent)]
Consensus(#[from] sp_consensus::Error),
Consensus(#[from] pezsp_consensus::Error),
#[error("Failed to create an overseer")]
Overseer(#[from] pezkuwi_overseer::SubsystemError),
@@ -203,7 +203,7 @@ pub enum Error {
Prometheus(#[from] prometheus_endpoint::PrometheusError),
#[error(transparent)]
Telemetry(#[from] sc_telemetry::Error),
Telemetry(#[from] pezsc_telemetry::Error),
#[cfg(feature = "full-node")]
#[error(transparent)]
@@ -361,7 +361,7 @@ pub enum IsTeyrchainNode {
#[cfg(feature = "full-node")]
impl std::fmt::Debug for IsTeyrchainNode {
fn fmt(&self, fmt: &mut std::fmt::Formatter) -> std::fmt::Result {
use sp_core::Pair;
use pezsp_core::Pair;
match self {
IsTeyrchainNode::Collator(pair) => write!(fmt, "Collator({})", pair.public()),
IsTeyrchainNode::FullNode => write!(fmt, "FullNode"),
@@ -395,11 +395,11 @@ macro_rules! chain_ops {
let mut config = $config;
let basics = new_partial_basics(config, telemetry_worker_handle)?;
use ::sc_consensus::LongestChain;
use ::pezsc_consensus::LongestChain;
// use the longest chain selection, since there is no overseer available
let chain_selection = LongestChain::new(basics.backend.clone());
let sc_service::PartialComponents { client, backend, import_queue, task_manager, .. } =
let pezsc_service::PartialComponents { client, backend, import_queue, task_manager, .. } =
new_partial::<LongestChain<_, Block>>(&mut config, basics, chain_selection)?;
Ok((client, backend, import_queue, task_manager))
}};
@@ -409,9 +409,9 @@ macro_rules! chain_ops {
#[cfg(feature = "full-node")]
pub fn new_chain_ops(
config: &mut Configuration,
) -> Result<(Arc<FullClient>, Arc<FullBackend>, sc_consensus::BasicQueue<Block>, TaskManager), Error>
) -> Result<(Arc<FullClient>, Arc<FullBackend>, pezsc_consensus::BasicQueue<Block>, TaskManager), Error>
{
config.keystore = sc_service::config::KeystoreConfig::InMemory;
config.keystore = pezsc_service::config::KeystoreConfig::InMemory;
if config.chain_spec.is_pezkuwichain() || config.chain_spec.is_versi() {
chain_ops!(config, None)
@@ -444,10 +444,10 @@ pub fn build_full<OverseerGenerator: OverseerGen>(
});
match config.network.network_backend {
sc_network::config::NetworkBackendType::Libp2p =>
new_full::<_, sc_network::NetworkWorker<Block, Hash>>(config, params),
sc_network::config::NetworkBackendType::Litep2p =>
new_full::<_, sc_network::Litep2pNetworkBackend>(config, params),
pezsc_network::config::NetworkBackendType::Libp2p =>
new_full::<_, pezsc_network::NetworkWorker<Block, Hash>>(config, params),
pezsc_network::config::NetworkBackendType::Litep2p =>
new_full::<_, pezsc_network::Litep2pNetworkBackend>(config, params),
}
}
@@ -475,25 +475,25 @@ pub fn revert_backend(
let number = best_number - revertible;
let hash = client.block_hash_from_id(&BlockId::Number(number))?.ok_or(
sp_blockchain::Error::Backend(format!(
pezsp_blockchain::Error::Backend(format!(
"Unexpected hash lookup failure for block number: {}",
number
)),
)?;
let teyrchains_db = open_database(&config.database)
.map_err(|err| sp_blockchain::Error::Backend(err.to_string()))?;
.map_err(|err| pezsp_blockchain::Error::Backend(err.to_string()))?;
revert_approval_voting(teyrchains_db.clone(), hash, task_handle)?;
revert_chain_selection(teyrchains_db, hash)?;
// Revert Substrate consensus related components
sc_consensus_babe::revert(client.clone(), backend, blocks)?;
sc_consensus_grandpa::revert(client, blocks)?;
// Revert Bizinikiwi consensus related components
pezsc_consensus_babe::revert(client.clone(), backend, blocks)?;
pezsc_consensus_grandpa::revert(client, blocks)?;
Ok(())
}
fn revert_chain_selection(db: Arc<dyn Database>, hash: Hash) -> sp_blockchain::Result<()> {
fn revert_chain_selection(db: Arc<dyn Database>, hash: Hash) -> pezsp_blockchain::Result<()> {
let config = chain_selection_subsystem::Config {
col_data: teyrchains_db::REAL_COLUMNS.col_chain_selection_data,
stagnant_check_interval: chain_selection_subsystem::StagnantCheckInterval::never(),
@@ -504,14 +504,14 @@ fn revert_chain_selection(db: Arc<dyn Database>, hash: Hash) -> sp_blockchain::R
chain_selection
.revert_to(hash)
.map_err(|err| sp_blockchain::Error::Backend(err.to_string()))
.map_err(|err| pezsp_blockchain::Error::Backend(err.to_string()))
}
fn revert_approval_voting(
db: Arc<dyn Database>,
hash: Hash,
task_handle: SpawnTaskHandle,
) -> sp_blockchain::Result<()> {
) -> pezsp_blockchain::Result<()> {
let config = approval_voting_subsystem::Config {
col_approval_data: teyrchains_db::REAL_COLUMNS.col_approval_data,
slot_duration_millis: Default::default(),
@@ -520,13 +520,13 @@ fn revert_approval_voting(
let approval_voting = approval_voting_subsystem::ApprovalVotingSubsystem::with_config(
config,
db,
Arc::new(sc_keystore::LocalKeystore::in_memory()),
Box::new(sp_consensus::NoNetwork),
Arc::new(pezsc_keystore::LocalKeystore::in_memory()),
Box::new(pezsp_consensus::NoNetwork),
approval_voting_subsystem::Metrics::default(),
Arc::new(SpawnGlue(task_handle)),
);
approval_voting
.revert_to(hash)
.map_err(|err| sp_blockchain::Error::Backend(err.to_string()))
.map_err(|err| pezsp_blockchain::Error::Backend(err.to_string()))
}
+11 -11
View File
@@ -17,7 +17,7 @@
use super::{Error, IsTeyrchainNode, Registry};
use pezkuwi_node_subsystem_types::{ChainApiBackend, RuntimeApiSubsystemClient};
use pezkuwi_overseer::{DummySubsystem, InitializedOverseerBuilder, SubsystemError};
use sp_core::traits::SpawnNamed;
use pezsp_core::traits::SpawnNamed;
use pezkuwi_availability_distribution::IncomingRequestReceivers;
use pezkuwi_node_core_approval_voting::Config as ApprovalVotingConfig;
@@ -39,10 +39,10 @@ use pezkuwi_overseer::{
};
use parking_lot::Mutex;
use sc_authority_discovery::Service as AuthorityDiscoveryService;
use sc_client_api::AuxStore;
use sc_keystore::LocalKeystore;
use sc_network::{NetworkStateInfo, NotificationService};
use pezsc_authority_discovery::Service as AuthorityDiscoveryService;
use pezsc_client_api::AuxStore;
use pezsc_keystore::LocalKeystore;
use pezsc_network::{NetworkStateInfo, NotificationService};
use std::{
collections::{HashMap, HashSet},
sync::Arc,
@@ -86,9 +86,9 @@ where
/// Runtime client generic, providing the `ProvideRuntimeApi` trait besides others.
pub runtime_client: Arc<RuntimeClient>,
/// Underlying network service implementation.
pub network_service: Arc<dyn sc_network::service::traits::NetworkService>,
pub network_service: Arc<dyn pezsc_network::service::traits::NetworkService>,
/// Underlying syncing service implementation.
pub sync_service: Arc<dyn sp_consensus::SyncOracle + Send + Sync>,
pub sync_service: Arc<dyn pezsp_consensus::SyncOracle + Send + Sync>,
/// Underlying authority discovery service.
pub authority_discovery_service: AuthorityDiscoveryService,
/// Collations request receiver for network protocol v1.
@@ -200,11 +200,11 @@ pub fn validator_overseer_builder<Spawner, RuntimeClient>(
RuntimeApiSubsystem<RuntimeClient>,
AvailabilityStoreSubsystem,
NetworkBridgeRxSubsystem<
Arc<dyn sc_network::service::traits::NetworkService>,
Arc<dyn pezsc_network::service::traits::NetworkService>,
AuthorityDiscoveryService,
>,
NetworkBridgeTxSubsystem<
Arc<dyn sc_network::service::traits::NetworkService>,
Arc<dyn pezsc_network::service::traits::NetworkService>,
AuthorityDiscoveryService,
>,
ChainApiSubsystem<RuntimeClient>,
@@ -398,11 +398,11 @@ pub fn collator_overseer_builder<Spawner, RuntimeClient>(
RuntimeApiSubsystem<RuntimeClient>,
DummySubsystem,
NetworkBridgeRxSubsystem<
Arc<dyn sc_network::service::traits::NetworkService>,
Arc<dyn pezsc_network::service::traits::NetworkService>,
AuthorityDiscoveryService,
>,
NetworkBridgeTxSubsystem<
Arc<dyn sc_network::service::traits::NetworkService>,
Arc<dyn pezsc_network::service::traits::NetworkService>,
AuthorityDiscoveryService,
>,
ChainApiSubsystem<RuntimeClient>,
@@ -45,10 +45,10 @@ use pezkuwi_node_subsystem::messages::{
use pezkuwi_node_subsystem_util::metrics::{self, prometheus};
use pezkuwi_overseer::{AllMessages, Handle, PriorityLevel};
use pezkuwi_primitives::{Block as PezkuwiBlock, BlockNumber, Hash, Header as PezkuwiHeader};
use sp_consensus::{Error as ConsensusError, SelectChain};
use pezsp_consensus::{Error as ConsensusError, SelectChain};
use std::sync::Arc;
pub use sc_service::SpawnTaskHandle;
pub use pezsc_service::SpawnTaskHandle;
/// The maximum amount of unfinalized blocks we are willing to allow due to approval checking
/// or disputes.
@@ -114,14 +114,14 @@ impl Metrics {
/// Determines whether the chain is a relay chain
/// and hence has to take approval votes and disputes
/// into account.
enum IsDisputesAwareWithOverseer<B: sc_client_api::Backend<PezkuwiBlock>> {
enum IsDisputesAwareWithOverseer<B: pezsc_client_api::Backend<PezkuwiBlock>> {
Yes(SelectRelayChainInner<B, Handle>),
No,
}
impl<B> Clone for IsDisputesAwareWithOverseer<B>
where
B: sc_client_api::Backend<PezkuwiBlock>,
B: pezsc_client_api::Backend<PezkuwiBlock>,
SelectRelayChainInner<B, Handle>: Clone,
{
fn clone(&self) -> Self {
@@ -133,14 +133,14 @@ where
}
/// A chain-selection implementation which provides safety for relay chains.
pub struct SelectRelayChain<B: sc_client_api::Backend<PezkuwiBlock>> {
longest_chain: sc_consensus::LongestChain<B, PezkuwiBlock>,
pub struct SelectRelayChain<B: pezsc_client_api::Backend<PezkuwiBlock>> {
longest_chain: pezsc_consensus::LongestChain<B, PezkuwiBlock>,
selection: IsDisputesAwareWithOverseer<B>,
}
impl<B> Clone for SelectRelayChain<B>
where
B: sc_client_api::Backend<PezkuwiBlock>,
B: pezsc_client_api::Backend<PezkuwiBlock>,
SelectRelayChainInner<B, Handle>: Clone,
{
fn clone(&self) -> Self {
@@ -150,14 +150,14 @@ where
impl<B> SelectRelayChain<B>
where
B: sc_client_api::Backend<PezkuwiBlock> + 'static,
B: pezsc_client_api::Backend<PezkuwiBlock> + 'static,
{
/// Use the plain longest chain algorithm exclusively.
pub fn new_longest_chain(backend: Arc<B>) -> Self {
gum::debug!(target: LOG_TARGET, "Using {} chain selection algorithm", "longest");
Self {
longest_chain: sc_consensus::LongestChain::new(backend.clone()),
longest_chain: pezsc_consensus::LongestChain::new(backend.clone()),
selection: IsDisputesAwareWithOverseer::No,
}
}
@@ -173,7 +173,7 @@ where
gum::debug!(target: LOG_TARGET, "Using dispute aware relay-chain selection algorithm",);
SelectRelayChain {
longest_chain: sc_consensus::LongestChain::new(backend.clone()),
longest_chain: pezsc_consensus::LongestChain::new(backend.clone()),
selection: IsDisputesAwareWithOverseer::Yes(SelectRelayChainInner::new(
backend,
overseer,
@@ -184,7 +184,7 @@ where
}
/// Allow access to the inner chain, for usage during the node setup.
pub fn as_longest_chain(&self) -> &sc_consensus::LongestChain<B, PezkuwiBlock> {
pub fn as_longest_chain(&self) -> &pezsc_consensus::LongestChain<B, PezkuwiBlock> {
&self.longest_chain
}
}
@@ -192,7 +192,7 @@ where
#[async_trait::async_trait]
impl<B> SelectChain<PezkuwiBlock> for SelectRelayChain<B>
where
B: sc_client_api::Backend<PezkuwiBlock> + 'static,
B: pezsc_client_api::Backend<PezkuwiBlock> + 'static,
{
async fn leaves(&self) -> Result<Vec<Hash>, ConsensusError> {
match self.selection {
+6 -6
View File
@@ -22,12 +22,12 @@ use pezkuwi_node_subsystem::messages::{AllMessages, BlockDescription};
use pezkuwi_node_subsystem_util::TimeoutExt;
use pezkuwi_overseer::{HighPriority, PriorityLevel};
use pezkuwi_test_client::Sr25519Keyring;
use sp_consensus_babe::{
use pezsp_consensus_babe::{
digests::{CompatibleDigestItem, PreDigest, SecondaryVRFPreDigest},
VrfTranscript,
};
use sp_core::{crypto::VrfSecret, testing::TaskExecutor};
use sp_runtime::{testing::*, DigestItem};
use pezsp_core::{crypto::VrfSecret, testing::TaskExecutor};
use pezsp_runtime::{testing::*, DigestItem};
use std::{
collections::{BTreeMap, HashMap, HashSet},
iter::IntoIterator,
@@ -88,7 +88,7 @@ fn test_harness<T: Future<Output = VirtualOverseer>>(
case_vars: CaseVars,
test: impl FnOnce(TestHarness) -> T,
) {
sp_tracing::init_for_tests();
pezsp_tracing::init_for_tests();
let pool = TaskExecutor::new();
let (mut context, virtual_overseer) =
@@ -228,10 +228,10 @@ impl TestChainStorage {
}
impl HeaderProvider<Block> for TestChainStorage {
fn header(&self, hash: Hash) -> sp_blockchain::Result<Option<Header>> {
fn header(&self, hash: Hash) -> pezsp_blockchain::Result<Option<Header>> {
Ok(self.blocks_by_hash.get(&hash).cloned())
}
fn number(&self, hash: Hash) -> sp_blockchain::Result<Option<BlockNumber>> {
fn number(&self, hash: Hash) -> pezsp_blockchain::Result<Option<BlockNumber>> {
self.header(hash).map(|opt| opt.map(|h| h.number))
}
}