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
+1 -1
View File
@@ -4,7 +4,7 @@ version = "0.7.0"
authors.workspace = true
edition.workspace = true
repository.workspace = true
description = "Migrates messages from the old DMP queue pallet."
description = "Migrates messages from the old DMP queue pezpallet."
license = "Apache-2.0"
documentation = "https://docs.rs/pezcumulus-pezpallet-dmp-queue"
homepage = { workspace = true }
@@ -38,7 +38,7 @@ mod benchmarks {
#[block]
{
Pallet::<T>::on_idle(0u32.into(), Weight::MAX);
Pezpallet::<T>::on_idle(0u32.into(), Weight::MAX);
}
assert_last_event::<T>(Event::Exported { page: 0 }.into());
@@ -55,7 +55,7 @@ mod benchmarks {
#[block]
{
Pallet::<T>::on_idle(0u32.into(), Weight::MAX);
Pezpallet::<T>::on_idle(0u32.into(), Weight::MAX);
}
assert_last_event::<T>(Event::Exported { page: 0 }.into());
@@ -73,7 +73,7 @@ mod benchmarks {
#[block]
{
Pallet::<T>::on_idle(0u32.into(), Weight::MAX);
Pezpallet::<T>::on_idle(0u32.into(), Weight::MAX);
}
assert_last_event::<T>(Event::ExportedOverweight { index: 0 }.into());
@@ -91,17 +91,17 @@ mod benchmarks {
#[block]
{
Pallet::<T>::on_idle(0u32.into(), Weight::MAX);
Pezpallet::<T>::on_idle(0u32.into(), Weight::MAX);
}
assert_last_event::<T>(Event::ExportOverweightFailed { index: 0 }.into());
}
impl_benchmark_test_suite!(Pallet, crate::mock::new_test_ext(), crate::mock::Runtime);
impl_benchmark_test_suite!(Pezpallet, crate::mock::new_test_ext(), crate::mock::Runtime);
}
fn assert_last_event<T: Config>(generic_event: <T as Config>::RuntimeEvent) {
let events = pezframe_system::Pallet::<T>::events();
let events = pezframe_system::Pezpallet::<T>::events();
let system_event: <T as pezframe_system::Config>::RuntimeEvent = generic_event.into();
let pezframe_system::EventRecord { event, .. } = events.last().expect("Event expected");
assert_eq!(event, &system_event.into());
+27 -27
View File
@@ -13,20 +13,20 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//! This pallet used to implement a message queue for downward messages from the relay-chain.
//! This pezpallet used to implement a message queue for downward messages from the relay-chain.
//!
//! It is now deprecated and has been refactored to simply drain any remaining messages into
//! something implementing `HandleMessage`. It proceeds in the state of
//! [`MigrationState`] one by one by their listing in the source code. The pallet can be removed
//! [`MigrationState`] one by one by their listing in the source code. The pezpallet can be removed
//! from the runtime once `Completed` was emitted.
#![cfg_attr(not(feature = "std"), no_std)]
#![allow(deprecated)] // The pallet itself is deprecated.
#![allow(deprecated)] // The pezpallet itself is deprecated.
extern crate alloc;
use migration::*;
pub use pallet::*;
pub use pezpallet::*;
mod benchmarking;
mod migration;
@@ -40,11 +40,11 @@ pub use weights::WeightInfo;
pub type MaxDmpMessageLenOf<T> =
<<T as Config>::DmpSink as pezframe_support::traits::HandleMessage>::MaxMessageLen;
#[pezframe_support::pallet]
#[pezframe_support::pezpallet]
#[deprecated(
note = "`pezcumulus-pezpallet-dmp-queue` will be removed after November 2024. It can be removed once its lazy migration completed. See <https://github.com/pezkuwichain/kurdistan-sdk/issues/101>."
)]
pub mod pallet {
pub mod pezpallet {
use super::*;
use pezframe_support::{pezpallet_prelude::*, traits::HandleMessage, weights::WeightMeter};
use pezframe_system::pezpallet_prelude::*;
@@ -52,11 +52,11 @@ pub mod pallet {
const STORAGE_VERSION: StorageVersion = StorageVersion::new(2);
#[pallet::pallet]
#[pallet::storage_version(STORAGE_VERSION)]
pub struct Pallet<T>(_);
#[pezpallet::pezpallet]
#[pezpallet::storage_version(STORAGE_VERSION)]
pub struct Pezpallet<T>(_);
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {
/// The overarching event type of the runtime.
#[allow(deprecated)]
@@ -65,15 +65,15 @@ pub mod pallet {
/// The sink for all DMP messages that the lazy migration will use.
type DmpSink: HandleMessage;
/// Weight info for this pallet (only needed for the lazy migration).
/// Weight info for this pezpallet (only needed for the lazy migration).
type WeightInfo: WeightInfo;
}
/// The migration state of this pallet.
#[pallet::storage]
/// The migration state of this pezpallet.
#[pezpallet::storage]
pub type MigrationStatus<T> = StorageValue<_, MigrationState, ValueQuery>;
/// The lazy-migration state of the pallet.
/// The lazy-migration state of the pezpallet.
#[derive(
codec::Encode, codec::Decode, Debug, PartialEq, Eq, Clone, MaxEncodedLen, TypeInfo,
)]
@@ -96,7 +96,7 @@ pub mod pallet {
CompletedOverweightExport,
/// The storage cleanup started.
StartedCleanup { cursor: Option<BoundedVec<u8, ConstU32<1024>>> },
/// The migration finished. The pallet can now be removed from the runtime.
/// The migration finished. The pezpallet can now be removed from the runtime.
Completed,
}
@@ -106,8 +106,8 @@ pub mod pallet {
}
}
#[pallet::event]
#[pallet::generate_deposit(pub(super) fn deposit_event)]
#[pezpallet::event]
#[pezpallet::generate_deposit(pub(super) fn deposit_event)]
pub enum Event<T: Config> {
/// The export of pages started.
StartedExport,
@@ -137,21 +137,21 @@ pub mod pallet {
/// The export of overweight messages completed.
CompletedOverweightExport,
/// The cleanup of remaining pallet storage started.
/// The cleanup of remaining pezpallet storage started.
StartedCleanup,
/// Some debris was cleaned up.
CleanedSome { keys_removed: u32 },
/// The cleanup of remaining pallet storage completed.
/// The cleanup of remaining pezpallet storage completed.
Completed { error: bool },
}
#[pallet::call]
impl<T: Config> Pallet<T> {}
#[pezpallet::call]
impl<T: Config> Pezpallet<T> {}
#[pallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {
#[pezpallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pezpallet<T> {
fn integrity_test() {
let w = Self::on_idle_weight();
assert!(w != Weight::zero());
@@ -244,7 +244,7 @@ pub mod pallet {
MigrationState::StartedCleanup { cursor } => {
log::debug!(target: LOG, "Cleaning up");
let hashed_prefix =
twox_128(<Pallet<T> as PalletInfoAccess>::name().as_bytes());
twox_128(<Pezpallet<T> as PalletInfoAccess>::name().as_bytes());
let result = pezframe_support::storage::unhashed::clear_prefix(
&hashed_prefix,
@@ -253,7 +253,7 @@ pub mod pallet {
);
Self::deposit_event(Event::CleanedSome { keys_removed: result.backend });
// GOTCHA! We deleted *all* pallet storage; hence we also our own
// GOTCHA! We deleted *all* pezpallet storage; hence we also our own
// `MigrationState`. BUT we insert it back:
if let Some(unbound_cursor) = result.maybe_cursor {
if let Ok(cursor) = unbound_cursor.try_into() {
@@ -273,7 +273,7 @@ pub mod pallet {
}
},
MigrationState::Completed => {
log::debug!(target: LOG, "Idle; you can remove this pallet");
log::debug!(target: LOG, "Idle; you can remove this pezpallet");
},
}
@@ -281,7 +281,7 @@ pub mod pallet {
}
}
impl<T: Config> Pallet<T> {
impl<T: Config> Pezpallet<T> {
/// The worst-case weight of [`Self::on_idle`].
pub fn on_idle_weight() -> Weight {
<T as crate::Config>::WeightInfo::on_idle_good_msg()
@@ -14,7 +14,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//! Migrates the storage from the previously deleted DMP pallet.
//! Migrates the storage from the previously deleted DMP pezpallet.
use crate::*;
use alloc::vec::Vec;
@@ -41,12 +41,12 @@ pub type PageCounter = u32;
/// The old `PageIndex` storage item.
#[storage_alias]
pub type PageIndex<T: Config> = StorageValue<Pallet<T>, PageIndexData, ValueQuery>;
pub type PageIndex<T: Config> = StorageValue<Pezpallet<T>, PageIndexData, ValueQuery>;
/// The old `Pages` storage item.
#[storage_alias]
pub type Pages<T: Config> = StorageMap<
Pallet<T>,
Pezpallet<T>,
Blake2_128Concat,
PageCounter,
Vec<(RelayBlockNumber, Vec<u8>)>,
@@ -56,7 +56,7 @@ pub type Pages<T: Config> = StorageMap<
/// The old `Overweight` storage item.
#[storage_alias]
pub type Overweight<T: Config> = CountedStorageMap<
Pallet<T>,
Pezpallet<T>,
Blake2_128Concat,
OverweightIndex,
(RelayBlockNumber, Vec<u8>),
@@ -70,7 +70,7 @@ pub(crate) mod testing_only {
///
/// Note that the alias type is wrong on purpose.
#[storage_alias]
pub type Configuration<T: Config> = StorageValue<Pallet<T>, u32>;
pub type Configuration<T: Config> = StorageValue<Pezpallet<T>, u32>;
}
/// Migrates a single page to the `DmpSink`.
+1 -1
View File
@@ -23,7 +23,7 @@ use pezsp_runtime::traits::IdentityLookup;
type Block = pezframe_system::mocking::MockBlock<Runtime>;
// Configure a mock runtime to test the pallet.
// Configure a mock runtime to test the pezpallet.
pezframe_support::construct_runtime!(
pub enum Runtime
{
@@ -24,8 +24,8 @@
// Executed Command:
// ./target/release/pezkuwi-teyrchain
// benchmark
// pallet
// --pallet
// pezpallet
// --pezpallet
// pezcumulus-pezpallet-dmp-queue
// --chain
// asset-hub-kusama-dev