[AHM] Multi-block staking election pallet (#7282)
## Multi Block Election Pallet This PR adds the first iteration of the multi-block staking pallet. From this point onwards, the staking and its election provider pallets are being customized to work in AssetHub. While usage in solo-chains is still possible, it is not longer the main focus of this pallet. For a safer usage, please fork and user an older version of this pallet. --- ## Replaces - [x] https://github.com/paritytech/polkadot-sdk/pull/6034 - [x] https://github.com/paritytech/polkadot-sdk/pull/5272 ## Related PRs: - [x] https://github.com/paritytech/polkadot-sdk/pull/7483 - [ ] https://github.com/paritytech/polkadot-sdk/pull/7357 - [ ] https://github.com/paritytech/polkadot-sdk/pull/7424 - [ ] https://github.com/paritytech/polkadot-staking-miner/pull/955 This branch can be periodically merged into https://github.com/paritytech/polkadot-sdk/pull/7358 -> https://github.com/paritytech/polkadot-sdk/pull/6996 ## TODOs: - [x] rebase to master - Benchmarking for staking critical path - [x] snapshot - [x] election result - Benchmarking for EPMB critical path - [x] snapshot - [x] verification - [x] submission - [x] unsigned submission - [ ] election results fetching - [ ] Fix deletion weights. Either of - [ ] Garbage collector + lazy removal of all paged storage items - [ ] Confirm that deletion is small PoV footprint. - [ ] Move election prediction to be push based. @tdimitrov - [ ] integrity checks for bounds - [ ] Properly benchmark this as a part of CI -- for now I will remove them as they are too slow - [x] add try-state to all pallets - [x] Staking to allow genesis dev accounts to be created internally - [x] Decouple miner config so @niklasad1 can work on the miner 72841b73 - [x] duplicate snapshot page reported by @niklasad1 - [ ] https://github.com/paritytech/polkadot-sdk/pull/6520 or equivalent -- during snapshot, `VoterList` must be locked - [ ] Move target snapshot to a separate block --------- Co-authored-by:Gonçalo Pestana <g6pestana@gmail.com> Co-authored-by:
Ankan <10196091+Ank4n@users.noreply.github.com> Co-authored-by: command-bot <> Co-authored-by:
Guillaume Thiolliere <gui.thiolliere@gmail.com> Co-authored-by:
Giuseppe Re <giuseppe.re@parity.io> Co-authored-by:
cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
parent
c1915afc
Showing
- .github/workflows/runtimes-matrix.json 1 addition, 1 deletion.github/workflows/runtimes-matrix.json
- .github/workflows/tests.yml 1 addition, 1 deletion.github/workflows/tests.yml
- Cargo.lock 28 additions, 0 deletionsCargo.lock
- Cargo.toml 1 addition, 0 deletionsCargo.toml
- cumulus/parachains/integration-tests/emulated/chains/relays/westend/src/genesis.rs 8 additions, 2 deletions...ation-tests/emulated/chains/relays/westend/src/genesis.rs
- polkadot/runtime/common/src/try_runtime.rs 1 addition, 1 deletionpolkadot/runtime/common/src/try_runtime.rs
- polkadot/runtime/parachains/src/disputes/slashing/benchmarking.rs 4 additions, 0 deletions.../runtime/parachains/src/disputes/slashing/benchmarking.rs
- polkadot/runtime/test-runtime/src/lib.rs 8 additions, 3 deletionspolkadot/runtime/test-runtime/src/lib.rs
- polkadot/runtime/westend/src/genesis_config_presets.rs 9 additions, 3 deletionspolkadot/runtime/westend/src/genesis_config_presets.rs
- polkadot/runtime/westend/src/lib.rs 17 additions, 6 deletionspolkadot/runtime/westend/src/lib.rs
- polkadot/runtime/westend/src/weights/pallet_fast_unstake.rs 0 additions, 2 deletionspolkadot/runtime/westend/src/weights/pallet_fast_unstake.rs
- polkadot/runtime/westend/src/weights/pallet_staking.rs 10 additions, 57 deletionspolkadot/runtime/westend/src/weights/pallet_staking.rs
- prdoc/pr_6034.prdoc 25 additions, 0 deletionsprdoc/pr_6034.prdoc
- prdoc/pr_6689.prdoc 3 additions, 4 deletionsprdoc/pr_6689.prdoc
- prdoc/pr_7042.prdoc 2 additions, 2 deletionsprdoc/pr_7042.prdoc
- prdoc/pr_7282.prdoc 72 additions, 0 deletionsprdoc/pr_7282.prdoc
- substrate/.maintain/frame-umbrella-weight-template.hbs 17 additions, 0 deletionssubstrate/.maintain/frame-umbrella-weight-template.hbs
- substrate/.maintain/frame-weight-template.hbs 17 additions, 0 deletionssubstrate/.maintain/frame-weight-template.hbs
- substrate/bin/node/cli/Cargo.toml 3 additions, 0 deletionssubstrate/bin/node/cli/Cargo.toml
- substrate/bin/node/cli/src/chain_spec.rs 28 additions, 4 deletionssubstrate/bin/node/cli/src/chain_spec.rs