Skip to content
Snippets Groups Projects
  1. Mar 06, 2025
    • Dónal Murray's avatar
      Add westend system chains as a trusted teleporters (#7787) · 6893fb22
      Dónal Murray authored
      
      Asset Hub Next has been deployed on Westend as parachain 1100, but it's
      not yet a trusted teleporter.
      This minimal PR adds it in stable2412 so that it can be deployed right
      away without waiting for the rest of the release to be finalised and
      deployed.
      
      ---------
      
      Co-authored-by: default avatarcmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
    • Raymond Cheung's avatar
      Ensure Logs Are Captured for Assertions and Printed During Tests (#7769) · ce5f89c6
      Raymond Cheung authored
      This PR enhances **`test_log_capture`**, ensuring logs are **captured
      for assertions** and **printed to the console** during test execution.
      
      ## **Motivation**  
      
      - Partially addresses #6119 and #6125, to improves developer **tracing
      and debugging** in XCM-related tests.
      - Builds on #7594, improving **log visibility** while maintaining test
      **log capture capabilities**.
      - While writing tests for #7234, I noticed this function was missing.
      This PR adds it to streamline log handling in unit tests.
      
      ## **Changes**  
      
      - Ensures logs up to `TRACE` level are **captured** (for assertions) and
      **printed** (for visibility).
      - Refines documentation to clearly specify **when to use** each
      function.
      - **Removes ANSI escape codes** from captured logs to ensure clean,
      readable assertions.
      
      ## **When to Use?**  
      
      | Usage | Captures Logs? | Prints Logs? | Example |
      
      |----------------------------------------------|-----------------|--------------|-----------------------------------------------|
      | `init_log_capture(LevelFilter::INFO, false)` | :white_check_mark: Yes | :x: No | Capture
      logs for assertions without printing. |
      | `init_log_capture(LevelFilter::TRACE, true)` | :white_check_mark: Yes | :white_check_mark: Yes | Capture
      logs and print them in test output. |
      | `sp_tracing::init_for_tests()` | :x: No | :white_check_mark:
      
       Yes | Print logs to the
      console without capturing. |
      
      ---------
      
      Co-authored-by: default avatarcmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
    • Andrei Sandu's avatar
      Dynamic uncompressed code size limit (#7760) · f02134c8
      Andrei Sandu authored
      
      Fixes https://github.com/paritytech/polkadot-sdk/issues/7664
      
      The discussion in https://github.com/paritytech/polkadot-sdk/pull/7710
      should provide the context for why this solution was picked.
      
      ---------
      
      Signed-off-by: default avatarAndrei Sandu <andrei-mihail@parity.io>
      Co-authored-by: default avatarcmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  2. Mar 05, 2025
  3. Mar 04, 2025
  4. Feb 28, 2025
  5. Feb 27, 2025
  6. Feb 26, 2025
  7. Feb 24, 2025
    • Niklas Adolfsson's avatar
      deps: remove unused feature `subxt/substrate-compat` (#7643) · a9baa520
      Niklas Adolfsson authored
      Partly fixes #7403
      
      Subxt depends still on sp-crypto-hashing v0.7 but it's only one
      dependency after removing the substrate-compat feature which is probably
      "acceptable"
    • Francisco Aguirre's avatar
      XCM: Process PayFees only once (#7641) · 46139cd6
      Francisco Aguirre authored
      
      The `PayFees` instruction should only ever be used once. If it's used
      more than once, it's just a noop.
      
      ---------
      
      Co-authored-by: default avatarcmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
      Co-authored-by: default avatarAdrian Catangiu <adrian@parity.io>
    • CrabGopher's avatar
      optional rocksdb for frame-benchmarking-cli (#7649) · 2edabef4
      CrabGopher authored
      `sc-cli` brings rocksdb dependency into frame-benchmarking-cli when used
      with `default-features = false`.
      This PR makes rocksdb deps optional that sc-cli brings in some of the
      crates. I think I covered all the crates that depend on sc-cli but
      please let me know if I missed any.
      
      Fixes: https://github.com/paritytech/polkadot-sdk/issues/3793
    • Daniel Shiposha's avatar
      Fix DryRunApi client-facing XCM versions (#7438) · 963f0d73
      Daniel Shiposha authored
      
      # Description
      
      Fixes #7413
      
      ## Integration
      
      This PR updates the `DryRunApi`. The signature of the `dry_run_call` is
      changed, and the XCM version of the return values of `dry_run_xcm` now
      follows the version of the input XCM program.
      
      ## Review Notes
      
      * **The `DryRunApi` is modified**
      * **Added the `Router::clear_messages` to `dry_run_xcm` common
      implementation**
      * **Fixed the xcmp-queue's Router's clear_messages: channels details'
      first_index and last_index are reset when clearing**
      * **The MIN_XCM_VERSION is added**
      * The common implementation in the `pallet-xcm` is modified accordingly
      * The `DryRunApi` tests are modified to account for testing old XCM
      versions
      * The implementation from the `pallet-xcm` is used where it was not used
      (including the `DryRunApi` tests)
      * All the runtime implementations are modified according to the Runtime
      API change
      
      ---------
      
      Co-authored-by: default avatarAdrian Catangiu <adrian@parity.io>
    • Raymond Cheung's avatar
      Enhance XCM Debugging with Log Capture in Unit Tests (#7594) · d189f9e7
      Raymond Cheung authored
      
      # Description
      
      This PR introduces a lightweight log-capturing mechanism for XCM unit
      tests, simplifying debugging by enabling structured log assertions. It
      partially addresses #6119 and #6125, offering an optional way to verify
      logs in tests while remaining unobtrusive in normal execution.
      
      # Key Changes
      
      * [x] Introduces a log capture utility in `sp_tracing`.
      * [x] Adds XCM test examples demonstrating how and when to use log
      capturing.
      
      # Review Notes:
      
      * The log capture mechanism is opt-in and does not affect existing tests
      unless explicitly used.
      * The implementation is minimal and does not add complexity to existing
      test setups.
      * It provides a structured alternative to
      [`sp_tracing::init_for_tests()`](https://paritytech.github.io/polkadot-sdk/master/sp_tracing/fn.init_for_tests.html)
      for log verification in automated tests.
      
      ---------
      
      Co-authored-by: default avatarcmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
    • paritytech-cmd-bot-polkadot-sdk[bot]'s avatar
      Auto-update of all weights for 2025-02-21-1740149841 (#7668) · 16ed0296
      Auto-update of all weights for 2025-02-21-1740149841.
      
      Subweight results:
      - [now vs
      master](https://weights.tasty.limo/compare?repo=polkadot-sdk&threshold=5&path_pattern=.%2F**%2Fweights%2F**%2F*.rs%2C.%2F**%2Fweights.rs&method=asymptotic&ignore_errors=true&unit=time&old=master&new=update-weights-weekly-2025-02-21-1740149841)
      - [now vs polkadot-v1.15.6
      (2025-01-16)](https://weights.tasty.limo/compare?repo=polkadot-sdk&threshold=5&path_pattern=.%2F**%2Fweights%2F**%2F*.rs%2C.%2F**%2Fweights.rs&method=asymptotic&ignore_errors=true&unit=time&old=polkadot-v1.15.6&new=update-weights-weekly-2025-02-21-1740149841)
      - [now vs polkadot-v1.16.2
      (2024-11-14)](https://weights.tasty.limo/compare?repo=polkadot-sdk&threshold=5&path_pattern=.%2F**%2Fweights%2F**%2F*.rs%2C.%2F**%2Fweights.rs&method=asymptotic&ignore_errors=true&unit=time&old=polkadot-v1.16.2&new=update-weights-weekly-2025-02-21-1740149841)
      
      Co-authored-by: github-actions[bot] <41898282+github-act...
  8. Feb 22, 2025
    • Al's avatar
      Changed Rotko Networks bootnodes addresses (#7432) · f385a3ed
      Al authored
      # Description
      
      Creating this PR to changed Rotko Networks bootnode addresses to the new
      structure.
      
      Rotko bootnode addresses tested with this results:
      
      ```
      {
          "asset-hub-kusama": {
            "bootnode": "/dns/asset-hub-kusama.boot.rotko.net/tcp/30435/wss/p2p/12D3KooWJUFnjR2PNbsJhudwPVaWCoZy1acPGKjM2cSuGj345BBu",
            "discovered_peers": 3,
            "error_details": null,
            "id": "rotko",
            "network": "asset-hub-kusama",
            "status": "success",
            "test_duration_ms": 19394,
            "valid": true
          },
          "asset-hub-polkadot": {
            "bootnode": "/dns/asset-hub-polkadot.boot.rotko.net/tcp/30435/wss/p2p/12D3KooWKkzLjYF6M5eEs7nYiqEtRqY8SGVouoCwo3nCWsRnThDW",
            "discovered_peers": 5,
            "error_details": null,
            "id": "rotko",
            "network": "asset-hub-polkadot",
            "status": "success",
            "test_duration_ms": 5024,
            "valid": true
          },
          "asset-hub-westend": {
            "bootnode": "/dns/asset-hub-westend.boot.rotko.net/tcp/30...
  9. Feb 21, 2025
  10. Feb 20, 2025
    • Utkarsh Bhardwaj's avatar
      [AHM] Poke deposits: Indices pallet (#7587) · b9b73eb2
      Utkarsh Bhardwaj authored
      
      # Description
      
      * This PR adds a new extrinsic `reconsider` to `pallet-indices`. This
      extrinsic will be used to re-adjust the deposits made in the pallet.
      * Part of #5591 
      
      ## Review Notes
      
      * Added a new extrinsic `reconsider` in `pallet-indices`.
      * Added a new event `DepositReconsidered` to be emitted upon a
      successful call of the extrinsic.
      * Although the immediate use of the extrinsic will be to give back some
      of the deposit after the AH-migration, the extrinsic is written such
      that it can work if the deposit decreases or increases (both).
      * The call to the extrinsic would be `free` if an actual adjustment is
      made to the deposit and `paid` otherwise.
      * Added tests to test all scenarios.
      * Added a benchmark to test the "worst case" (maximum compute) flow of
      the extrinsic which is when the deposit amount is updated to a new
      value.
      
      ## TO-DOs
      
      * [x] Run CI cmd bot to benchmark
      
      ---------
      
      Co-authored-by: default avatarcmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
    • Alexander Theißen's avatar
      Update to Rust stable 1.84.1 (#7625) · e2d3da61
      Alexander Theißen authored
      Ref https://github.com/paritytech/ci_cd/issues/1107
      
      We mainly need that so that we can finally compile the `pallet_revive`
      fixtures on stable. I did my best to keep the commits focused on one
      thing to make review easier.
      
      All the changes are needed because rustc introduced more warnings or is
      more strict about existing ones. Most of the stuff could just be fixed
      and the commits should be pretty self explanatory. However, there are a
      few this that are notable:
      
      ## `non_local_definitions `
      
      A lot of runtimes to write `impl` blocks inside functions. This makes
      sense to reduce the amount of conditional compilation. I guess I could
      have moved them into a module instead. But I think allowing it here
      makes sense to avoid the code churn.
      
      ## `unexpected_cfgs`
      
      The FRAME macros emit code that references various features like `std`,
      `runtime-benchmarks` or `try-runtime`. If a create that uses those
      macros does not have those features we get this warning. Those were
      mostly when ...
  11. Feb 19, 2025
    • Serban Iorga's avatar
      Derive `DecodeWithMemTracking` for cumulus pallets and for `polkadot-sdk` runtimes (#7627) · d60afc9f
      Serban Iorga authored
      Related to https://github.com/paritytech/polkadot-sdk/issues/7360
      
      Derive `DecodeWithMemTracking` for the structures in the cumulus pallets
      and for the structures in the `polkadot-sdk` runtimes.
      
      The PR contains no functional changes and no manual implementation. Just
      deriving `DecodeWithMemTracking`.
    • Serban Iorga's avatar
      Derive `DecodeWithMemTracking` for bridge and xcm pallets (#7620) · 0c258c66
      Serban Iorga authored
      Just deriving `DecodeWithMemTracking` for the types used by the bridge,
      snowbridge and xcm pallets
    • Branislav Kontur's avatar
      XCM: Deny barrier checks for nested XCMs with specific instructions to be... · bd7cf119
      Branislav Kontur authored
      XCM: Deny barrier checks for nested XCMs with specific instructions to be executed on the local chain (#7200)
      
      Resolves (partially):
      https://github.com/paritytech/polkadot-sdk/issues/7148
      Depends on: https://github.com/paritytech/polkadot-sdk/pull/7169
      
      # Description
      
      This PR addresses partially #7148 (Problem 2) and ensures the proper
      checking of nested local instructions. It introduces a new barrier -
      `DenyRecursively` - to provide more refined control over instruction
      denial. The main change is the replacement of `DenyThenTry<Deny, Allow>`
      with `DenyThenTry<DenyRecursively<Deny>, Allow>` which handles both
      top-level and nested local instructions by applying allow condition
      after denial.
      
      For context and additional information, please refer to [_Problem 2 -
      Barrier vs nested XCM
      validation_](https://github.com/paritytech/polkadot-sdk/issues/7148).
      
      # TODO
      - [x] Evaluate PoC, more details at #7351:
          - **DenyNestedXcmInstructions**: Keep it as it is and be explicit:
              1. Name the Deny barriers for the top level.
      2. Name the Deny barrier for nested with `DenyInstructionsWithXcm`.
      - **DenyThenTry<DenyInstructionsWithXcm<Deny>, Allow>**: Alternatively,
      hard-code those three instructions in `DenyThenTry`, so we wouldn’t need
      `DenyInstructionsWithXcm`. However, this approach wouldn’t be as
      general.
      - **DenyInstructionsWithXcmFor**: Another possibility is to check
      `DenyInstructionsWithXcm::Inner` for the actual `message`, so we don’t
      need duplication for top-level and nested (not sure, maybe be explicit
      is good thing) - see _Problem2 - example_. Instead of this:
         ```
        DenyThenTry<
                      (
                                     // Deny for top level XCM program 
                                     DenyReserveTransferToRelayChain,
      // Dedicated barrier for nested XCM programs
                                     DenyInstructionsWithXcmFor<
      // Repeat all Deny filters here
      DenyReserveTransferToRelayChain,
                                      >
                      ),
         ```
        we could just use:
         ```
        DenyThenTry<
                      (
                                     // Dedicated barrier for XCM programs
                                     DenyInstructionsWithXcmFor<
      // Add all `Deny` filters here
      DenyReserveTransferToRelayChain,
                                                      ...
                                      >
                      ),
         ```
      - [POC
      Evaluation](https://github.com/paritytech/polkadot-sdk/pull/7200#discussion_r1939288792)
      - [x] Consider better name `DenyInstructionsWithXcm` =>
      `DenyRecursively`, more details at
      [here](https://github.com/paritytech/polkadot-sdk/pull/7200#discussion_r1958588973)
      - [x] Clean-up and docs
      - [x] Merge https://github.com/paritytech/polkadot-sdk/pull/7169 or
      rebase this branch on the top of `yrong:fix-for-deny-then-try`
      - [x] Set for the runtimes where we use `DenyThenTry<Deny, Allow>` =>
      `DenyThenTry<DenyRecursively<Deny>, Allow>`
      - [ ] Schedule sec.audit
      
      ---------
      
      Co-authored-by: default avatarRaymond Cheung <178801527+raymondkfcheung@users.noreply.github.com>
      Co-authored-by: default avatarcmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
      Co-authored-by: default avatarron <yrong1997@gmail.com>
      Co-authored-by: default avatarFrancisco Aguirre <franciscoaguirreperez@gmail.com>
      Co-authored-by: default avatarClara van Staden <claravanstaden64@gmail.com>
      Co-authored-by: default avatarAdrian Catangiu <adrian@parity.io>
  12. Feb 18, 2025
  13. Feb 17, 2025
    • Ankan's avatar
      [Staking] Bounded Slashing: Paginated Offence Processing & Slash Application (#7424) · dda2cb59
      Ankan authored
      
      closes https://github.com/paritytech/polkadot-sdk/issues/3610.
      
      helps https://github.com/paritytech/polkadot-sdk/issues/6344, but need
      to migrate storage `Offences::Reports` before we can remove exposure
      dependency in RC pallets.
      
      replaces https://github.com/paritytech/polkadot-sdk/issues/6788.
      
      ## Context  
      Slashing in staking is unbounded currently, which is a major blocker
      until staking can move to a parachain (AH).
      
      ### Current Slashing Process (Unbounded)  
      
      1. **Offence Reported**  
      - Offences include multiple validators, each with potentially large
      exposure pages.
      - Slashes are **computed immediately** and scheduled for application
      after **28 eras**.
      
      2. **Slash Applied**  
      - All unapplied slashes are executed in **one block** at the start of
      the **28th era**. This is an **unbounded operation**.
      
      
      ### Proposed Slashing Process (Bounded)  
      
      1. **Offence Queueing**  
         - Offences are **queued** after basic sanity checks.  
      
      2. **Paged Offence Processing (Computing Slash)**  
         - Slashes are **computed one validator exposure page at a time**.  
         - **Unapplied slashes** are stored in a **double map**:  
           - **Key 1 (k1):** `EraIndex`  
      - **Key 2 (k2):** `(Validator, SlashFraction, PageIndex)` — a unique
      identifier for each slash page
      
      3. **Paged Slash Application**  
      - Slashes are **applied one page at a time** across multiple blocks.
      - Slash application starts at the **27th era** (one era earlier than
      before) to ensure all slashes are applied **before stakers can unbond**
      (which starts from era 28 onwards).
      
      ---
      
      ## Worst-Case Block Calculation for Slash Application  
      
      ### Polkadot:  
      - **1 era = 24 hours**, **1 block = 6s** → **14,400 blocks/era**  
      - On parachains (**12s blocks**) → **7,200 blocks/era**  
      
      ### Kusama:  
      - **1 era = 6 hours**, **1 block = 6s** → **3,600 blocks/era**  
      - On parachains (**12s blocks**) → **1,800 blocks/era**  
      
      ### Worst-Case Assumptions:  
      - **Total stakers:** 40,000 nominators, 1000 validators. (Polkadot
      currently has ~23k nominators and 500 validators)
      - **Max slashed:** 50% so 20k nominators, 250 validators.  
      - **Page size:** Validators with multiple page: (512 + 1)/2 = 256 ,
      Validators with single page: 1
      
      ### Calculation:  
      There might be a more accurate way to calculate this worst-case number,
      and this estimate could be significantly higher than necessary, but it
      shouldn’t exceed this value.
      
      Blocks needed: 250 + 20k/256 = ~330 blocks.
      
      ##  *Potential Improvement:*  
      - Consider adding an **Offchain Worker (OCW)** task to further optimize
      slash application in future updates.
      - Dynamically batch unapplied slashes based on number of nominators in
      the page, or process until reserved weight limit is exhausted.
      
      ----
      ## Summary of Changes  
      
      ### Storage  
      - **New:**  
        - `OffenceQueue` *(StorageDoubleMap)*  
          - **K1:** Era  
          - **K2:** Offending validator account  
          - **V:** `OffenceRecord`  
        - `OffenceQueueEras` *(StorageValue)*  
          - **V:** `BoundedVec<EraIndex, BoundingDuration>`  
        - `ProcessingOffence` *(StorageValue)*  
          - **V:** `(Era, offending validator account, OffenceRecord)`  
      
      - **Changed:**  
        - `UnappliedSlashes`:  
          - **Old:** `StorageMap<K -> Era, V -> Vec<UnappliedSlash>>`  
      - **New:** `StorageDoubleMap<K1 -> Era, K2 -> (validator_acc, perbill,
      page_index), V -> UnappliedSlash>`
      
      ### Events  
      - **New:**  
        - `SlashComputed { offence_era, slash_era, offender, page }`  
        - `SlashCancelled { slash_era, slash_key, payout }`  
      
      ### Error  
      - **Changed:**  
        - `InvalidSlashIndex` → Renamed to `InvalidSlashRecord`  
      - **Removed:**  
        - `NotSortedAndUnique`  
      - **Added:**  
        - `EraNotStarted`  
      
      ### Call  
      - **Changed:**  
        - `cancel_deferred_slash(era, slash_indices: Vec<u32>)`  
          → Now takes `Vec<(validator_acc, slash_fraction, page_index)>`  
      - **New:**  
      - `apply_slash(slash_era, slash_key: (validator_acc, slash_fraction,
      page_index))`
      
      ### Runtime Config  
      - `FullIdentification` is now set to a unit type (`()`) / null identity,
      replacing the previous exposure type for all runtimes using
      `pallet_session::historical`.
      
      ## TODO
      - [x] Fixed broken `CancelDeferredSlashes`.
      - [x] Ensure on_offence called only with validator account for
      identification everywhere.
      - [ ] Ensure we never need to read full exposure.
      - [x] Tests for multi block processing and application of slash.
      - [x] Migrate UnappliedSlashes 
      - [x] Bench (crude, needs proper bench as followup)
        - [x] on_offence()
        - [x] process_offence()
        - [x] apply_slash()
       
       
      ## Followups (tracker
      [link](https://github.com/paritytech/polkadot-sdk/issues/7596))
      - [ ] OCW task to process offence + apply slashes.
      - [ ] Minimum time for governance to cancel deferred slash.
      - [ ] Allow root or staking admin to add a custom slash.
      - [ ] Test HistoricalSession proof works fine with eras before removing
      exposure as full identity.
      - [ ] Properly bench offence processing and slashing.
      - [ ] Handle Offences::Reports migration when removing validator
      exposure as identity.
      
      ---------
      
      Co-authored-by: default avatarGonçalo Pestana <g6pestana@gmail.com>
      Co-authored-by: command-bot <>
      Co-authored-by: default avatarKian Paimani <5588131+kianenigma@users.noreply.github.com>
      Co-authored-by: default avatarGuillaume Thiolliere <gui.thiolliere@gmail.com>
      Co-authored-by: default avatarkianenigma <kian@parity.io>
      Co-authored-by: default avatarGiuseppe Re <giuseppe.re@parity.io>
      Co-authored-by: default avatarcmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
    • Oliver Tale-Yazdi's avatar
      [AHM] Make pallet types public (#7579) · ca91d4b5
      Oliver Tale-Yazdi authored
      
      Preparation for AHM and making stuff public.
      
      ---------
      
      Signed-off-by: default avatarOliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
      Co-authored-by: default avatarcmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
      Co-authored-by: default avatarDónal Murray <donal.murray@parity.io>
    • Daniel Olano's avatar
      Change pallet referenda TracksInfo::tracks to return an iterator (#2072) · c078d2f4
      Daniel Olano authored
      
      Returning an iterator in `TracksInfo::tracks()` instead of a static
      slice allows for more flexible implementations of `TracksInfo` that can
      use the chain storage without compromising a lot on the
      performance/memory penalty if we were to return an owned `Vec` instead.
      
      ---------
      
      Co-authored-by: default avatarPablo Andrés Dorado Suárez <hola@pablodorado.com>
    • Pablo Andrés Dorado Suárez's avatar
    • rainb0w-pr0mise's avatar
      `pallet-utility: if_else` (#6321) · ead8fbdf
      rainb0w-pr0mise authored
      
      # Utility Call Fallback
      
      This introduces a new extrinsic: **`if_else`**
      
      Which first attempts to dispatch the `main` call(s). If the `main`
      call(s) fail, the `fallback` call(s) is dispatched instead. Both calls
      are executed with the same origin.
      
      In the event of a fallback failure the whole call fails with the weights
      returned.
      
      ## Use Case
      Some use cases might involve submitting a `batch` type call in either
      main, fallback or both.
      
      Resolves #6000
      
      Polkadot Address: 1HbdqutFR8M535LpbLFT41w3j7v9ptEYGEJKmc6PKpqthZ8
      
      ---------
      
      Co-authored-by: default avatarrainbow-promise <154476501+rainbow-promise@users.noreply.github.com>
      Co-authored-by: default avatarGuillaume Thiolliere <gui.thiolliere@gmail.com>
      Co-authored-by: default avatarOliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
  14. Feb 14, 2025
    • Kian Paimani's avatar
      [AHM] Multi-block staking election pallet (#7282) · a025562b
      Kian Paimani authored
      ## 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: default avatarGonçalo Pestana <g6pestana@gmail.com>
      Co-authored-by: default avatarAnkan <10196091+Ank4n@users.noreply.github.com>
      Co-authored-by: command-bot <>
      Co-authored-by: default avatarGuillaume Thiolliere <gui.thiolliere@gmail.com>
      Co-authored-by: default avatarGiuseppe Re <giuseppe.re@parity.io>
      Co-authored-by: default avatarcmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
    • Bastian Köcher's avatar