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:
@@ -37,7 +37,7 @@ mod benchmarks {
|
||||
#[benchmark]
|
||||
fn set_config_with_u32() {
|
||||
#[extrinsic_call]
|
||||
Pallet::<T>::update_resume_threshold(RawOrigin::Root, 1);
|
||||
Pezpallet::<T>::update_resume_threshold(RawOrigin::Root, 1);
|
||||
}
|
||||
|
||||
/// Add a XCMP message of `n` bytes to the message queue.
|
||||
@@ -57,7 +57,7 @@ mod benchmarks {
|
||||
let fp_before = T::XcmpQueue::footprint(0.into());
|
||||
#[block]
|
||||
{
|
||||
assert_ok!(Pallet::<T>::enqueue_xcmp_messages(
|
||||
assert_ok!(Pezpallet::<T>::enqueue_xcmp_messages(
|
||||
0.into(),
|
||||
&[msg.as_bounded_slice()],
|
||||
true,
|
||||
@@ -94,7 +94,7 @@ mod benchmarks {
|
||||
let fp_before = T::XcmpQueue::footprint(0.into());
|
||||
#[block]
|
||||
{
|
||||
assert_ok!(Pallet::<T>::enqueue_xcmp_messages(
|
||||
assert_ok!(Pezpallet::<T>::enqueue_xcmp_messages(
|
||||
0.into(),
|
||||
&msgs,
|
||||
true,
|
||||
@@ -121,7 +121,7 @@ mod benchmarks {
|
||||
mock::EnqueuedMessages::set(vec![]);
|
||||
}
|
||||
|
||||
assert_ok!(Pallet::<T>::enqueue_xcmp_messages(
|
||||
assert_ok!(Pezpallet::<T>::enqueue_xcmp_messages(
|
||||
0.into(),
|
||||
&[BoundedVec::try_from(vec![0; n as usize]).unwrap().as_bounded_slice()],
|
||||
true,
|
||||
@@ -132,7 +132,7 @@ mod benchmarks {
|
||||
let fp_before = T::XcmpQueue::footprint(0.into());
|
||||
#[block]
|
||||
{
|
||||
assert_ok!(Pallet::<T>::enqueue_xcmp_messages(
|
||||
assert_ok!(Pezpallet::<T>::enqueue_xcmp_messages(
|
||||
0.into(),
|
||||
&[BoundedVec::new().as_bounded_slice()],
|
||||
true,
|
||||
@@ -172,7 +172,7 @@ mod benchmarks {
|
||||
let fp_before = T::XcmpQueue::footprint(0.into());
|
||||
#[block]
|
||||
{
|
||||
assert_ok!(Pallet::<T>::enqueue_xcmp_messages(
|
||||
assert_ok!(Pezpallet::<T>::enqueue_xcmp_messages(
|
||||
0.into(),
|
||||
&msgs.iter().map(|msg| msg.as_bounded_slice()).collect::<Vec<_>>(),
|
||||
true,
|
||||
@@ -197,7 +197,7 @@ mod benchmarks {
|
||||
});
|
||||
}
|
||||
|
||||
assert_ok!(Pallet::<T>::enqueue_xcmp_messages(
|
||||
assert_ok!(Pezpallet::<T>::enqueue_xcmp_messages(
|
||||
0.into(),
|
||||
&[BoundedVec::try_from(vec![
|
||||
0;
|
||||
@@ -219,7 +219,7 @@ mod benchmarks {
|
||||
let fp_before = T::XcmpQueue::footprint(0.into());
|
||||
#[block]
|
||||
{
|
||||
assert_ok!(Pallet::<T>::enqueue_xcmp_messages(
|
||||
assert_ok!(Pezpallet::<T>::enqueue_xcmp_messages(
|
||||
0.into(),
|
||||
&msgs.iter().map(|msg| msg.as_bounded_slice()).collect::<Vec<_>>(),
|
||||
true,
|
||||
@@ -241,7 +241,7 @@ mod benchmarks {
|
||||
#[block]
|
||||
{
|
||||
ChannelSignal::decode_all(&mut &data[..]).unwrap();
|
||||
Pallet::<T>::suspend_channel(para);
|
||||
Pezpallet::<T>::suspend_channel(para);
|
||||
}
|
||||
|
||||
assert_eq!(
|
||||
@@ -259,12 +259,12 @@ mod benchmarks {
|
||||
let para = 123.into();
|
||||
let data = ChannelSignal::Resume.encode();
|
||||
|
||||
Pallet::<T>::suspend_channel(para);
|
||||
Pezpallet::<T>::suspend_channel(para);
|
||||
|
||||
#[block]
|
||||
{
|
||||
ChannelSignal::decode_all(&mut &data[..]).unwrap();
|
||||
Pallet::<T>::resume_channel(para);
|
||||
Pezpallet::<T>::resume_channel(para);
|
||||
}
|
||||
|
||||
assert!(
|
||||
@@ -286,7 +286,7 @@ mod benchmarks {
|
||||
|
||||
#[block]
|
||||
{
|
||||
Pallet::<T>::take_first_concatenated_xcm(&mut &data[..], &mut WeightMeter::new())
|
||||
Pezpallet::<T>::take_first_concatenated_xcm(&mut &data[..], &mut WeightMeter::new())
|
||||
.unwrap();
|
||||
}
|
||||
}
|
||||
@@ -310,7 +310,7 @@ mod benchmarks {
|
||||
|
||||
#[block]
|
||||
{
|
||||
Pallet::<T>::on_idle(0u32.into(), Weight::MAX);
|
||||
Pezpallet::<T>::on_idle(0u32.into(), Weight::MAX);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -333,9 +333,9 @@ mod benchmarks {
|
||||
|
||||
#[block]
|
||||
{
|
||||
Pallet::<T>::on_idle(0u32.into(), Weight::MAX);
|
||||
Pezpallet::<T>::on_idle(0u32.into(), Weight::MAX);
|
||||
}
|
||||
}
|
||||
|
||||
impl_benchmark_test_suite!(Pallet, crate::mock::new_test_ext(), crate::mock::Test);
|
||||
impl_benchmark_test_suite!(Pezpallet, crate::mock::new_test_ext(), crate::mock::Test);
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
use crate::{pallet, OutboundState};
|
||||
use crate::{pezpallet, OutboundState};
|
||||
use pezcumulus_primitives_core::ParaId;
|
||||
use xcm::latest::prelude::*;
|
||||
|
||||
@@ -34,7 +34,7 @@ impl<Runtime: crate::Config> bp_xcm_bridge_hub_router::XcmChannelStatusProvider
|
||||
// if the inbound channel with recipient is suspended, it means that we are unable to
|
||||
// receive congestion reports from the `with` location. So we assume the pipeline is
|
||||
// congested too.
|
||||
if pallet::Pallet::<Runtime>::is_inbound_channel_suspended(sibling_para_id) {
|
||||
if pezpallet::Pezpallet::<Runtime>::is_inbound_channel_suspended(sibling_para_id) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ impl<Runtime: crate::Config> OutXcmpChannelStatusProvider<Runtime> {
|
||||
|
||||
// let's find the channel's state with the sibling teyrchain,
|
||||
let Some((outbound_state, queued_pages)) =
|
||||
pallet::Pallet::<Runtime>::outbound_channel_state(sibling_para_id)
|
||||
pezpallet::Pezpallet::<Runtime>::outbound_channel_state(sibling_para_id)
|
||||
else {
|
||||
return false;
|
||||
};
|
||||
@@ -97,5 +97,5 @@ impl<Runtime: crate::Config> bp_xcm_bridge_hub_router::XcmChannelStatusProvider
|
||||
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
pub fn suspend_channel_for_benchmarks<T: crate::Config>(target: ParaId) {
|
||||
pallet::Pallet::<T>::suspend_channel(target)
|
||||
pezpallet::Pezpallet::<T>::suspend_channel(target)
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//! A pallet which uses the XCMP transport layer to handle both incoming and outgoing XCM message
|
||||
//! A pezpallet which uses the XCMP transport layer to handle both incoming and outgoing XCM message
|
||||
//! sending and dispatch, queuing, signalling and backpressure. To do so, it implements:
|
||||
//! * `XcmpMessageHandler`
|
||||
//! * `XcmpMessageSource`
|
||||
@@ -81,7 +81,7 @@ use xcm::{latest::prelude::*, VersionedLocation, VersionedXcm, WrapVersion, MAX_
|
||||
use xcm_builder::InspectMessageQueues;
|
||||
use xcm_executor::traits::ConvertOrigin;
|
||||
|
||||
pub use pallet::*;
|
||||
pub use pezpallet::*;
|
||||
|
||||
/// Index used to identify overweight XCMs.
|
||||
pub type OverweightIndex = u64;
|
||||
@@ -102,17 +102,17 @@ pub mod delivery_fee_constants {
|
||||
pub const THRESHOLD_FACTOR: u32 = 2;
|
||||
}
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
pub mod pallet {
|
||||
#[pezframe_support::pezpallet]
|
||||
pub mod pezpallet {
|
||||
use super::*;
|
||||
use pezframe_support::{pezpallet_prelude::*, Twox64Concat};
|
||||
use pezframe_system::pezpallet_prelude::*;
|
||||
|
||||
#[pallet::pallet]
|
||||
#[pallet::storage_version(migration::STORAGE_VERSION)]
|
||||
pub struct Pallet<T>(_);
|
||||
#[pezpallet::pezpallet]
|
||||
#[pezpallet::storage_version(migration::STORAGE_VERSION)]
|
||||
pub struct Pezpallet<T>(_);
|
||||
|
||||
#[pallet::config]
|
||||
#[pezpallet::config]
|
||||
pub trait Config: pezframe_system::Config {
|
||||
#[allow(deprecated)]
|
||||
type RuntimeEvent: From<Event<Self>> + IsType<<Self as pezframe_system::Config>::RuntimeEvent>;
|
||||
@@ -125,7 +125,7 @@ pub mod pallet {
|
||||
|
||||
/// Enqueue an inbound horizontal message for later processing.
|
||||
///
|
||||
/// This defines the maximal message length via [`crate::MaxXcmpMessageLenOf`]. The pallet
|
||||
/// This defines the maximal message length via [`crate::MaxXcmpMessageLenOf`]. The pezpallet
|
||||
/// assumes that this hook will eventually process all the pushed messages.
|
||||
type XcmpQueue: EnqueueMessage<ParaId>
|
||||
+ QueueFootprintQuery<ParaId, MaxMessageLen = MaxXcmpMessageLenOf<Self>>;
|
||||
@@ -135,7 +135,7 @@ pub mod pallet {
|
||||
/// Any further channel suspensions will fail and messages may get dropped without further
|
||||
/// notice. Choosing a high value (1000) is okay; the trade-off that is described in
|
||||
/// [`InboundXcmpSuspended`] still applies at that scale.
|
||||
#[pallet::constant]
|
||||
#[pezpallet::constant]
|
||||
type MaxInboundSuspended: Get<u32>;
|
||||
|
||||
/// Maximal number of outbound XCMP channels that can have messages queued at the same time.
|
||||
@@ -146,7 +146,7 @@ pub mod pallet {
|
||||
/// since otherwise the congestion control protocol will not work as intended and messages
|
||||
/// may be dropped. This value increases the PoV and should therefore not be picked too
|
||||
/// high. Governance needs to pay attention to not open more channels than this value.
|
||||
#[pallet::constant]
|
||||
#[pezpallet::constant]
|
||||
type MaxActiveOutboundChannels: Get<u32>;
|
||||
|
||||
/// The maximal page size for HRMP message pages.
|
||||
@@ -154,7 +154,7 @@ pub mod pallet {
|
||||
/// A lower limit can be set dynamically, but this is the hard-limit for the PoV worst case
|
||||
/// benchmarking. The limit for the size of a message is slightly below this, since some
|
||||
/// overhead is incurred for encoding the format.
|
||||
#[pallet::constant]
|
||||
#[pezpallet::constant]
|
||||
type MaxPageSize: Get<u32>;
|
||||
|
||||
/// The origin that is allowed to resume or suspend the XCMP queue.
|
||||
@@ -167,17 +167,17 @@ pub mod pallet {
|
||||
/// The price for delivering an XCM to a sibling teyrchain destination.
|
||||
type PriceForSiblingDelivery: PriceForMessageDelivery<Id = ParaId>;
|
||||
|
||||
/// The weight information of this pallet.
|
||||
/// The weight information of this pezpallet.
|
||||
type WeightInfo: WeightInfoExt;
|
||||
}
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pezpallet::call]
|
||||
impl<T: Config> Pezpallet<T> {
|
||||
/// Suspends all XCM executions for the XCMP queue, regardless of the sender's origin.
|
||||
///
|
||||
/// - `origin`: Must pass `ControllerOrigin`.
|
||||
#[pallet::call_index(1)]
|
||||
#[pallet::weight((T::DbWeight::get().writes(1), DispatchClass::Operational,))]
|
||||
#[pezpallet::call_index(1)]
|
||||
#[pezpallet::weight((T::DbWeight::get().writes(1), DispatchClass::Operational,))]
|
||||
pub fn suspend_xcm_execution(origin: OriginFor<T>) -> DispatchResult {
|
||||
T::ControllerOrigin::ensure_origin(origin)?;
|
||||
|
||||
@@ -196,8 +196,8 @@ pub mod pallet {
|
||||
/// Note that this function doesn't change the status of the in/out bound channels.
|
||||
///
|
||||
/// - `origin`: Must pass `ControllerOrigin`.
|
||||
#[pallet::call_index(2)]
|
||||
#[pallet::weight((T::DbWeight::get().writes(1), DispatchClass::Operational,))]
|
||||
#[pezpallet::call_index(2)]
|
||||
#[pezpallet::weight((T::DbWeight::get().writes(1), DispatchClass::Operational,))]
|
||||
pub fn resume_xcm_execution(origin: OriginFor<T>) -> DispatchResult {
|
||||
T::ControllerOrigin::ensure_origin(origin)?;
|
||||
|
||||
@@ -216,8 +216,8 @@ pub mod pallet {
|
||||
///
|
||||
/// - `origin`: Must pass `Root`.
|
||||
/// - `new`: Desired value for `QueueConfigData.suspend_value`
|
||||
#[pallet::call_index(3)]
|
||||
#[pallet::weight((T::WeightInfo::set_config_with_u32(), DispatchClass::Operational,))]
|
||||
#[pezpallet::call_index(3)]
|
||||
#[pezpallet::weight((T::WeightInfo::set_config_with_u32(), DispatchClass::Operational,))]
|
||||
pub fn update_suspend_threshold(origin: OriginFor<T>, new: u32) -> DispatchResult {
|
||||
ensure_root(origin)?;
|
||||
|
||||
@@ -232,8 +232,8 @@ pub mod pallet {
|
||||
///
|
||||
/// - `origin`: Must pass `Root`.
|
||||
/// - `new`: Desired value for `QueueConfigData.drop_threshold`
|
||||
#[pallet::call_index(4)]
|
||||
#[pallet::weight((T::WeightInfo::set_config_with_u32(),DispatchClass::Operational,))]
|
||||
#[pezpallet::call_index(4)]
|
||||
#[pezpallet::weight((T::WeightInfo::set_config_with_u32(),DispatchClass::Operational,))]
|
||||
pub fn update_drop_threshold(origin: OriginFor<T>, new: u32) -> DispatchResult {
|
||||
ensure_root(origin)?;
|
||||
|
||||
@@ -248,8 +248,8 @@ pub mod pallet {
|
||||
///
|
||||
/// - `origin`: Must pass `Root`.
|
||||
/// - `new`: Desired value for `QueueConfigData.resume_threshold`
|
||||
#[pallet::call_index(5)]
|
||||
#[pallet::weight((T::WeightInfo::set_config_with_u32(), DispatchClass::Operational,))]
|
||||
#[pezpallet::call_index(5)]
|
||||
#[pezpallet::weight((T::WeightInfo::set_config_with_u32(), DispatchClass::Operational,))]
|
||||
pub fn update_resume_threshold(origin: OriginFor<T>, new: u32) -> DispatchResult {
|
||||
ensure_root(origin)?;
|
||||
|
||||
@@ -260,8 +260,8 @@ pub mod pallet {
|
||||
}
|
||||
}
|
||||
|
||||
#[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() {
|
||||
assert!(!T::MaxPageSize::get().is_zero(), "MaxPageSize too low");
|
||||
|
||||
@@ -290,14 +290,14 @@ 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> {
|
||||
/// An HRMP message was sent to a sibling teyrchain.
|
||||
XcmpMessageSent { message_hash: XcmHash },
|
||||
}
|
||||
|
||||
#[pallet::error]
|
||||
#[pezpallet::error]
|
||||
pub enum Error<T> {
|
||||
/// Setting the queue config failed since one of its values was invalid.
|
||||
BadQueueConfig,
|
||||
@@ -319,7 +319,7 @@ pub mod pallet {
|
||||
///
|
||||
/// NOTE: The PoV benchmarking cannot know this and will over-estimate, but the actual proof
|
||||
/// will be smaller.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type InboundXcmpSuspended<T: Config> =
|
||||
StorageValue<_, BoundedBTreeSet<ParaId, T::MaxInboundSuspended>, ValueQuery>;
|
||||
|
||||
@@ -329,7 +329,7 @@ pub mod pallet {
|
||||
/// than 65535 items. Queue indices for normal messages begin at one; zero is reserved in
|
||||
/// case of the need to send a high-priority signal message this block.
|
||||
/// The bool is true if there is a signal message waiting to be sent.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub(super) type OutboundXcmpStatus<T: Config> = StorageValue<
|
||||
_,
|
||||
BoundedVec<OutboundChannelDetails, T::MaxActiveOutboundChannels>,
|
||||
@@ -337,7 +337,7 @@ pub mod pallet {
|
||||
>;
|
||||
|
||||
/// The messages outbound in a given XCMP channel.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub(super) type OutboundXcmpMessages<T: Config> = StorageDoubleMap<
|
||||
_,
|
||||
Blake2_128Concat,
|
||||
@@ -349,22 +349,22 @@ pub mod pallet {
|
||||
>;
|
||||
|
||||
/// Any signal messages waiting to be sent.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub(super) type SignalMessages<T: Config> =
|
||||
StorageMap<_, Blake2_128Concat, ParaId, WeakBoundedVec<u8, T::MaxPageSize>, ValueQuery>;
|
||||
|
||||
/// The configuration which controls the dynamics of the outbound queue.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub(super) type QueueConfig<T: Config> = StorageValue<_, QueueConfigData, ValueQuery>;
|
||||
|
||||
/// Whether or not the XCMP queue is suspended from executing incoming XCMs or not.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub(super) type QueueSuspended<T: Config> = StorageValue<_, bool, ValueQuery>;
|
||||
|
||||
/// The factor to multiply the base delivery fee by.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub(super) type DeliveryFeeFactor<T: Config> =
|
||||
StorageMap<_, Twox64Concat, ParaId, FixedU128, ValueQuery, GetMinFeeFactor<Pallet<T>>>;
|
||||
StorageMap<_, Twox64Concat, ParaId, FixedU128, ValueQuery, GetMinFeeFactor<Pezpallet<T>>>;
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Eq, PartialEq, Encode, Decode, RuntimeDebug, TypeInfo, MaxEncodedLen)]
|
||||
@@ -458,7 +458,7 @@ pub enum ChannelSignal {
|
||||
Resume,
|
||||
}
|
||||
|
||||
impl<T: Config> Pallet<T> {
|
||||
impl<T: Config> Pezpallet<T> {
|
||||
/// Place a message `fragment` on the outgoing XCMP queue for `recipient`.
|
||||
///
|
||||
/// Format is the type of aggregate message that the `fragment` may be safely encoded and
|
||||
@@ -818,7 +818,7 @@ impl<T: Config> Pallet<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config> OnQueueChanged<ParaId> for Pallet<T> {
|
||||
impl<T: Config> OnQueueChanged<ParaId> for Pezpallet<T> {
|
||||
// Suspends/Resumes the queue when certain thresholds are reached.
|
||||
fn on_queue_changed(para: ParaId, fp: QueueFootprint) {
|
||||
let QueueConfigData { resume_threshold, suspend_threshold, .. } = <QueueConfig<T>>::get();
|
||||
@@ -861,7 +861,7 @@ impl<T: Config> OnQueueChanged<ParaId> for Pallet<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config> QueuePausedQuery<ParaId> for Pallet<T> {
|
||||
impl<T: Config> QueuePausedQuery<ParaId> for Pezpallet<T> {
|
||||
fn is_paused(para: &ParaId) -> bool {
|
||||
if !QueueSuspended::<T>::get() {
|
||||
return false;
|
||||
@@ -897,7 +897,7 @@ enum XcmEncoding {
|
||||
Double,
|
||||
}
|
||||
|
||||
impl<T: Config> XcmpMessageHandler for Pallet<T> {
|
||||
impl<T: Config> XcmpMessageHandler for Pezpallet<T> {
|
||||
fn handle_xcmp_messages<'a, I: Iterator<Item = (ParaId, RelayBlockNumber, &'a [u8])>>(
|
||||
iter: I,
|
||||
max_weight: Weight,
|
||||
@@ -1014,7 +1014,7 @@ impl<T: Config> XcmpMessageHandler for Pallet<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config> XcmpMessageSource for Pallet<T> {
|
||||
impl<T: Config> XcmpMessageSource for Pezpallet<T> {
|
||||
fn take_outbound_messages(maximum_channels: usize) -> Vec<(ParaId, Vec<u8>)> {
|
||||
let mut statuses = <OutboundXcmpStatus<T>>::get();
|
||||
let old_statuses_len = statuses.len();
|
||||
@@ -1151,7 +1151,7 @@ impl<T: Config> XcmpMessageSource for Pallet<T> {
|
||||
}
|
||||
|
||||
/// Xcm sender for sending to a sibling teyrchain.
|
||||
impl<T: Config> SendXcm for Pallet<T> {
|
||||
impl<T: Config> SendXcm for Pezpallet<T> {
|
||||
type Ticket = (ParaId, VersionedXcm<()>);
|
||||
|
||||
fn validate(
|
||||
@@ -1199,7 +1199,7 @@ impl<T: Config> SendXcm for Pallet<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config> InspectMessageQueues for Pallet<T> {
|
||||
impl<T: Config> InspectMessageQueues for Pezpallet<T> {
|
||||
fn clear_messages() {
|
||||
// Best effort.
|
||||
let _ = OutboundXcmpMessages::<T>::clear(u32::MAX, None);
|
||||
@@ -1248,7 +1248,7 @@ impl<T: Config> InspectMessageQueues for Pallet<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config> FeeTracker for Pallet<T> {
|
||||
impl<T: Config> FeeTracker for Pezpallet<T> {
|
||||
type Id = ParaId;
|
||||
|
||||
fn get_fee_factor(id: Self::Id) -> FixedU128 {
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
pub mod v5;
|
||||
|
||||
use crate::{Config, OverweightIndex, Pallet, QueueConfig, QueueConfigData, DEFAULT_POV_SIZE};
|
||||
use crate::{Config, OverweightIndex, Pezpallet, QueueConfig, QueueConfigData, DEFAULT_POV_SIZE};
|
||||
use alloc::vec::Vec;
|
||||
use pezcumulus_primitives_core::XcmpMessageFormat;
|
||||
use pezframe_support::{
|
||||
@@ -37,7 +37,7 @@ mod v1 {
|
||||
use codec::{Decode, Encode};
|
||||
|
||||
#[pezframe_support::storage_alias]
|
||||
pub(crate) type QueueConfig<T: Config> = StorageValue<Pallet<T>, QueueConfigData, ValueQuery>;
|
||||
pub(crate) type QueueConfig<T: Config> = StorageValue<Pezpallet<T>, QueueConfigData, ValueQuery>;
|
||||
|
||||
#[derive(Encode, Decode, Debug)]
|
||||
pub struct QueueConfigData {
|
||||
@@ -67,7 +67,7 @@ pub mod v2 {
|
||||
use super::*;
|
||||
|
||||
#[pezframe_support::storage_alias]
|
||||
pub(crate) type QueueConfig<T: Config> = StorageValue<Pallet<T>, QueueConfigData, ValueQuery>;
|
||||
pub(crate) type QueueConfig<T: Config> = StorageValue<Pezpallet<T>, QueueConfigData, ValueQuery>;
|
||||
|
||||
#[derive(Copy, Clone, Eq, PartialEq, Encode, Decode, RuntimeDebug, TypeInfo)]
|
||||
pub struct QueueConfigData {
|
||||
@@ -136,7 +136,7 @@ pub mod v2 {
|
||||
1,
|
||||
2,
|
||||
UncheckedMigrationToV2<T>,
|
||||
Pallet<T>,
|
||||
Pezpallet<T>,
|
||||
<T as pezframe_system::Config>::DbWeight,
|
||||
>;
|
||||
}
|
||||
@@ -148,12 +148,12 @@ pub mod v3 {
|
||||
/// Status of the inbound XCMP channels.
|
||||
#[pezframe_support::storage_alias]
|
||||
pub(crate) type InboundXcmpStatus<T: Config> =
|
||||
StorageValue<Pallet<T>, Vec<InboundChannelDetails>, OptionQuery>;
|
||||
StorageValue<Pezpallet<T>, Vec<InboundChannelDetails>, OptionQuery>;
|
||||
|
||||
/// Inbound aggregate XCMP messages. It can only be one per ParaId/block.
|
||||
#[pezframe_support::storage_alias]
|
||||
pub(crate) type InboundXcmpMessages<T: Config> = StorageDoubleMap<
|
||||
Pallet<T>,
|
||||
Pezpallet<T>,
|
||||
Blake2_128Concat,
|
||||
ParaId,
|
||||
Twox64Concat,
|
||||
@@ -164,7 +164,7 @@ pub mod v3 {
|
||||
|
||||
#[pezframe_support::storage_alias]
|
||||
pub(crate) type QueueConfig<T: Config> =
|
||||
StorageValue<Pallet<T>, v2::QueueConfigData, ValueQuery>;
|
||||
StorageValue<Pezpallet<T>, v2::QueueConfigData, ValueQuery>;
|
||||
|
||||
#[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, TypeInfo)]
|
||||
pub struct InboundChannelDetails {
|
||||
@@ -187,14 +187,14 @@ pub mod v3 {
|
||||
Suspended,
|
||||
}
|
||||
|
||||
/// Migrates the pallet storage to v3.
|
||||
/// Migrates the pezpallet storage to v3.
|
||||
pub struct UncheckedMigrationToV3<T: Config>(PhantomData<T>);
|
||||
|
||||
impl<T: Config> UncheckedOnRuntimeUpgrade for UncheckedMigrationToV3<T> {
|
||||
fn on_runtime_upgrade() -> Weight {
|
||||
#[pezframe_support::storage_alias]
|
||||
type Overweight<T: Config> =
|
||||
CountedStorageMap<Pallet<T>, Twox64Concat, OverweightIndex, ParaId>;
|
||||
CountedStorageMap<Pezpallet<T>, Twox64Concat, OverweightIndex, ParaId>;
|
||||
let overweight_messages = Overweight::<T>::initialize_counter() as u64;
|
||||
|
||||
T::DbWeight::get().reads_writes(overweight_messages, 1)
|
||||
@@ -208,7 +208,7 @@ pub mod v3 {
|
||||
2,
|
||||
3,
|
||||
UncheckedMigrationToV3<T>,
|
||||
Pallet<T>,
|
||||
Pezpallet<T>,
|
||||
<T as pezframe_system::Config>::DbWeight,
|
||||
>;
|
||||
|
||||
@@ -311,7 +311,7 @@ pub mod v4 {
|
||||
3,
|
||||
4,
|
||||
UncheckedMigrationToV4<T>,
|
||||
Pallet<T>,
|
||||
Pezpallet<T>,
|
||||
<T as pezframe_system::Config>::DbWeight,
|
||||
>;
|
||||
}
|
||||
@@ -336,7 +336,7 @@ mod tests {
|
||||
|
||||
new_test_ext().execute_with(|| {
|
||||
let storage_version = StorageVersion::new(1);
|
||||
storage_version.put::<Pallet<Test>>();
|
||||
storage_version.put::<Pezpallet<Test>>();
|
||||
|
||||
pezframe_support::storage::unhashed::put_raw(
|
||||
&crate::QueueConfig::<Test>::hashed_key(),
|
||||
@@ -364,7 +364,7 @@ mod tests {
|
||||
fn test_migration_to_v4() {
|
||||
new_test_ext().execute_with(|| {
|
||||
let storage_version = StorageVersion::new(3);
|
||||
storage_version.put::<Pallet<Test>>();
|
||||
storage_version.put::<Pezpallet<Test>>();
|
||||
|
||||
let v2 = v2::QueueConfigData {
|
||||
drop_threshold: 5,
|
||||
@@ -393,7 +393,7 @@ mod tests {
|
||||
|
||||
new_test_ext().execute_with(|| {
|
||||
let storage_version = StorageVersion::new(3);
|
||||
storage_version.put::<Pallet<Test>>();
|
||||
storage_version.put::<Pezpallet<Test>>();
|
||||
|
||||
let v2 = v2::QueueConfigData {
|
||||
drop_threshold: 100,
|
||||
|
||||
@@ -35,7 +35,7 @@ pub type MigrateV4ToV5<T> = pezframe_support::migrations::VersionedMigration<
|
||||
4,
|
||||
5,
|
||||
unversioned::UncheckedMigrateV4ToV5<T>,
|
||||
Pallet<T>,
|
||||
Pezpallet<T>,
|
||||
<T as pezframe_system::Config>::DbWeight,
|
||||
>;
|
||||
|
||||
@@ -45,11 +45,11 @@ mod v4 {
|
||||
|
||||
#[pezframe_support::storage_alias]
|
||||
pub(super) type OutboundXcmpStatus<T: Config> =
|
||||
StorageValue<Pallet<T>, Vec<OutboundChannelDetails>, ValueQuery>;
|
||||
StorageValue<Pezpallet<T>, Vec<OutboundChannelDetails>, ValueQuery>;
|
||||
|
||||
#[pezframe_support::storage_alias]
|
||||
pub(super) type OutboundXcmpMessages<T: Config> = StorageDoubleMap<
|
||||
Pallet<T>,
|
||||
Pezpallet<T>,
|
||||
Blake2_128Concat,
|
||||
ParaId,
|
||||
Twox64Concat,
|
||||
@@ -60,7 +60,7 @@ mod v4 {
|
||||
|
||||
#[pezframe_support::storage_alias]
|
||||
pub(super) type SignalMessages<T: Config> =
|
||||
StorageMap<Pallet<T>, Blake2_128Concat, ParaId, Vec<u8>, ValueQuery>;
|
||||
StorageMap<Pezpallet<T>, Blake2_128Concat, ParaId, Vec<u8>, ValueQuery>;
|
||||
}
|
||||
|
||||
// Private module to hide the migration.
|
||||
|
||||
@@ -35,16 +35,16 @@ use xcm_executor::traits::ConvertOrigin;
|
||||
|
||||
type Block = pezframe_system::mocking::MockBlock<Test>;
|
||||
|
||||
// Configure a mock runtime to test the pallet.
|
||||
// Configure a mock runtime to test the pezpallet.
|
||||
pezframe_support::construct_runtime!(
|
||||
pub enum Test
|
||||
{
|
||||
System: pezframe_system::{Pallet, Call, Config<T>, Storage, Event<T>},
|
||||
Balances: pezpallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>},
|
||||
System: pezframe_system::{Pezpallet, Call, Config<T>, Storage, Event<T>},
|
||||
Balances: pezpallet_balances::{Pezpallet, Call, Storage, Config<T>, Event<T>},
|
||||
TeyrchainSystem: pezcumulus_pezpallet_teyrchain_system::{
|
||||
Pallet, Call, Config<T>, Storage, Inherent, Event<T>,
|
||||
Pezpallet, Call, Config<T>, Storage, Inherent, Event<T>,
|
||||
},
|
||||
XcmpQueue: xcmp_queue::{Pallet, Call, Storage, Event<T>},
|
||||
XcmpQueue: xcmp_queue::{Pezpallet, Call, Storage, Event<T>},
|
||||
}
|
||||
);
|
||||
|
||||
@@ -233,7 +233,7 @@ impl Config for Test {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type ChannelInfo = MockedChannelInfo;
|
||||
type VersionWrapper = ();
|
||||
type XcmpQueue = EnqueueToLocalStorage<Pallet<Test>>;
|
||||
type XcmpQueue = EnqueueToLocalStorage<Pezpallet<Test>>;
|
||||
type MaxInboundSuspended = ConstU32<1_000>;
|
||||
type MaxActiveOutboundChannels = ConstU32<128>;
|
||||
// Most on-chain HRMP channels are configured to use 102400 bytes of max message size, so we
|
||||
|
||||
@@ -545,7 +545,7 @@ fn xcm_enqueueing_backpressure_works() {
|
||||
});
|
||||
assert_eq!(EnqueuedMessages::get().len(), 5);
|
||||
|
||||
mock::EnqueueToLocalStorage::<Pallet<Test>>::sweep_queue(para);
|
||||
mock::EnqueueToLocalStorage::<Pezpallet<Test>>::sweep_queue(para);
|
||||
XcmpQueue::handle_xcmp_messages(once((para, 1, page.as_slice())), Weight::MAX);
|
||||
// Got resumed:
|
||||
assert!(InboundXcmpSuspended::<Test>::get().is_empty());
|
||||
@@ -747,7 +747,7 @@ fn hrmp_signals_are_prioritized() {
|
||||
let mut msg_wrapper = Some(message.clone());
|
||||
|
||||
new_test_ext().execute_with(|| {
|
||||
pezframe_system::Pallet::<Test>::set_block_number(1);
|
||||
pezframe_system::Pezpallet::<Test>::set_block_number(1);
|
||||
<XcmpQueue as SendXcm>::validate(&mut dest_wrapper, &mut msg_wrapper).unwrap();
|
||||
|
||||
// check wrapper were consumed
|
||||
@@ -770,11 +770,11 @@ fn hrmp_signals_are_prioritized() {
|
||||
assert_eq!(taken, vec![]);
|
||||
|
||||
// Enqueue some messages
|
||||
let num_events = pezframe_system::Pallet::<Test>::events().len();
|
||||
let num_events = pezframe_system::Pezpallet::<Test>::events().len();
|
||||
for _ in 0..256 {
|
||||
assert_ok!(send_xcm::<XcmpQueue>(dest.into(), message.clone()));
|
||||
}
|
||||
assert_eq!(num_events + 256, pezframe_system::Pallet::<Test>::events().len());
|
||||
assert_eq!(num_events + 256, pezframe_system::Pezpallet::<Test>::events().len());
|
||||
|
||||
// Without a signal we get the messages in order:
|
||||
let mut expected_msg = XcmpMessageFormat::ConcatenatedVersionedXcm.encode();
|
||||
@@ -1099,8 +1099,8 @@ fn verify_fee_factor_increase_and_decrease() {
|
||||
xcmp_message.extend(versioned_xcm.encode());
|
||||
|
||||
new_test_ext().execute_with(|| {
|
||||
let initial = Pallet::<Test>::MIN_FEE_FACTOR;
|
||||
assert_eq!(Pallet::<Test>::get_fee_factor(sibling_para_id), initial);
|
||||
let initial = Pezpallet::<Test>::MIN_FEE_FACTOR;
|
||||
assert_eq!(Pezpallet::<Test>::get_fee_factor(sibling_para_id), initial);
|
||||
|
||||
// Open channel so messages can actually be sent
|
||||
TeyrchainSystem::open_custom_outbound_hrmp_channel_for_benchmarks_or_tests(
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// Executed Command:
|
||||
// ./target/release/pezkuwi-teyrchain
|
||||
// benchmark
|
||||
// pallet
|
||||
// --pallet
|
||||
// pezpallet
|
||||
// --pezpallet
|
||||
// pezcumulus-pezpallet-xcmp-queue
|
||||
// --chain
|
||||
// asset-hub-zagros-dev
|
||||
|
||||
Reference in New Issue
Block a user