You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
trait StakingConfig {} // can be merged with StakingInspect
trait StakingInspect {}
trait StakingMutate: StakingInspect {}
trait StakingUnsafe: StakingMutate {}
Other pallets that only need to query Staking configuration or data about a nominator/validator can use the right level of traits.
StakingMutate allows all the ways to mutate the staking ledger.
StakingUnsafe gives access to low level apis that allow other pallets to manipulate ledger overriding some general integrity checks. These are to be used by DelegationStakingPallet that is being worked on #2680.
The text was updated successfully, but these errors were encountered:
This is the first PR in preparation for
#454.
## Follow ups:
- #3904.
- #3905.
Overall changes are documented here (lot more visual 😍):
https://hackmd.io/@ak0n/454-np-governance
[Maybe followup](#4217)
with migration of storage item `VirtualStakers` as a bool or enum in
`Ledger`.
## Context
We want to achieve a way for a user (`Delegator`) to delegate their
funds to another account (`Agent`). Delegate implies the funds are
locked in delegator account itself. Agent can act on behalf of delegator
to stake directly on Staking pallet.
The delegation feature is added to Staking via another pallet
`delegated-staking` worked on
[here](#3904).
## Introduces:
### StakingUnchecked Trait
As the name implies, this trait allows unchecked (non-locked) mutation
of staking ledger. These apis are only meant to be used by other pallets
in the runtime and should not be exposed directly to user code path.
Also related: #3888.
### Virtual Bond
Allows other pallets to stake via staking pallet while managing the
locks on these accounts themselves. Introduces another storage
`VirtualStakers` that whitelist these accounts.
We also restrict virtual stakers to set reward account as themselves.
Since the account has no locks, we cannot support compounding of
rewards. Conservatively, we require them to set a separate account
different from the staker. Since these are code managed, it should be
easy for another pallet to redistribute reward and rebond them.
### Slashes
Since there is no actual lock maintained by staking-pallet for virtual
stakers, this pallet does not apply any slashes. It is then important
for pallets managing virtual stakers to listen to slashing events and
apply necessary slashes.
StakingInterface is too big and bloated.
It could be broken down into something like this
Other pallets that only need to query Staking configuration or data about a nominator/validator can use the right level of traits.
StakingMutate
allows all the ways to mutate the staking ledger.StakingUnsafe
gives access to low level apis that allow other pallets to manipulate ledger overriding some general integrity checks. These are to be used byDelegationStakingPallet
that is being worked on #2680.The text was updated successfully, but these errors were encountered: