1. Apr 26, 2024
  2. Mar 26, 2024
    • Dcompoze's avatar
      Fix spelling mistakes across the whole repository (#3808) · 002d9260
      Dcompoze authored
      **Update:** Pushed additional changes based on the review comments.
      
      **This pull request fixes various spelling mistakes in this
      repository.**
      
      Most of the changes are contained in the first **3** commits:
      
      - `Fix spelling mistakes in comments and docs`
      
      - `Fix spelling mistakes in test names`
      
      - `Fix spelling mistakes in error messages, panic messages, logs and
      tracing`
      
      Other source code spelling mistakes are separated into individual
      commits for easier reviewing:
      
      - `Fix the spelling of 'authority'`
      
      - `Fix the spelling of 'REASONABLE_HEADERS_IN_JUSTIFICATION_ANCESTRY'`
      
      - `Fix the spelling of 'prev_enqueud_messages'`
      
      - `Fix the spelling of 'endpoint'`
      
      - `Fix the spelling of 'children'`
      
      - `Fix the spelling of 'PenpalSiblingSovereignAccount'`
      
      - `Fix the spelling of 'PenpalSudoAccount'`
      
      - `Fix the spelling of 'insufficient'`
      
      - `Fix the spelling of 'PalletXcmExtrinsicsBenchmark'`
      
      - `Fix the spelling of 'subtracted'`
      
      - `Fix the spelling of 'CandidatePendingAvailability'`
      
      - `Fix the spelling of 'exclusive'`
      
      - `Fix the spelling of 'until'`
      
      - `Fix the spelling of 'discriminator'`
      
      - `Fix the spelling of 'nonexistent'`
      
      - `Fix the spelling of 'subsystem'`
      
      - `Fix the spelling of 'indices'`
      
      - `Fix the spelling of 'committed'`
      
      - `Fix the spelling of 'topology'`
      
      - `Fix the spelling of 'response'`
      
      - `Fix the spelling of 'beneficiary'`
      
      - `Fix the spelling of 'formatted'`
      
      - `Fix the spelling of 'UNKNOWN_PROOF_REQUEST'`
      
      - `Fix the spelling of 'succeeded'`
      
      - `Fix the spelling of 'reopened'`
      
      - `Fix the spelling of 'proposer'`
      
      - `Fix the spelling of 'InstantiationNonce'`
      
      - `Fix the spelling of 'depositor'`
      
      - `Fix the spelling of 'expiration'`
      
      - `Fix the spelling of 'phantom'`
      
      - `Fix the spelling of 'AggregatedKeyValue'`
      
      - `Fix the spelling of 'randomness'`
      
      - `Fix the spelling of 'defendant'`
      
      - `Fix the spelling of 'AquaticMammal'`
      
      - `Fix the spelling of 'transactions'`
      
      - `Fix the spelling of 'PassingTracingSubscriber'`
      
      - `Fix the spelling of 'TxSignaturePayload'`
      
      - `Fix the spelling of 'versioning'`
      
      - `Fix the spelling of 'descendant'`
      
      - `Fix the spelling of 'overridden'`
      
      - `Fix the spelling of 'network'`
      
      Let me know if this structure is adequate.
      
      **Note:** The usage of the words `Merkle`, `Merkelize`, `Merklization`,
      `Merkelization`, `Merkleization`, is somewhat inconsistent but I left it
      as it is.
      
      ~~**Note:** In some places the term `Receival` is used to refer to
      message reception, IMO `Reception` is the correct word here, but I left
      it as it is.~~
      
      ~~**Note:** In some places the term `Overlayed` is used instead of the
      more acceptable version `Overlaid` but I also left it as it is.~~
      
      ~~**Note:** In some places the term `Applyable` is used instead of the
      correct version `Applicable` but I also left it as it is.~~
      
      **Note:** Some usage of British vs American english e.g. `judgement` vs
      `judgment`, `initialise` vs `initialize`, `optimise` vs `optimize` etc.
      are both present in different places, but I suppose that's
      understandable given the number of contributors.
      
      ~~**Note:** There is a spelling mistake in `.github/CODEOWNERS` but it
      triggers errors in CI when I make changes to it, so I left it as it
      is.~~
      002d9260
  3. Feb 28, 2024
  4. Feb 06, 2024
    • Squirrel's avatar
      sp-std -> core (#3199) · bc2e5e1f
      Squirrel authored
      First in a series of PRs that reduces our use of sp-std with a view to
      deprecating it.
      
      This is just looking at /substrate and moving some of the references
      from `sp-std` to `core`.
      These particular changes should be uncontroversial.
      
      Where macros are used `::core` should be used to remove any ambiguity.
      
      part of https://github.com/paritytech/polkadot-sdk/issues/2101
      bc2e5e1f
  5. Jan 10, 2024
  6. Nov 23, 2023
  7. Nov 01, 2023
    • Ankan's avatar
      [NPoS] Paging reward payouts in order to scale rewardable nominators (#1189) · 00b85c51
      Ankan authored
      helps https://github.com/paritytech/polkadot-sdk/issues/439.
      closes https://github.com/paritytech/polkadot-sdk/issues/473.
      
      PR link in the older substrate repository:
      https://github.com/paritytech/substrate/pull/13498.
      
      # Context
      Rewards payout is processed today in a single block and limited to
      `MaxNominatorRewardedPerValidator`. This number is currently 512 on both
      Kusama and Polkadot.
      
      This PR tries to scale the nominators payout to an unlimited count in a
      multi-block fashion. Exposures are stored in pages, with each page
      capped to a certain number (`MaxExposurePageSize`). Starting out, this
      number would be the same as `MaxNominatorRewardedPerValidator`, but
      eventually, this number can be lowered through new runtime upgrades to
      limit the rewardeable nominators per dispatched call instruction.
      
      The changes in the PR are backward compatible.
      
      ## How payouts would work like after this change
      Staking exposes two calls, 1) the existing `payout_stakers` and 2)
      `payout_stakers_by_page`.
      
      ### payout_stakers
      This remains backward compatible with no signature change. If for a
      given era a validator has multiple pages, they can call `payout_stakers`
      multiple times. The pages are executed in an ascending sequence and the
      runtime takes care of preventing double claims.
      
      ### payout_stakers_by_page
      Very similar to `payout_stakers` but also accepts an extra param
      `page_index`. An account can choose to payout rewards only for an
      explicitly passed `page_index`.
      
      **Lets look at an example scenario**
      Given an active validator on Kusama had 1100 nominators,
      `MaxExposurePageSize` set to 512 for Era e. In order to pay out rewards
      to all nominators, the caller would need to call `payout_stakers` 3
      times.
      
      - `payout_stakers(origin, stash, e)` => will pay the first 512
      nominators.
      - `payout_stakers(origin, stash, e)` => will pay the second set of 512
      nominators.
      - `payout_stakers(origin, stash, e)` => will pay the last set of 76
      nominators.
      ...
      - `payout_stakers(origin, stash, e)` => calling it the 4th time would
      return an error `InvalidPage`.
      
      The above calls can also be replaced by `payout_stakers_by_page` and
      passing a `page_index` explicitly.
      
      ## Commission note
      Validator commission is paid out in chunks across all the pages where
      each commission chunk is proportional to the total stake of the current
      page. This implies higher the total stake of a page, higher will be the
      commission. If all the pages of a validator's single era are paid out,
      the sum of commission paid to the validator across all pages should be
      equal to what the commission would have been if we had a non-paged
      exposure.
      
      ### Migration Note
      Strictly speaking, we did not need to bump our storage version since
      there is no migration of storage in this PR. But it is still useful to
      mark a storage upgrade for the following reasons:
      
      - New storage items are introduced in this PR while some older storage
      items are deprecated.
      - For the next `HistoryDepth` eras, the exposure would be incrementally
      migrated to its corresponding paged storage item.
      - Runtimes using staking pallet would strictly need to wait at least
      `HistoryDepth` eras with current upgraded version (14) for the migration
      to complete. At some era `E` such that `E >
      era_at_which_V14_gets_into_effect + HistoryDepth`, we will upgrade to
      version X which will remove the deprecated storage items.
      In other words, it is a strict requirement that E<sub>x</sub> -
      E<sub>14</sub> > `HistoryDepth`, where
      E<sub>x</sub> = Era at which deprecated storages are removed from
      runtime,
      E<sub>14</sub> = Era at which runtime is upgraded to version 14.
      - For Polkadot and Kusama, there is a [tracker
      ticket](https://github.com/paritytech/polkadot-sdk/issues/433) to clean
      up the deprecated storage items.
      
      ### Storage Changes
      
      #### Added
      - ErasStakersOverview
      - ClaimedRewards
      - ErasStakersPaged
      
      #### Deprecated
      The following can be cleaned up after 84 eras which is tracked
      [here](https://github.com/paritytech/polkadot-sdk/issues/433).
      
      - ErasStakers.
      - ErasStakersClipped.
      - StakingLedger.claimed_rewards, renamed to
      StakingLedger.legacy_claimed_rewards.
      
      ### Config Changes
      - Renamed MaxNominatorRewardedPerValidator to MaxExposurePageSize.
      
      ### TODO
      - [x] Tracker ticket for cleaning up the old code after 84 eras.
      - [x] Add companion.
      - [x] Redo benchmarks before merge.
      - [x] Add Changelog for pallet_staking.
      - [x] Pallet should be configurable to enable/disable paged rewards.
      - [x] Commission payouts are distributed across pages.
      - [x] Review documentation thoroughly.
      - [x] Rename `MaxNominatorRewardedPerValidator` ->
      `MaxExposurePageSize`.
      - [x] NMap for `ErasStakersPaged`.
      - [x] Deprecate ErasStakers.
      - [x] Integrity tests.
      
      ### Followup issues
      [Runtime api for deprecated ErasStakers storage
      item](https://github.com/paritytech/polkadot-sdk/issues/426
      
      )
      
      ---------
      
      Co-authored-by: default avatarJavier Viola <[email protected]>
      Co-authored-by: default avatarRoss Bulat <[email protected]>
      Co-authored-by: command-bot <>
      00b85c51
  8. Aug 31, 2023
  9. Aug 23, 2023
    • juangirini's avatar
      Restructure `frame_support` macro related exports (#14745) · 878c562c
      juangirini authored
      
      
      * make reexports private
      
      * make reexports private 2
      
      * make reexports private for runtime-benchmarking
      
      * make reexports private for try-runtime
      
      * fix for try-runtime
      
      * make reexports private for tests
      
      * fmt
      
      * make reexports private for tests
      
      * make reexports private for experimental
      
      * fix beefy
      
      * fix ui test
      
      * fix ui test
      
      * fix benches
      
      * ".git/.scripts/commands/fmt/fmt.sh"
      
      * fix contracts use
      
      * wip
      
      * wip
      
      * do not reexport sp_api::metadata_ir
      
      * fix CI checks
      
      * fix support tests
      
      * ".git/.scripts/commands/fmt/fmt.sh"
      
      * Update frame/support/src/lib.rs
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * import codec directly
      
      * fmt
      
      * fix node-cli tests
      
      ---------
      
      Co-authored-by: command-bot <>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      878c562c
  10. May 23, 2023
  11. Mar 13, 2023
    • Vivek Pandya's avatar
      Remove use of trait Store from all pallets and deprecate it. (#13535) · 2009821c
      Vivek Pandya authored
      * Remove use of trait Store from staking pallet
      
      * Remove use of trait Store from bounties pallet
      
      * Remove use of trait Store from collective pallet
      
      * Remove use of trait Store from babe pallet
      
      * Remove use of trait Store from assets pallet
      
      * Remove use of trait Store from grandpa pallet
      
      * Remove use of trait Store from balances pallet
      
      * Remove use of trait Store from authorship pallet
      
      * Remove use of trait Store from authority-discovery pallet
      
      * Remove use of trait Store from atomic-swap pallet
      
      * Remove use of trait Store from sudo pallet
      
      * Remove use of trait Store from scheduler pallet
      
      * Remove use of trait Store from scored-pool pallet
      
      * Remove use of trait Store from society pallet
      
      * Remove use of trait Store from lottery pallet
      
      * Remove use of trait Store from executive pallet
      
      * Remove use of trait Store from democracy pallet
      
      * Remove use of trait Store from elections-phragmen pallet
      
      * Remove use of trait Store from indices pallet
      
      * Remove use of trait Store from identity pallet
      
      * Remove use of trait Store from multisig pallet
      
      * Remove use of trait Store from merkle-mountain-range pallet
      
      * Remove use of trait Store from im-online pallet
      
      * Remove use of trait Store from membership pallet
      
      * Remove use of trait Store from nicks pallet
      
      * Remove use of trait Store from session pallet
      
      * Remove use of trait Store from transaction-payment pallet
      
      * Remove use of trait Store from utility pallet
      
      * Remove use of trait Store from child-bounties pallet
      
      * Remove use of trait Store from nis pallet
      
      * Remove use of trait Store from nfts pallet
      
      * Remove use of trait Store from conviction-voting pallet
      
      * Remove use of trait Store from treasury pallet
      
      * Remove use of trait Store from vesting pallet
      
      * Remove use of trait Store from preimage pallet
      
      * Remove use of trait Store from uniques pallet
      
      * Remove use of trait Store from ranked-collective pallet
      
      * Remove use of trait Store from beefy-mmr pallet
      
      * Remove use of trait Store from referenda pallet
      
      * Remove use of trait Store from whitelist pallet
      
      * Remove use of trait Store from alliance pallet
      
      * Remove use of trait Store from nomination-pools pallet
      
      * Remove use of trait Store from state-trie-migration pallet
      
      * Remove use of trait Store from message-queue pallet
      
      * Remove use of trait Store from root-offences pallet
      
      * Remove use of trait Store from root-testing pallet
      
      * Remove use of trait Store from timestamps pallet
      
      * Remove use of trait Store from system pallet
      
      * Remove use of trait Store from offences pallet
      
      * Remove use of trait Store from recovery pallet
      
      * Remove use of trait Store from node-authorization pallet
      
      * Remove use of trait Store from proxy pallet
      
      * Remove use of trait Store from benchmarking pallet
      
      * Remove use of trait Store from bags-list pallet
      
      * Add deprecated warning in store_trait
      
      * Change warning message
      
      * Run cargo fmt
      
      * Fix warning and update tests
      
      * Remove unnecessary allow deprecated
      
      * Remove use of trait Store
      
      * Fix mismatch in expected output
      
      * Minor update to warning message for deprecation of generate_store with Store trait attribute
      
      * Fixes as per review comments
      
      * Fixes as per review suggestions
      
      * Remove use of Store trait from core-fellowship pallet
      
      * Fix type in store_trait.rs
      
      * Fixes as pre review comment
      2009821c
  12. Feb 21, 2023
    • Vivek Pandya's avatar
      Remove years from copyright notes. (#13415) · bc53b9a0
      Vivek Pandya authored
      * Change copyright year to 2023 from 2022
      
      * Fix incorrect update of copyright year
      
      * Remove years from copy right header
      
      * Fix remaining files
      
      * Fix typo in a header and remove update-copyright.sh
      bc53b9a0
  13. Feb 09, 2023
    • Roman Useinov's avatar
      [Fix] Try-state feature-gated for BagsList (#13296) · 03e9f43f
      Roman Useinov authored
      
      
      * [Fix] Try-state feature-gated for BagsList
      
      * fix comment
      
      * fix try_state remote-tests
      
      * feature-gate try-state remote test for bags-list
      
      * remove try-state from a migration
      
      * more SortedListProvider fixes
      
      * more fixes
      
      * more fixes to allow do_try_state usage in other crates
      
      * do-try-state for fuzz
      
      * more fixes
      
      * more fixes
      
      * remove feature-flag
      
      * do-try-state
      
      * fix review comments
      
      * Update frame/bags-list/src/mock.rs
      
      Co-authored-by: default avatarAnton <[email protected]>
      
      ---------
      
      Co-authored-by: parity-processbot <>
      Co-authored-by: default avatarAnton <[email protected]>
      03e9f43f
  14. Jan 03, 2023
    • Ankan's avatar
      Use #[pallet::storage_version] for pallet staking (#12728) · 169cbc69
      Ankan authored
      * delete releases
      
      * use standard pallet storage version
      
      * migrate to standard storage version for staking
      
      * not compiling
      
      * keep old releases enum around for decoding
      
      * fix releases
      
      * rename old releases
      
      * retriggering ci
      
      * fix migration comments
      
      * doc update
      
      Co-authored-by: parity-processbot <>
      169cbc69
  15. Sep 28, 2022
  16. Sep 24, 2022
  17. Sep 21, 2022
    • Ankan's avatar
      Bound staking storage items (#12230) · c6a9abcc
      Ankan authored
      
      
      * replace pallet level unboundedness to individual storage items
      
      * bound structs
      
      * bounding history depth
      
      * defensive error
      
      * use the era history depth from config
      
      * clean up history depth from storage in v11
      
      * keep the name HistoryDepth for the new configuration value
      
      * use u32 for history depth in node runtime
      
      * improve doc comments
      
      * add HistoryDepth to mock runtimes with pallet-staking
      
      * rustfmt
      
      * refactor and doc improve
      
      * apply re-benchmarked weight for staking
      
      * pr feedback improvements
      
      * test for claimed rewards following the expected bounds
      
      * refactor test to calculate first and last reward era programmatically
      
      * verify previous eras cannot be claimed
      
      * add migration v12
      
      * ".git/.scripts/bench-bot.sh" pallet dev pallet_staking
      
      * fix compiler error
      
      * corrupting history depth does not lead to catastrophic issue
      
      * fix new line
      
      * remove unused import
      
      * fmt
      
      * add test to document scenario where history depth is reduced without migration
      
      * fmt
      
      * Update frame/staking/src/lib.rs
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * Update frame/staking/src/migrations.rs
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * doc for all storage items bounded by HistoryDepth
      
      * Update frame/staking/src/pallet/mod.rs
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * Update frame/staking/src/tests.rs
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * pr feedback fixes
      
      * Update frame/staking/src/tests.rs
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * remove extra checks
      
      * fix merge
      
      * fmt
      
      Co-authored-by: command-bot <>
      Co-authored-by: default avatarKian Paimani <[email protected]>
      Co-authored-by: default avatarkianenigma <[email protected]>
      c6a9abcc
  18. Sep 19, 2022
  19. Sep 18, 2022
    • Roman Useinov's avatar
      [Feature] Part 1: add TargetList for validator ranking (#12034) · 1b24f562
      Roman Useinov authored
      
      
      * [Feature] Part 1: add TargetList for validator ranking
      
      * remove redundant todo
      
      * remove typo
      
      * cleanup
      
      * implement score
      
      * more fixes
      
      * fix thresholds
      
      * fmt
      
      * Remove the stuff that has to come in the next PR, some fixes
      
      * extended balance import
      
      * Change all the references from VoteWeight to Self::Score
      
      * Add a migration for VoterBagsList
      
      * fix score
      
      * add targetList to nomination-pools tests
      
      * fix bench
      
      * address review comments
      
      * change get_npos_targets
      
      * address more comments
      
      * remove thresholds for the time being
      
      * fix instance reference
      
      * VoterBagsListInstance
      
      * reus
      
      * remove params that are not used yet
      
      * Introduced pre/post upgrade try-runtime checks
      
      * fix
      
      * fixes
      
      * fix migration
      
      * fix migration
      
      * fix post_upgrade
      
      * change
      
      * Fix
      
      * eloquent PhantomData
      
      * fix PD
      
      * more fixes
      
      * Update frame/staking/src/pallet/impls.rs
      
      Co-authored-by: default avatarSquirrel <[email protected]>
      
      * is_nominator now works
      
      * fix test-staking
      
      * build fixes
      
      * fix remote-tests
      
      * Apply suggestions from code review
      
      Co-authored-by: parity-processbot <>
      Co-authored-by: default avatarkianenigma <[email protected]>
      Co-authored-by: default avatarSquirrel <[email protected]>
      Co-authored-by: default avatarKian Paimani <[email protected]>
      1b24f562
  20. Sep 01, 2022
  21. Jul 28, 2022
  22. Jul 26, 2022
  23. May 17, 2022
    • Bastian Köcher's avatar
      generate_storage_alias: Rewrite as proc macro attribute (#11387) · 74428fa8
      Bastian Köcher authored
      * generate_storage_alias: Rewrite as proc macro attribute
      
      This rewrites the `generate_storage_alias!` declarative macro as proc-macro attribute. While doing
      this the name is changed to `storage_alias`. The prefix can now also be the name of a pallet. This
      makes storage aliases work in migrations for all kind of chains and not just for the ones that use
      predefined prefixes.
      
      * Fix compilation and FMT
      
      * Moare fixes
      
      * 🤦
      
      * ......
      
      * Rework the syntax and support instancing
      
      * FMT
      
      * Prefix variants with `Storage`
      
      * Make it compile
      
      * Fix where clause on rust stable
      74428fa8
  24. Mar 23, 2022
  25. Jan 03, 2022
  26. Dec 07, 2021
    • Ayevbeosa Iyamu's avatar
      Used CountedStorageMap in pallet-staking (#10233) · 56fb1cfb
      Ayevbeosa Iyamu authored
      
      
      * Removed counters and used CountedStorageMap instead.
      
      * Little refactoring
      
      * Update frame/staking/src/migrations.rs
      
      Co-authored-by: default avatarShawn Tabrizi <[email protected]>
      
      * Removed redundant code to update counter for validator & nominator.
      
      * Removed redundant code to update counter for validator & nominator.
      
      * Removed unreachable code to inject the hashed prefix for nominator & validator.
      
      * Removed redundant check for nominator & validator count.
      
      * Generated `fn prefix_hash` for `CountedStorageMap`.
      
      * Applied changes from `cargo fmt`
      
      * Possible correct implementation of migration code
      
      * Implemented fn module_prefix, storage_prefix and prefix_hash.
      
      * Removed counted_map.rs
      
      * Renamed `fn storage_prefix` to `storage_counter_prefix`.
      
      * Update frame/support/src/storage/types/counted_map.rs
      
      * Update frame/bags-list/remote-tests/src/snapshot.rs
      
      * Update frame/support/src/storage/types/counted_map.rs
      
      * Fixed errors.
      
      Co-authored-by: default avatarShawn Tabrizi <[email protected]>
      Co-authored-by: default avatarGuillaume Thiolliere <[email protected]>
      56fb1cfb
  27. Dec 03, 2021
  28. Sep 17, 2021
    • Zeke Mostov's avatar
      Implement `pallet-bags-list` and its interfaces with `pallet-staking` (#9507) · 669972a1
      Zeke Mostov authored
      
      
      * remove extra whitespace
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * only emit rebag event on success
      
      * add doc explaining the term voter
      
      * revamp/simplify rebag test
      
      * ensure genesis accounts are placed into the correct nodes/bags
      
      * bond_extra implicitly rebags
      
      * types at top; doc public type
      
      * start sketching out adjustable thresholds
      
      * add integrity test for voter bag threshold requirements
      
      * get rid of BagIdx
      
      This reorganizes bag storage such that bags are always referred to
      by their upper threshold. This in turn means that adding and removing
      bags is cheaper; you only need to migrate certain voters, not all of them.
      
      * implement migration logic for when the threshold list changes
      
      * start sketching out threshold proc macros
      
      * further refine macro signatures
      
      * WIP: implement make_ratio macro
      
      * start rethinking the process of producing threshold lists
      
      The macro approach seems to be a non-starter; that only really works
      if we're throwing around numeric literals everywhere, and that's just
      not nice in this case.
      
      Instead, let's write helper functions and make it really easy to
      generate the tables in separate, permanent files, which humans
      can then edit.
      
      * write helper functions to emit voter bags module
      
      * WIP: demo generating voter bags for a realistic runtime
      
      This isn't yet done, becuase it seems to take a Very Long Time to run,
      and it really shouldn't. Need to look into that.
      
      Still, it's a lot closer than it was this morning.
      
      * rm unnecessary arg_enum
      
      * fix voter bags math
      
      Turns out that when you're working in exponential space, you need
      to divide, not subtract, in order to keep the math working properly.
      
      Also neaten up the output a little bit to make it easier to read.
      
      * add computed voter bags thresholds to node
      
      * fixup some docs
      
      * iter from large bags to small, fulfuilling the contract
      
      * make tests compile
      
      * add VoterBagThresholds to some configs
      
      * ensure that iteration covers all voters even with implied final bag
      
      * use sp_std::boxed::Box;
      
      * fix unused import
      
      * add some more voter bags tests
      
      * file_header.txt
      
      * integrity test to ensure min bag exceeds existential weight
      
      * add more debug assertions about node list length
      
      * rm unused imports
      
      * Kian enters
      
      * Update frame/election-provider-support/src/onchain.rs
      
      Co-authored-by: default avatarZeke Mostov <[email protected]>
      
      * Suggestions for #9081 (Store voters in unsorted bags) (#9328)
      
      * Add some debug asserts to node::get and remove_node
      
      * Improve the debug asserts in remove_node
      
      * improve debug asserts
      
      * Space
      
      * Remove bad assertions
      
      * Tests: WIP take_works
      
      * Take test
      
      * Doc comment
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * Test storage is cleaned up;
      
      * formatting
      
      * Switch to simpler thresholds
      
      * Update the storage cleanup test
      
      * Remove hardcoded values from benchmark to make it more robust
      
      * Fix tests to acces bags properly
      
      * Sanity check WIP; tests failing
      
      * Update sanity checks to be more correct
      
      * Improve storage cleanup tests
      
      * WIP remote_ext_tests
      
      * Some notes on next steps
      
      * Remove some stuff that was for remote-ext tests
      
      * Some more cleanup to reduce diff
      
      * More :clean:
      
      * Mo cleanin
      
      * small fix
      
      * A lot of changes from kian
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      Co-authored-by: default avatarkianenigma <[email protected]>
      
      * merge fallout
      
      * Run cargo +nightly fmt
      
      * Fix a bunch of stuff, remove not needed runtime arg of make-bags
      
      * add logs
      
      * Glue the new staking bags to the election snapshot (#9415)
      
      * Glue the new staking bags to the election snapshot
      
      * add CheckedRem (#9412)
      
      * add CheckedRem
      
      * fix
      
      * Run fmt
      
      * Test comment
      
      Co-authored-by: default avatarXiliang Chen <[email protected]>
      Co-authored-by: default avataremostov <[email protected]>
      
      * Update node runtime with VoterSnapshotPerBlock
      
      * Unit test for pallet-staking unsorted bags feature (targets #9081) (#9422)
      
      * impl notional_bag_for_works
      
      * Add tests: insert_as_works & insert_works
      
      * Impl test: remove_works
      
      * Trivial cleaning
      
      * Add test: update_position_for_works
      
      * Write out edge case; probably can delete later
      
      * Add test: bags::get_works
      
      * Add test: remove_node_happy_path_works
      
      * Add test: remove_node_bad_paths_documented
      
      * WIP: voting_data_works
      
      * done
      
      * Improve test voting_data_works
      
      * Add comment
      
      * Fill out test basic_setup_works
      
      * Update: iteration_is_semi_sorted
      
      * Improve remove_works
      
      * Update update_position_for_works; create set_ledger_and_free_balance
      
      * Improve get_works
      
      * Improve storage clean up checks in remove test
      
      * Test: impl rebag_works + insert_and_remove_works
      
      * forgot file -  Test: impl rebag_works + insert_and_remove_works
      
      * Small tweak
      
      * Update voter_bags test to reflect unused bags are removed
      
      * Unbond & Rebond: do_rebag
      
      * Prevent infinite loops with duplicate tail insert
      
      * Check iter.count on voter list in pre-migrate
      
      * undo strang fmt comment stuff
      
      * Add in todo
      
      Co-authored-by: default avatarkianenigma <[email protected]>
      
      * Try prepare for master merge
      
      * Reduce diff
      
      * Add comment for test to add
      
      * Add in code TODO for update_position efficiency updates
      
      * Initial impl compiles
      
      * impl StakingVoterListStub
      
      * Sample impl<T: Config> VoterListProvider<T> for VoterList<T>
      
      * impl VoterListProvider for voter-bags
      
      * WIP integrate pallet-voter-bags to staking mock
      
      * the trait `pallet_staking::pallet::pallet::Config` is not implemented for `mock::Test`
      
      * random
      
      * pushing my stuff
      
      * Mock working
      
      * WIP voter list tests
      
      * Add bag insert, remove tests
      
      * Add test for bag insert and remove
      
      * Add remaining tests for VoterList
      
      * Add tests for node
      
      * Add rebag works
      
      * Add rebag extrinsic tests
      
      * Rename to bags-list and name the list .. list!
      
      * Rename VoterBagThresholds => BagThresholds
      
      * Add test count_works
      
      * Test on_update_works
      
      * test sanity check
      
      * a round of test fixes
      
      * push a lot of changes
      
      * my last changes
      
      * all bags-list test work; fmt
      
      * Beautify some tests
      
      * Doc comment for bags-list
      
      * Add insert warnings
      
      * Setup initial benchmark
      
      * Wire up WeightInfo
      
      * is_terminal wip; everything broken!
      
      * Is terminal working
      
      * add TODOs for remove_node
      
      * clean up remoe_node
      
      * Fix all staking tests
      
      * retire VoterBagFor
      
      * commit
      
      * bring in stashed changes
      
      * save
      
      * bench pipeline works now, but I can't run stuff
      
      * sabe
      
      * benchmarks now run, but we have a failure
      
      * WIP: Wire up make_bags
      
      * bags-thresholds compiles
      
      * Fix most build issues
      
      * This will fix all the tests
      
      * move bag thresholds to bags-list
      
      * Move bag-thresholds bin to within pallet-bags
      
      * Remove some unnescary TODOs
      
      * Impl tets wrong_rebag_is_noop
      
      * assert remove is a noop with bad data
      
      * Assert integrity test panics
      
      * Return an error when inserting duplicates
      
      * Update to handle error in staking pallet when inserting to list
      
      * Test contains and on_insert error
      
      * Test re-nominate does not mess up list or count
      
      * Everything builds and works, only the benchmark...
      
      * fuck yeah benchmarks
      
      * more cleanup, more hardening.
      
      * use the bags list again
      
      * fix benhc
      
      * Some questions and changs for List::migration
      
      * Fix migration removed_bags and new_bags usage
      
      * Some trivial aesthetic changes
      
      * Some more trivial changes
      
      * tiny changes/
      
      * mega rename
      
      * fix all tests and ci build
      
      * nit
      
      * Test and fix migration
      
      * nit
      
      * fmt
      
      * cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_staking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/staking/src/weights.rs --template=./.maintain/frame-weight-template.hbs
      
      * fmt
      
      * remove unused
      
      * make a few things pub
      
      * make node also pub.. for remote-ext test
      
      * Fix all tests again
      
      * Force bag changes in relevant benchmarks (targets #9507) (#9529)
      
      * force rebag for unbond, rebond, and bond_extra
      
      * nit
      
      * Improve utils
      
      * fmt
      
      * nits
      
      * Move generate_bags to its own pallet
      
      * Get runtime-benchmarks feature setup with prepare_on_update_benchmark
      
      * Withdraw unbonded kill working
      
      * Nominate bench working
      
      * some cleanup
      
      * WIP
      
      * update to check head pre & post conditions
      
      * Add some post condition verification stuff for on_remove
      
      * Update nominate
      
      * fmt
      
      * Improvements
      
      * Fix build
      
      * fix build with polkadot companion
      
      * Update frame/bags-list/src/list/tests.rs
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * move generate-bag from frame to utils
      
      * wip
      
      * refactor WIP
      
      * WIP save
      
      * Refactor working
      
      * some variable renaming
      
      * WIP: prepare to remove head checks
      
      * Finish MvP refactor
      
      * Some cleanup
      
      * Soem more cleanup
      
      * save
      
      * fix a lot of stuff
      
      * Update client/db/src/bench.rs
      
      Co-authored-by: default avatarShawn Tabrizi <[email protected]>
      
      * Apply suggestions from code review
      
      * Apply suggestions from code review
      
      * Fix some issues that came from trying to merge comments on github
      
      * some small changes
      
      * simplify it
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      Co-authored-by: default avatarkianenigma <[email protected]>
      Co-authored-by: default avatarShawn Tabrizi <[email protected]>
      
      * Build works
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarGuillaume Thiolliere <[email protected]>
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarGuillaume Thiolliere <[email protected]>
      
      * Remove commented out debug assert
      
      * Remove some unused deps and some unused benchmarking stuff
      
      * Fix stakings ElectionDataProvider clear
      
      * cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_bags_list --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/bags-list/src/weights.rs --template=./.maintain/frame-weight-template.hbs
      
      * cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_bags_list --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/bags-list/src/weights.rs --template=./.maintain/frame-weight-template.hbs
      
      * cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_bags_list --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/bags-list/src/weights.rs --template=./.maintain/frame-weight-template.hbs
      
      * cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_bags_list --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/bags-list/src/weights.rs --template=./.maintain/frame-weight-template.hbs
      
      * Improving staking pallet-bags-list migration
      
      * fix build and some comments;
      
      * comment
      
      * Reduce visibility in bags list components
      
      * make node.bag_upper only accesible to benchmarks
      
      * Address some feedback; comments updates
      
      * use nominator map comment
      
      * fix vec capacity debug assert
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarGuillaume Thiolliere <[email protected]>
      
      * clarify VoterSnapshotPerBlock
      
      * Reduce diff on create_validators by wrapping with_seed
      
      * Some small improvements to staking benches
      
      * Soem comment updates
      
      * fix vec capacity debug assert ... for real this time
      
      * Reduce ListBags viz
      
      * cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_staking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/staking/src/weights.rs --template=./.maintain/frame-weight-template.hbs
      
      * cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_staking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/staking/src/weights.rs --template=./.maintain/frame-weight-template.hbs
      
      * Remove supports_eq_unordered & Support eq_unordered
      
      * Update utils/frame/generate-bags/src/lib.rs
      
      Co-authored-by: default avatarGuillaume Thiolliere <[email protected]>
      
      * Make total-issuance & minimium-balance CLI args; Dont use emptry ext
      
      * Improve docs for generate bags CLI args
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * Don't use default bags weight in node runtime
      
      * Feature gating sanity_check not working
      
      * Feature gate sanity check by creating duplicate fns
      
      * Fix line wrapping
      
      * Document VoteWeightProvider
      
      * Make bags ext-builder not a module
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * use pallet_bags_list instead of crate in mock
      
      * Make get_bags test helper fn live in List
      
      * use remove_from_storage_unchecked for node removal
      
      * Remove count of ids removed in remove_many
      
      * Add node sanity check, improve list sanity check
      
      * Do a list sanity check after on_update
      
      * List::migrate: clean up debug assert, exit early when no change in thresholds
      
      * Improve public doc comments for pallet_bags_list::list::List
      
      * Improve public doc comments for pallet_bags_list::list::List
      
      * Update generate bags docs
      
      * Fix grammar in bags-list benchmark
      
      * Add benchmark case for `rebag` extrinsic
      
      * Add count parameter to List::clear; WIP adding MaxEncodedLen to list'
      
      * MaxEncodeLen + generate_storage_info not working for Bag or Node
      
      * Get MaxEncodeLen derive to work
      
      * Try to correctly feature gate SortedListProvider::clear
      
      * Use u32::MAX, not u32::max_value
      
      * Get up to nominators_quota noms
      
      * SortedListProvider::clear takes an Option
      
      * Eplicitly ignore SortedListProvider return value
      
      * Fix doc comment
      
      * Update node-runtime voter snapshot per block
      
      * Add test get_max_len_voters_even_if_some_nominators_are_slashed
      
      * Add test only_iterates_max_2_times_nominators_quota
      
      * Fix generate bags cargo.toml
      
      * use sp_std vec
      
      * Remove v8 migration hooks from pallet-staking
      
      * Update npos trait
      
      * Try respect line width
      
      * cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_bags_list --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/bags-list/src/weights.rs --template=./.maintain/frame-weight-template.hbs
      
      * Update frame/bags-list/src/benchmarks.rs
      
      * Unwrap try-runtime error; remove sortedlistprovider pre upgrade len  check
      
      * trigger ci
      
      * restore
      
      * trigger ci
      
      * restore
      
      * trigger ci
      
      * revert
      
      * trigger ci
      
      * revert
      
      Co-authored-by: default avatarPeter Goodspeed-Niklaus <[email protected]>
      Co-authored-by: default avatarKian Paimani <[email protected]>
      Co-authored-by: default avatarPeter Goodspeed-Niklaus <[email protected]>
      Co-authored-by: default avatarkianenigma <[email protected]>
      Co-authored-by: default avatarXiliang Chen <[email protected]>
      Co-authored-by: default avatarParity Benchmarking Bot <[email protected]>
      Co-authored-by: default avatarShawn Tabrizi <[email protected]>
      Co-authored-by: default avatarGuillaume Thiolliere <[email protected]>
      669972a1
  29. Jul 27, 2021