fix: Complete snowbridge pezpallet rebrand and critical bug fixes

- snowbridge-pezpallet-* → pezsnowbridge-pezpallet-* (201 refs)
- pallet/ directories → pezpallet/ (4 locations)
- Fixed pezpallet.rs self-include recursion bug
- Fixed sc-chain-spec hardcoded crate name in derive macro
- Reverted .pezpallet_by_name() to .pallet_by_name() (subxt API)
- Added BizinikiwiConfig type alias for zombienet tests
- Deleted obsolete session state files

Verified: pezsnowbridge-pezpallet-*, pezpallet-staking,
pezpallet-staking-async, pezframe-benchmarking-cli all pass cargo check
This commit is contained in:
2025-12-16 09:57:23 +03:00
parent eea003e14d
commit 3139ffa25e
3022 changed files with 42157 additions and 23579 deletions
@@ -21,7 +21,7 @@ use proc_macro_crate::{crate_name, FoundCrate};
use quote::quote;
use syn::{DeriveInput, Error, Ident, Path};
const CRATE_NAME: &str = "sc-chain-spec";
const CRATE_NAME: &str = "pezsc-chain-spec";
const ATTRIBUTE_NAME: &str = "forks";
/// Implements `Extension's` `Group` accessor.
+1 -1
View File
@@ -174,7 +174,7 @@
//!
//! The main purpose of the `RuntimeGenesisConfig` patch is to:
//! - minimize the maintenance effort when RuntimeGenesisConfig is changed in the future (e.g. new
//! pallets added to the runtime or pallet's genesis config changed),
//! pallets added to the runtime or pezpallet's genesis config changed),
//! - increase the readability - it only contains the relevant fields,
//! - allow to apply numerous changes in distinct domains (e.g. for zombienet).
//!
@@ -44,7 +44,7 @@ pub(super) fn calculate_primary_threshold(
use num_traits::{cast::ToPrimitive, identities::One};
// Prevent div by zero and out of bounds access.
// While Babe's pallet implementation that ships with FRAME performs a sanity check over
// While Babe's pezpallet implementation that ships with FRAME performs a sanity check over
// configuration parameters, this is not sufficient to guarantee that `c.1` is non-zero
// (i.e. third party implementations are possible).
if c.1 == 0 || authority_index >= authorities.len() {
+12 -12
View File
@@ -283,7 +283,7 @@ where
finality_notifications: &mut Fuse<FinalityNotifications<B>>,
is_authority: bool,
) -> Result<Self, Error> {
// Wait for BEEFY pallet to be active before starting voter.
// Wait for BEEFY pezpallet to be active before starting voter.
let (beefy_genesis, best_grandpa) =
wait_for_runtime_pallet(&*runtime, finality_notifications).await?;
@@ -335,7 +335,7 @@ where
// If no persisted state present, walk back the chain from first GRANDPA notification to either:
// - latest BEEFY finalized block, or if none found on the way,
// - BEEFY pallet genesis;
// - BEEFY pezpallet genesis;
// Enqueue any BEEFY mandatory blocks (session boundaries) found on the way, for voter to
// finalize.
async fn init_state(
@@ -353,9 +353,9 @@ where
.ok()
.flatten()
.filter(|genesis| *genesis == beefy_genesis)
.ok_or_else(|| Error::Backend("BEEFY pallet expected to be active.".into()))?;
.ok_or_else(|| Error::Backend("BEEFY pezpallet expected to be active.".into()))?;
// Walk back the imported blocks and initialize voter either, at the last block with
// a BEEFY justification, or at pallet genesis block; voter will resume from there.
// a BEEFY justification, or at pezpallet genesis block; voter will resume from there.
let mut sessions = VecDeque::new();
let mut header = best_grandpa.clone();
let state = loop {
@@ -444,7 +444,7 @@ where
) -> Result<PersistedState<B, AuthorityId>, Error> {
// Initialize voter state from AUX DB if compatible.
if let Some(mut state) = crate::aux_schema::load_persistent(backend.as_ref())?
// Verify state pallet genesis matches runtime.
// Verify state pezpallet genesis matches runtime.
.filter(|state| state.pezpallet_genesis() == beefy_genesis)
{
// Overwrite persisted state with current best GRANDPA block.
@@ -485,7 +485,7 @@ where
return Ok(state);
}
// No valid voter-state persisted, re-initialize from pallet genesis.
// No valid voter-state persisted, re-initialize from pezpallet genesis.
Self::init_state(beefy_genesis, best_grandpa, min_block_delta, backend, runtime).await
}
}
@@ -557,8 +557,8 @@ pub async fn start_beefy_gadget<B, BE, C, N, P, R, S, AuthorityId>(
let mut block_import_justif = links.from_block_import_justif_stream.subscribe(100_000).fuse();
// Subscribe to finality notifications and justifications before waiting for runtime pallet and
// reuse the streams, so we don't miss notifications while waiting for pallet to be available.
// Subscribe to finality notifications and justifications before waiting for runtime pezpallet and
// reuse the streams, so we don't miss notifications while waiting for pezpallet to be available.
let finality_notifications = client.finality_notification_stream();
let (mut transformer, mut finality_notifications) =
finality_notification_transformer_future(finality_notifications);
@@ -718,7 +718,7 @@ where
}
}
/// Wait for BEEFY runtime pallet to be available, return active validator set.
/// Wait for BEEFY runtime pezpallet to be available, return active validator set.
/// Should be called only once during worker initialization.
async fn wait_for_runtime_pallet<B, R, AuthorityId: AuthorityIdBound>(
runtime: &R,
@@ -729,7 +729,7 @@ where
R: ProvideRuntimeApi<B>,
R::Api: BeefyApi<B, AuthorityId>,
{
info!(target: LOG_TARGET, "🥩 BEEFY gadget waiting for BEEFY pallet to become available...");
info!(target: LOG_TARGET, "🥩 BEEFY gadget waiting for BEEFY pezpallet to become available...");
loop {
let notif = finality.next().await.ok_or_else(|| {
let err_msg = "🥩 Finality stream has unexpectedly terminated.".into();
@@ -739,10 +739,10 @@ where
let at = notif.header.hash();
if let Some(start) = runtime.runtime_api().beefy_genesis(at).ok().flatten() {
if *notif.header.number() >= start {
// Beefy pallet available, return header for best grandpa at the time.
// Beefy pezpallet available, return header for best grandpa at the time.
info!(
target: LOG_TARGET,
"🥩 BEEFY pallet available: block {:?} beefy genesis {:?}",
"🥩 BEEFY pezpallet available: block {:?} beefy genesis {:?}",
notif.header.number(), start
);
return Ok((start, notif.header));
@@ -828,7 +828,7 @@ async fn beefy_importing_justifications() {
ImportResult::AlreadyInChain,
);
// Import block 2 with "valid" justification (beefy pallet genesis block not yet reached).
// Import block 2 with "valid" justification (beefy pezpallet genesis block not yet reached).
let block_num = 2;
let builder = BlockBuilderBuilder::new(&*full_client)
.on_parent_block(hashof1)
@@ -1072,7 +1072,7 @@ async fn should_initialize_voter_at_custom_genesis() {
let validator_set = ValidatorSet::new(make_beefy_ids(keys), 0).unwrap();
let mut net = BeefyTestNet::new(1);
let backend = net.peer(0).client().as_backend();
// custom pallet genesis is block number 7
// custom pezpallet genesis is block number 7
let custom_pallet_genesis = 7;
let api = TestApi::new(custom_pallet_genesis, &validator_set, GOOD_MMR_ROOT);
@@ -1118,7 +1118,7 @@ async fn should_initialize_voter_at_custom_genesis() {
let api = TestApi::new(new_pallet_genesis, &new_validator_set, GOOD_MMR_ROOT);
net.peer(0).client().as_client().finalize_block(hashes[10], None).unwrap();
// load persistent state - state preset in DB, but with different pallet genesis
// load persistent state - state preset in DB, but with different pezpallet genesis
let new_persisted_state =
voter_init_setup(&mut net, &mut finality_notifications, &api).await.unwrap();
@@ -1259,7 +1259,7 @@ async fn should_initialize_voter_at_custom_genesis_when_state_unavailable() {
let validator_set = ValidatorSet::new(make_beefy_ids(keys), 0).unwrap();
let mut net = BeefyTestNet::new(1);
let backend = net.peer(0).client().as_backend();
// custom pallet genesis is block number 7
// custom pezpallet genesis is block number 7
let custom_pallet_genesis = 7;
let mut api = TestApi::new(custom_pallet_genesis, &validator_set, GOOD_MMR_ROOT);
// remove validator set from `TestApi`, practically simulating unavailable/pruned runtime state
@@ -1395,7 +1395,7 @@ async fn beefy_finalizing_after_pallet_genesis() {
// Minimum BEEFY block delta is 1.
// GRANDPA finalize blocks leading up to BEEFY pallet genesis -> BEEFY should finalize nothing.
// GRANDPA finalize blocks leading up to BEEFY pezpallet genesis -> BEEFY should finalize nothing.
finalize_block_and_wait_for_beefy(&net, peers.clone(), &hashes[14], &[]).await;
// GRANDPA finalize block #16 -> BEEFY should finalize #15 (genesis mandatory) and #16.
@@ -280,7 +280,7 @@ pub(crate) struct PersistedState<B: Block, AuthorityId: AuthorityIdBound> {
/// Chooses which incoming votes to accept and which votes to generate.
/// Keeps track of voting seen for current and future rounds.
voting_oracle: VoterOracle<B, AuthorityId>,
/// Pallet-beefy genesis block - block number when BEEFY consensus started for this chain.
/// Pezpallet-beefy genesis block - block number when BEEFY consensus started for this chain.
pezpallet_genesis: NumberFor<B>,
}
@@ -6,7 +6,7 @@ edition.workspace = true
license = "Apache-2.0"
homepage.workspace = true
repository.workspace = true
description = "Node-specific RPC methods for interaction with Merkle Mountain Range pallet."
description = "Node-specific RPC methods for interaction with Merkle Mountain Range pezpallet."
documentation = "https://docs.rs/pezmmr-rpc"
[lints]
@@ -18,7 +18,7 @@
#![warn(missing_docs)]
#![warn(unused_crate_dependencies)]
//! Node-specific RPC methods for interaction with Merkle Mountain Range pallet.
//! Node-specific RPC methods for interaction with Merkle Mountain Range pezpallet.
use std::{marker::PhantomData, sync::Arc};
@@ -81,7 +81,7 @@ pub trait MmrApi<BlockHash, BlockNumber, MmrHash> {
/// Generate an MMR proof for the given `block_numbers`.
///
/// This method calls into a runtime with MMR pallet included and attempts to generate
/// This method calls into a runtime with MMR pezpallet included and attempts to generate
/// an MMR proof for the set of blocks that have the given `block_numbers` with the MMR root at
/// `best_known_block_number`. `best_known_block_number` must be larger than all the
/// `block_numbers` for the function to succeed.
@@ -108,7 +108,7 @@ pub trait MmrApi<BlockHash, BlockNumber, MmrHash> {
/// Generate an MMR ancestry proof for the given `prev_block_number`.
///
/// This method calls into a runtime with MMR pallet included and attempts to generate
/// This method calls into a runtime with MMR pezpallet included and attempts to generate
/// an MMR ancestry proof for the MMR root at the prior block with number `prev_block_number`,
/// with the reference MMR root at `best_known_block_number`. `best_known_block_number` must be
/// larger than the `prev_block_number` for the function to succeed.
@@ -134,7 +134,7 @@ pub trait MmrApi<BlockHash, BlockNumber, MmrHash> {
/// Verify an MMR `proof`.
///
/// This method calls into a runtime with MMR pallet included and attempts to verify
/// This method calls into a runtime with MMR pezpallet included and attempts to verify
/// an MMR proof.
///
/// Returns `true` if the proof is valid, else returns the verification error.
@@ -143,7 +143,7 @@ pub trait MmrApi<BlockHash, BlockNumber, MmrHash> {
/// Verify an MMR `proof` statelessly given an `mmr_root`.
///
/// This method calls into a runtime with MMR pallet included and attempts to verify
/// This method calls into a runtime with MMR pezpallet included and attempts to verify
/// an MMR proof against a provided MMR root.
///
/// Returns `true` if the proof is valid, else returns the verification error.
@@ -82,14 +82,14 @@ where
B: Block,
BE: AuxStore,
{
// Initialize gadget best_canon from AUX DB or from pallet genesis.
// Initialize gadget best_canon from AUX DB or from pezpallet genesis.
if let Some(best) = load_state::<B, BE>(backend)? {
info!(target: LOG_TARGET, "Loading MMR best canonicalized state from db: {:?}.", best);
Ok(best)
} else {
info!(
target: LOG_TARGET,
"Loading MMR from pallet genesis on what appears to be the first startup: {:?}.",
"Loading MMR from pezpallet genesis on what appears to be the first startup: {:?}.",
default
);
write_current_version(backend)?;
@@ -66,7 +66,7 @@ where
BE: Backend<B>,
Self::Api: MmrApi<B, MmrRootHash, NumberFor<B>>,
{
/// Get the block number where the mmr pallet was added to the runtime.
/// Get the block number where the mmr pezpallet was added to the runtime.
fn first_mmr_block_num(&self, notification: &FinalityNotification<B>) -> Option<NumberFor<B>> {
let best_block_hash = notification.header.hash();
let best_block_number = *notification.header.number();
@@ -167,7 +167,7 @@ where
_ => return,
};
// Don't canonicalize branches corresponding to blocks for which the MMR pallet
// Don't canonicalize branches corresponding to blocks for which the MMR pezpallet
// wasn't yet initialized.
if header.number < self.first_mmr_block {
return;
@@ -263,7 +263,7 @@ where
/// _canonical key_.
/// Prune leafs and nodes added by stale blocks in offchain db from _fork-aware key_.
pub fn canonicalize_and_prune(&mut self, notification: FinalityNotification<B>) {
// Update the first MMR block in case of a pallet reset.
// Update the first MMR block in case of a pezpallet reset.
self.handle_potential_pallet_reset(&notification);
// Move offchain MMR nodes for finalized blocks to canonical keys.
@@ -328,7 +328,7 @@ mod tests {
run_test_with_pezmmr_gadget(|client| async move {
// G -> A1 -> A2 -> A3 -> A4 -> A5
// | |
// | | -> pallet reset
// | | -> pezpallet reset
// |
// | -> first finality notification
@@ -427,7 +427,7 @@ mod tests {
// | | | -> gadget start
// | |
// | | -> finalized before gadget start (missed notification)
// | | + pallet reset
// | | + pezpallet reset
// |
// | -> first mmr block
let blocks = mmr_blocks.lock();
+1 -1
View File
@@ -340,7 +340,7 @@ mod tests {
use std::{collections::HashSet, sync::Arc};
use bizinikiwi_test_runtime_client::{
runtime::{
bizinikiwi_test_pallet::pallet::Call as PalletCall, ExtrinsicBuilder, RuntimeCall,
bizinikiwi_test_pallet::pezpallet::Call as PalletCall, ExtrinsicBuilder, RuntimeCall,
},
ClientBlockImportExt, DefaultTestClientBuilderExt, TestClientBuilderExt,
};
+1 -1
View File
@@ -206,7 +206,7 @@ pub trait StateApi<Hash> {
/// curl \
/// -H "Content-Type: application/json" \
/// -d '{"id":1, "jsonrpc":"2.0", "method": "state_traceBlock", \
/// "params": ["0xb246acf1adea1f801ce15c77a5fa7d8f2eb8fed466978bcee172cc02cf64e264", "pallet,frame,state", "", ""]}' \
/// "params": ["0xb246acf1adea1f801ce15c77a5fa7d8f2eb8fed466978bcee172cc02cf64e264", "pezpallet,frame,state", "", ""]}' \
/// http://localhost:9933/
/// ```
///
+3 -3
View File
@@ -46,8 +46,8 @@ use pezsp_runtime::{
};
use pezsp_tracing::{WASM_NAME_KEY, WASM_TARGET_KEY, WASM_TRACE_IDENTIFIER};
// Default to only pallet, frame support and state related traces
const DEFAULT_TARGETS: &str = "pallet,frame,state";
// Default to only pezpallet, frame support and state related traces
const DEFAULT_TARGETS: &str = "pezpallet,frame,state";
const TRACE_TARGET: &str = "block_trace";
// The name of a field required for all events.
const REQUIRED_EVENT_FIELD: &str = "method";
@@ -200,7 +200,7 @@ impl Subscriber for BlockSubscriber {
}
/// Holds a reference to the client in order to execute the given block.
/// Records spans & events for the supplied targets (eg. "pallet,frame,state") and
/// Records spans & events for the supplied targets (eg. "pezpallet,frame,state") and
/// only records events with the specified hex encoded storage key prefixes.
/// Note: if `targets` or `storage_keys` is an empty string then nothing is
/// filtered out.
+4 -4
View File
@@ -223,8 +223,8 @@ pub enum TraceHandlerEvents {
impl ProfilingLayer {
/// Takes a `TracingReceiver` and a comma separated list of targets,
/// either with a level: "pallet=trace,frame=debug"
/// or without: "pallet,frame" in which case the level defaults to `trace`.
/// either with a level: "pezpallet=trace,frame=debug"
/// or without: "pezpallet,frame" in which case the level defaults to `trace`.
/// wasm_tracing indicates whether to enable wasm traces
pub fn new(receiver: TracingReceiver, targets: &str) -> Self {
match receiver {
@@ -234,8 +234,8 @@ impl ProfilingLayer {
/// Allows use of a custom TraceHandler to create a new instance of ProfilingSubscriber.
/// Takes a comma separated list of targets,
/// either with a level, eg: "pallet=trace"
/// or without: "pallet" in which case the level defaults to `trace`.
/// either with a level, eg: "pezpallet=trace"
/// or without: "pezpallet" in which case the level defaults to `trace`.
/// wasm_tracing indicates whether to enable wasm traces
pub fn new_with_handler(trace_handler: Box<dyn TraceHandler>, targets: &str) -> Self {
let targets: Vec<_> = targets.split(',').map(parse_target).collect();
@@ -36,7 +36,7 @@ use pezsp_runtime::{
};
use std::{collections::HashSet, sync::Arc};
use bizinikiwi_test_runtime::{
bizinikiwi_test_pallet::pallet::Call as PalletCall, BalancesCall, Block, BlockNumber, Extrinsic,
bizinikiwi_test_pallet::pezpallet::Call as PalletCall, BalancesCall, Block, BlockNumber, Extrinsic,
ExtrinsicBuilder, Hashing, RuntimeCall, Transfer, TransferData, H256,
};
@@ -24,10 +24,13 @@ use std::time::SystemTime;
use tracing_subscriber::EnvFilter;
use txtesttool::scenario::{ChainType, ScenarioBuilder};
use zombienet_sdk::{
subxt::BizinikiwiConfig, GlobalSettingsBuilder, LocalFileSystem, Network, NetworkConfig,
subxt::SubstrateConfig, GlobalSettingsBuilder, LocalFileSystem, Network, NetworkConfig,
NetworkConfigBuilder, NetworkConfigExt, WithRelaychain,
};
/// Bizinikiwi configuration for zombienet tests - based on SubstrateConfig
pub type BizinikiwiConfig = SubstrateConfig;
/// Gathers TOML files paths for relaychains and for teyrchains' (that use pezkuwichain-local based
/// relaychains) zombienet network specs for testing in relation to fork aware transaction pool.
pub mod relaychain_pezkuwichain_local_network_spec {