-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[Staking] Bounded Slashing: Paginated Offence Processing & Slash Application #7424
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
Merged
Merged
Changes from 209 commits
Commits
Show all changes
212 commits
Select commit
Hold shift + click to select a range
3f6bf3f
init: adds EPM-MB, multipaged types and primitives
gpestana 8a682b8
refactors staking pallet with new paginated types
gpestana 94ff073
refactors election-multiphase pallet with new paginated types
gpestana 1527bd6
nits for dependent pallets and runtimes
gpestana 5cb1de1
adds ElectionProvider::ongoing to trait and impls
gpestana 50d9698
Merge branch 'master' into gpestana/epm-mb
Ank4n 43eec4b
clean up sp-staking
gpestana 11dd785
clean up and rustdoc for epm-support
gpestana d446ed0
Merge branch 'gpestana/epm-mb' of github.com:paritytech/polkadot-sdk …
gpestana 5c17573
nits onchain election provider
gpestana ee7bdd4
EPM nits and rustdoc improvements
gpestana f30b548
clean up and rustdocs for EPM core and sub pallets
gpestana e7bf7dc
rustdocs and nits
gpestana f810692
Merge branch 'master' into gpestana/epm-mb
gpestana bf67a3e
adds prdoc
gpestana 345840d
fixes prdoc
gpestana 52dcee9
removes from all pallets
gpestana 6d506e2
Adds new tests for verifier pallet
gpestana 430532a
implements hold logic in signed pallet; finishes implementing bail call
gpestana 068e0fd
finishes signed pallet
gpestana 5ca0bab
Merge branch 'master' into gpestana/epm-mb-merge
gpestana 385500d
updates inherent call in unsigned phase to new interfaces
gpestana b4019bb
licence header nit
gpestana 9f30e2d
Merge branch 'master' into gpestana/epm-mb
gpestana 82abba1
removes epm-mb
gpestana 1034653
nit fix in bags list remote tests
gpestana 7248960
nit fix prdoc
gpestana 18813c9
Merge branch 'master' into gpestana/epm-mb
gpestana a92d44a
Addresses PR reviews (removes all paged types/configs from epm and nits)
gpestana 3d1a330
improve memory efficiency of try into bounded supports; tests
gpestana 1757c91
a few nits in the staking pallet; handles exposures better (do not le…
gpestana 7022467
updates electable stashes to allow for multiple adds across pages
gpestana b49684e
Adds staking pallet rustdocs; nits
gpestana 7851c6e
Refactors the snapshot cursors of staking pallet and adds more tests
gpestana 3ff9914
Adds e2e tests to staking pallet
gpestana bc7b200
adds exposure collection checks to multi page election tests
gpestana 2e71ab2
EPM-MB: Supports only single page target snapshot (#6414)
gpestana e9854fc
Adds try-state checks for election prep metadata and tests
gpestana 9f4b6a3
more tests
gpestana 612886f
Merge branch 'master' into gpestana/epm-mb
gpestana fb31d1b
".git/.scripts/commands/fmt/fmt.sh"
01e09c6
Update substrate/frame/election-provider-multi-phase/src/lib.rs
gpestana b4c900c
Update substrate/frame/election-provider-multi-phase/src/lib.rs
gpestana 628ae67
Update prdoc/pr_6034.prdoc
gpestana d05a002
Update substrate/frame/staking/src/lib.rs
gpestana 07796d9
Update substrate/frame/staking/src/lib.rs
gpestana 23b9c21
Update substrate/frame/election-provider-multi-phase/src/lib.rs
gpestana 2570c23
Update substrate/frame/election-provider-multi-phase/src/lib.rs
gpestana 808e2ba
Update substrate/frame/election-provider-multi-phase/src/lib.rs
gpestana 2092d2c
Update substrate/frame/election-provider-multi-phase/src/unsigned.rs
gpestana f2fe960
Update substrate/frame/election-provider-support/src/onchain.rs
gpestana bca81c2
Update substrate/frame/election-provider-support/src/lib.rs
gpestana df729a0
addresses PR review comments
gpestana 0774cc4
Merge branch 'master' into gpestana/epm-mb
gpestana 51329d7
ensures only collected electable stashes have exposures collectede
gpestana 64d3ab3
comment nits
gpestana 2082723
adds type alias to ensure bounds are in order
gpestana d720e5a
integrity test
gpestana a88361a
Update substrate/frame/election-provider-multi-phase/src/lib.rs
gpestana ea5aa9e
Update substrate/frame/election-provider-multi-phase/src/lib.rs
gpestana d140b1f
removes the lockable election provider and other nits
gpestana d64068b
Merge branch 'gpestana/epm-mb' of github.com:paritytech/polkadot-sdk …
gpestana 1a2ddfc
removes unecessary last_page_empty_slots
gpestana 2117056
docs and tests for exposures.split_others
gpestana e568248
Merge branch 'master' into gpestana/epm-mb
gpestana 83c7288
nits and removes sp-std dependency from staking primitives
gpestana 6705e0f
Update substrate/frame/election-provider-multi-phase/src/lib.rs
gpestana 4e13e4f
Update prdoc/pr_6034.prdoc
gpestana 825984b
fixes epm test case
gpestana 93d6bda
removes TryIntoBoundedSupports trait and impl coversion directly in S…
gpestana 69b38e5
Adds max backers per winner bounds check in the phragmen implementati…
gpestana f6be182
Merge branch 'master' into gpestana/epm-mb
gpestana 442a64e
Merge branch 'master' into gpestana/epm-mb
gpestana e43e885
addresses PR comments
gpestana 676db53
Revert "Adds max backers per winner bounds check in the phragmen impl…
gpestana fe8b9ae
adds max backers per winner trimming test
gpestana 84eea26
Ensures max backers per winner bounds are met in Staking miner (#6771)
gpestana 4788579
fixes overflowing tests
gpestana b792a6d
adds benchs and nits
gpestana 61ef83e
Merge branch 'master' into gpestana/epm-mb
gpestana 5ce51ea
pr review refactors and improvements
gpestana 39e5c3d
improves add_electables and tests
gpestana 65cf87f
improves add_electables
gpestana 7d33c5c
remove unecessary cloning
gpestana d7817e0
migrations
gpestana 0edb158
Merge branch 'master' into gpestana/epm-mb
gpestana 89069a9
Master.into()
kianenigma 6255f64
Master.into()
kianenigma de4f1da
fix
kianenigma 06d3308
fmt
kianenigma 5426e88
Update substrate/frame/election-provider-multi-phase/src/lib.rs
kianenigma c228dc4
fix lock file
kianenigma ddeb1ae
Merge branch 'gpestana/epm-mb' of github.com:paritytech/polkadot-sdk …
kianenigma de93ecd
onchain backup sorting, testing chain in kitchensink
kianenigma 5d64293
fix migration
kianenigma 9464dc5
Merge branch 'master' of github.com:paritytech/polkadot-sdk into gpes…
kianenigma 01adfe6
greenish CI now
kianenigma eedd03a
fmt
kianenigma 33a37e6
fix unused import
kianenigma 7df54f1
fix some benchmarks too
kianenigma 1b5ddc6
better doc
kianenigma c5efc26
fix tests and a bug
kianenigma 3ab3a17
Merge branch 'master' into gpestana/epm-mb
kianenigma 4d690b7
more testing
kianenigma e9180f6
Master.into()
kianenigma d348cb0
Update substrate/primitives/staking/src/lib.rs
kianenigma 7ce460c
rename and fix
kianenigma bb685d1
Upstream.into()
kianenigma 7f438db
fix
kianenigma 90807e2
add tests
kianenigma fbc8733
add original pallet, almost compiles
kianenigma 377b32b
pallet compiles and all tests pass again
kianenigma b56e739
refactor events
kianenigma 28487af
clean up main pallet a bit
kianenigma 68bc3cd
migrate signed to fungibles
kianenigma 8186246
cleanip signed phase a bit more
kianenigma b5b21ff
integrate try-runtime
kianenigma 0f81eba
fix up signed phase, lgtm
kianenigma e09da9b
integrate into the runtime
kianenigma dbea5a8
make multi page election graceful, onchain supports multi page, bette…
kianenigma 340c563
node biuld
kianenigma fa9ef69
add a few comments for niklas
kianenigma 0e2446c
add a few comments for niklas
kianenigma e10e8bf
add a few comments for niklas
kianenigma 31f4245
works continously now
kianenigma b9aa881
stateless data provider so that EPM and EPMB can work together
kianenigma e02a7ce
staking benchmarks are mostly green
kianenigma cd52ab2
master.into()
kianenigma deb7daa
tests pass again
kianenigma 72841b7
refactor into MinerConfig
kianenigma a8445bd
move dev_accounts to pallet-staking, simplify onchain large chain-spe…
kianenigma 398382d
rename to validators
kianenigma 322969d
Merge branch 'master' into kiz-multi-block-eletion
Ank4n c04e473
add benchmarking and weight, we need a lot more work to fix the weights
kianenigma 8f06783
Merge branch 'kiz-multi-block-eletion' of github.com:paritytech/polka…
kianenigma bb1f89a
make the timing good for testing
kianenigma 0fa010d
Bound some storage items for pallet `staking` and clean up deprecated…
re-gius 7eaf90c
Merge branch 'master' of github.com:paritytech/polkadot-sdk into kiz-…
kianenigma d7f1cdc
pass some tests
kianenigma 14d536d
update all license headers
kianenigma c72a9c1
Update from kianenigma running command 'prdoc'
github-actions[bot] 4191232
Update from kianenigma running command 'fmt'
github-actions[bot] 35fd8af
Merge branch 'kiz-multi-block-eletion' of github.com:paritytech/polka…
kianenigma 10fbd75
update PRdoc
kianenigma dfc2f18
Merge branch 'master' of github.com:paritytech/polkadot-sdk into kiz-…
kianenigma a7d2233
some clippy and CI issues
kianenigma 38d4971
gen umbrella + versions
kianenigma 1e04da7
bring back umbrella version
kianenigma 821fcff
make tests temporarily pass to merge the PR
kianenigma 824f0a7
fix
kianenigma 5168936
CI happy?
kianenigma a6739cf
allow unused
kianenigma 6fd02ea
Merge branch 'master' into kiz-multi-block-eletion
kianenigma 722bf1a
Update prdoc/pr_7282.prdoc
kianenigma b95fda3
fix unused stuff
kianenigma 00c0828
Merge branch 'kiz-multi-block-eletion' of github.com:paritytech/polka…
kianenigma ccfea6a
Update prdoc/pr_7282.prdoc
kianenigma 39d2b76
fix PRdoc again
kianenigma 2cd7e37
fix some old prdocs
kianenigma cd90534
clippy and UI fixes
kianenigma 48add5d
fix all docs
kianenigma a1dd41a
fix more docs and warnings
kianenigma 5d33179
fix unused fn
kianenigma 7dcb6fd
fix a subset of quick benches
kianenigma 447c81f
fix phragmen benches
kianenigma 1e4ffc3
last CI issues?
kianenigma 8ae2184
Merge branch 'master' into kiz-multi-block-eletion
kianenigma 469046a
make benchmarks faster, quick solver and fix some tests in substrate …
kianenigma 9cad263
Merge branch 'kiz-multi-block-eletion' of github.com:paritytech/polka…
kianenigma 2d5bea3
fix build
kianenigma 0d6c7ff
exclude EPMB benchmarks from the quick-bench job for now
kianenigma 607a101
fix a lot of random tests
kianenigma bd21793
fix genesis config tests
kianenigma 4dc1ec4
fixing more CI tests...
kianenigma f0b9503
new weights
kianenigma 9a0ed54
fix test compilation
kianenigma 97300a6
license + fix one more test
kianenigma 3d4c733
:wq
kianenigma 908fa00
license
kianenigma 6769acb
Update from kianenigma running command 'prdoc --force'
github-actions[bot] 2aca247
prdco
kianenigma ffb9746
remove problematic test
kianenigma f35de68
revert lock file?
kianenigma 02b438c
fix infinite loop in paras benchmarking
kianenigma c0d0746
squashing commits to make rebasing easier
Ank4n 0bc581b
Sets full identification of validators as unit type, removing depende…
Ank4n f2aed02
bug fixes, and tests for multi block processing of offences and appli…
Ank4n 6abae76
migrate UnappliedSlashes
Ank4n e323ef4
minor refactors
Ank4n 0a799c2
fmt
Ank4n a3b30c8
fix migration
Ank4n 377ea31
add crude weights
Ank4n 9231be7
bench apply_slash
Ank4n 8c81d34
fix weight
Ank4n 4b1a3fc
bump storage version of staking
Ank4n 96896b5
fix root offences
Ank4n ffeb2c1
fmt
Ank4n eff5aad
fix mock runtimes
Ank4n 08ff229
unused
Ank4n 1c525eb
Merge branch 'master' into ankan/paged-slashing
Ank4n 5bdf285
keep the ExposureOf impl of historical session manager
Ank4n 0a00c43
relax the historical config bounds
Ank4n 34c99bd
fmt
Ank4n 6dbed1d
fix staking playground runtime
Ank4n 579af39
fix offence test
Ank4n b899cee
Merge branch 'master' into ankan/paged-slashing
Ank4n 1f11ff9
add prdoc
Ank4n 6c19876
Merge branch 'master' into ankan/paged-slashing
Ank4n 773c16d
fix prdoc
Ank4n dce1c4e
Merge branch 'master' into ankan/paged-slashing
Ank4n 900a675
add comment
Ank4n 2aa5388
Merge branch 'master' into ankan/paged-slashing
Ank4n File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| # Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0 | ||
| # See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json | ||
|
|
||
| title: 'Bounded Slashing: Paginated Offence Processing & Slash Application' | ||
|
|
||
| doc: | ||
| - audience: Runtime Dev | ||
| description: | | ||
| This PR refactors the slashing mechanism in `pallet-staking` to be bounded by introducing paged offence processing and paged slash application. | ||
|
|
||
| ### Key Changes | ||
| - Offences are queued instead of being processed immediately. | ||
| - Slashes are computed in pages, stored as a `StorageDoubleMap` with `(Validator, SlashFraction, PageIndex)` to uniquely identify them. | ||
| - Slashes are applied incrementally across multiple blocks instead of a single unbounded operation. | ||
| - New storage items: `OffenceQueue`, `ProcessingOffence`, `OffenceQueueEras`. | ||
| - Updated API for cancelling and applying slashes. | ||
| - Preliminary benchmarks added; further optimizations planned. | ||
|
|
||
| This enables staking slashing to scale efficiently and removes a major blocker for staking migration to a parachain (AH). | ||
|
|
||
| crates: | ||
| - name: pallet-babe | ||
| bump: patch | ||
| - name: pallet-staking | ||
| bump: major | ||
| - name: pallet-grandpa | ||
| bump: patch | ||
| - name: westend-runtime | ||
| bump: minor | ||
| - name: pallet-beefy | ||
| bump: patch | ||
| - name: pallet-offences-benchmarking | ||
| bump: patch | ||
| - name: pallet-session-benchmarking | ||
| bump: patch | ||
| - name: pallet-root-offences | ||
| bump: patch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.