chore: regenerate umbrella crate, fix feature propagation

This commit is contained in:
2025-12-16 11:28:32 +03:00
parent dd6d48f528
commit 620b0e3aa0
1358 changed files with 9464 additions and 7656 deletions
@@ -107,7 +107,10 @@ impl<T: Config> DelegationMigrator for Pezpallet<T> {
agent: Agent<Self::AccountId>,
reward_account: &Self::AccountId,
) -> DispatchResult {
Pezpallet::<T>::migrate_to_agent(RawOrigin::Signed(agent.get()).into(), reward_account.clone())
Pezpallet::<T>::migrate_to_agent(
RawOrigin::Signed(agent.get()).into(),
reward_account.clone(),
)
}
fn migrate_delegation(
agent: Agent<Self::AccountId>,
@@ -38,13 +38,13 @@
//!
//! ## Goals
//!
//! Direct nomination on the Staking pezpallet does not scale well. Nominations pools were created to
//! address this by pooling delegator funds into one account and then staking it. This though had
//! Direct nomination on the Staking pezpallet does not scale well. Nominations pools were created
//! to address this by pooling delegator funds into one account and then staking it. This though had
//! a very critical limitation that the funds were moved from delegator account to pool account
//! and hence the delegator lost control over their funds for using it for other purposes such as
//! governance. This pezpallet aims to solve this by extending the staking pezpallet to support a new
//! primitive function: delegation of funds to an `agent` with the intent of staking. The agent can
//! then stake the delegated funds to [`Config::CoreStaking`] on behalf of the delegators.
//! governance. This pezpallet aims to solve this by extending the staking pezpallet to support a
//! new primitive function: delegation of funds to an `agent` with the intent of staking. The agent
//! can then stake the delegated funds to [`Config::CoreStaking`] on behalf of the delegators.
//!
//! ### Withdrawal Management
//! Agent unbonding does not regulate ordering of consequent withdrawal for delegators. This is upto
@@ -55,10 +55,10 @@
//! This pezpallet does not enforce any specific strategy for how rewards or slashes are applied. It
//! is upto the `agent` account to decide how to apply the rewards and slashes.
//!
//! This importantly allows clients of this pezpallet to build their own strategies for reward/slashes.
//! For example, an `agent` account can choose to first slash the reward pot before slashing the
//! delegators. Or part of the reward can go to an insurance fund that can be used to cover any
//! potential future slashes. The goal is to eventually allow foreign MultiLocations
//! This importantly allows clients of this pezpallet to build their own strategies for
//! reward/slashes. For example, an `agent` account can choose to first slash the reward pot before
//! slashing the delegators. Or part of the reward can go to an insurance fund that can be used to
//! cover any potential future slashes. The goal is to eventually allow foreign MultiLocations
//! (smart contracts or pallets on another chain) to build their own pooled staking solutions
//! similar to `NominationPools`.
@@ -78,8 +78,8 @@
//! One of the reasons why direct nominators on staking pezpallet cannot scale well is because all
//! nominators are slashed at the same time. This is expensive and needs to be bounded operation.
//!
//! This pezpallet implements a lazy slashing mechanism. Any slashes to the `agent` are posted in its
//! `AgentLedger` as a pending slash. Since the actual amount is held in the multiple
//! This pezpallet implements a lazy slashing mechanism. Any slashes to the `agent` are posted in
//! its `AgentLedger` as a pending slash. Since the actual amount is held in the multiple
//! `delegator` accounts, this pezpallet has no way to know how to apply slash. It is the `agent`'s
//! responsibility to apply slashes for each delegator, one at a time. Staking pezpallet ensures the
//! pending slash never exceeds staked amount and would freeze further withdraws until all pending
@@ -93,8 +93,8 @@
//!
//! ## Nomination Pool vs Delegation Staking
//! This pezpallet is not a replacement for Nomination Pool but adds a new primitive in addition to
//! staking pezpallet that can be used by Nomination Pool to support delegation based staking. It can
//! be thought of as an extension to the Staking Pezpallet in relation to Nomination Pools.
//! staking pezpallet that can be used by Nomination Pool to support delegation based staking. It
//! can be thought of as an extension to the Staking Pezpallet in relation to Nomination Pools.
//! Technically, these changes could be made in one of those pallets as well but that would have
//! meant significant refactoring and high chances of introducing a regression. With this approach,
//! we can keep the existing pallets with minimal changes and introduce a new pezpallet that can be
@@ -191,7 +191,8 @@ pub mod pezpallet {
pub trait Config: pezframe_system::Config {
/// The overarching event type.
#[allow(deprecated)]
type RuntimeEvent: From<Event<Self>> + IsType<<Self as pezframe_system::Config>::RuntimeEvent>;
type RuntimeEvent: From<Event<Self>>
+ IsType<<Self as pezframe_system::Config>::RuntimeEvent>;
/// Injected identifier for the pezpallet.
#[pezpallet::constant]
@@ -787,7 +788,8 @@ impl<T: Config> Pezpallet<T> {
ensure!(
matches!(
T::CoreStaking::status(&agent).expect("agent should be bonded"),
pezsp_staking::StakerStatus::Nominator(_) | pezsp_staking::StakerStatus::Idle
pezsp_staking::StakerStatus::Nominator(_) |
pezsp_staking::StakerStatus::Idle
),
"agent should be bonded and not validator"
);
@@ -84,7 +84,8 @@ pub mod unversioned {
Agents::<T>::iter_keys().take(MaxAgents::get() as usize).for_each(|agent| {
let old_proxy: T::AccountId = old_proxy_delegator(agent.clone());
let held_balance = Pezpallet::<T>::held_balance_of(Delegator::from(old_proxy.clone()));
let held_balance =
Pezpallet::<T>::held_balance_of(Delegator::from(old_proxy.clone()));
let delegation = Delegation::<T>::get(&old_proxy);
if delegation.is_some() || !held_balance.is_zero() {
log!(
@@ -17,9 +17,8 @@
use crate::{self as delegated_staking, types::AgentLedgerOuter};
use pezframe_support::{
assert_ok, derive_impl,
assert_ok, derive_impl, parameter_types,
pezpallet_prelude::*,
parameter_types,
traits::{ConstU64, Currency, VariantCountOf},
PalletId,
};
@@ -650,8 +650,8 @@ mod staking_integration {
DelegatedStaking::generate_proxy_delegator(Agent::from(agent)).get();
assert_ok!(DelegatedStaking::migrate_to_agent(RawOrigin::Signed(agent).into(), 201));
// after migration, no provider left since free balance is 0 and staking pezpallet released
// all funds.
// after migration, no provider left since free balance is 0 and staking pezpallet
// released all funds.
assert_eq!(System::providers(&agent), 0);
assert_eq!(Balances::free_balance(agent), 0);
// proxy delegator has one provider as well with no free balance.