Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update slashing across all active assets on a service #886

Draft
wants to merge 26 commits into
base: main
Choose a base branch
from

Conversation

drewstone
Copy link
Contributor

@drewstone drewstone commented Jan 19, 2025

Summary of changes
Changes introduced in this pull request:

  • Updates slashing to cover all assets exposed to a service
  • Moves large functions to their own files in functions
  • Updates request logic to allow customers to request services with ranges of security expectations (open to discussion)
  • Adds native restaking from nominations

Needs work

  • Precompile functions with new params
  • Hooks into base staking pallet.
    • Prevent unbonding if DELEGATION_LOCK exists up to that amount
    • Update delegation amount if slashed on staking pallet
  • Tests, audit, simulation

Planned for later

  • Allow LST pool creator to delegate nominations
  • Integrate cross-chain LST pallet with Hyperbridge, enable similar LRT logic

Reference issue to close (if applicable)

Closes

@drewstone drewstone linked an issue Jan 31, 2025 that may be closed by this pull request
13 tasks
@shekohex
Copy link
Contributor

shekohex commented Feb 5, 2025

@drewstone here is how to listen for events from the staking pallet.
https://github.com/paritytech/polkadot-sdk/blob/87f4f3f0df5fc0cc72f69e612909d4d213965820/substrate/frame/delegated-staking/src/impls.rs#L142-L165

fyi I've this setup here (which in theory we can do custom logic here to revert or continue):

impl<C: Config> OnStakingUpdate<C::AccountId, BalanceOf<C>> for Pallet<C> {
fn on_stake_update(_who: &C::AccountId, _prev_stake: Option<Stake<BalanceOf<C>>>) {
unimplemented!("Custom stake update logic not implemented")
}
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Building 🏗️
Development

Successfully merging this pull request may close these issues.

[CHECKLIST] Slashing, rewards, services
2 participants