Skip to content
  1. Feb 15, 2024
    • Gonçalo Pestana's avatar
      Implements a % cap on staking rewards from era inflation (#1660) · fde44474
      Gonçalo Pestana authored
      This PR implements an (optional) cap of the era inflation that is
      allocated to staking rewards. The remaining is minted directly into the
      [`RewardRemainder`](https://github.com/paritytech/polkadot-sdk/blob/fb0fd3e6/substrate/frame/staking/src/pallet/mod.rs#L160)
      account, which is the treasury pot account in Polkadot and Kusama.
      
      The staking pallet now has a percent storage item, `MaxStakersRewards`,
      which defines the max percentage of the era inflation that should be
      allocated to staking rewards. The remaining era inflation (i.e.
      `remaining = max_era_payout - staking_payout.min(staking_payout *
      MaxStakersRewards))` is minted directly into the treasury.
      
      The `MaxStakersRewards` can be set by a privileged origin through the
      `set_staking_configs` extrinsic.
      
      **To finish**
      - [x] run benchmarks for westend-runtime
      
      Replaces https://github.com/paritytech/polkadot-sdk/pull/1483
      Closes https://github.com/paritytech/polkadot-sdk/issues/403
      
      ---------
      
      Co-authored-by: command-bot <>
      fde44474
    • Serban Iorga's avatar
      Bridge zombienet tests - move all test scripts to the same folder (#3333) · 5fc7622c
      Serban Iorga authored
      Related to https://github.com/paritytech/polkadot-sdk/issues/3242
      5fc7622c
    • Bastian Köcher's avatar
      sc-keystore: Improve docs (#3334) · 150a360c
      Bastian Köcher authored
      Close: https://github.com/paritytech/polkadot-sdk/issues/3320
      
      @Hugo-Trentesaux are these docs better for explaining the internals?
      150a360c
    • Adrian Catangiu's avatar
      xcm-emulator tests: remove dependency on polkadot-service full-node (#3323) · f6048604
      Adrian Catangiu authored
      Don't bring the full polkadot node (with all its dependencies) in
      `emulated-integration-tests-common` crate and deps.
      f6048604
  2. Feb 14, 2024
  3. Feb 13, 2024
    • Bastian Köcher's avatar
      Parachains-Aura: Only produce once per slot (#3308) · aa68ea58
      Bastian Köcher authored
      Given how the block production is driven for Parachains right now, with
      the enabling of async backing we would produce two blocks per slot.
      Until we have a proper collator implementation, the "hack" is to prevent
      the production of multiple blocks per slot.
      
      
      Closes: https://github.com/paritytech/polkadot-sdk/issues/3282
      aa68ea58
    • Dmitry Markin's avatar
      Prepare syncing for parallel sync strategies (#3224) · 96ebb305
      Dmitry Markin authored
      This PR should supersede
      https://github.com/paritytech/polkadot-sdk/pull/2814 and accomplish the
      same with less changes. It's needed to run sync strategies in parallel,
      like running `ChainSync` and `GapSync` as independent strategies, and
      running `ChainSync` and Sync 2.0 alongside each other.
      
      The difference with https://github.com/paritytech/polkadot-sdk/pull/2814
      is that we allow simultaneous requests to remote peers initiated by
      different strategies, as this is not tracked on the remote node in any
      way. Therefore, `PeerPool` is not needed.
      
      CC @skunert
      
      
      
      ---------
      
      Co-authored-by: default avatarSebastian Kunert <[email protected]>
      96ebb305
    • Branislav Kontur's avatar
      [xcm-builder] Replaced deprecated CurrencyAdapter with FungibleAdapter (#3287) · e0c902e3
      Branislav Kontur authored
      
      
      I found out during the cleanup of this deprecation message in the
      `polkadot-fellows` repository that we deprecated `CurrencyAdapter`
      without making the recommended changes.
      
      
      ## TODO
      - [ ] fix `polkadot-fellows` bump to 1.6.0
      https://github.com/polkadot-fellows/runtimes/pull/159
      
      ---------
      
      Co-authored-by: default avatarFrancisco Aguirre <[email protected]>
      e0c902e3
    • dependabot[bot]'s avatar
      Bump once_cell from 1.18.0 to 1.19.0 (#3217) · b79bf4fb
      dependabot[bot] authored
      
      
      Bumps [once_cell](https://github.com/matklad/once_cell) from 1.18.0 to
      1.19.0.
      <details>
      <summary>Changelog</summary>
      <p><em>Sourced from <a
      href="https://github.com/matklad/once_cell/blob/master/CHANGELOG.md">once_cell's
      changelog</a>.</em></p>
      <blockquote>
      <h2>1.19.0</h2>
      <ul>
      <li>Use <code>portable-atomic</code> instead of
      <code>atomic-polyfill</code>, <a
      href="https://redirect.github.com/matklad/once_cell/pull/251">#251</a>.</li>
      </ul>
      </blockquote>
      </details>
      <details>
      <summary>Commits</summary>
      <ul>
      <li><a
      href="https://github.com/matklad/once_cell/commit/c48d3c2c01de926228aea2ac1d03672b4ce160c1"><code>c48d3c2</code></a>
      Merge pull request <a
      href="https://redirect.github.com/matklad/once_cell/issues/251">#251</a>
      from taks/portable-atomic</li>
      <li><a
      href="https://github.com/matklad/once_cell/commit/8211d807891b9b1ccae3d83cafa582b6b73208a7"><code>8211d80</code></a>
      Fix CI</li>
      <li><a
      href="https://github.com/matklad/once_cell/commit/2715aa9896ed6d0e810d350e6db4e0c5076a9df9"><code>2715aa9</code></a>
      v1.19.0</li>
      <li><a
      href="https://github.com/matklad/once_cell/commit/dffcae4440f459184a345042a57dea26693b4c65"><code>dffcae4</code></a>
      Fix CI</li>
      <li><a
      href="https://github.com/matklad/once_cell/commit/de4cd9db5362123997baa9b40a015024b67b65a3"><code>de4cd9d</code></a>
      Revert atomic-polyfill feature</li>
      <li><a
      href="https://github.com/matklad/once_cell/commit/e26736f1f785f2c05f54d857b2876688f3fa5702"><code>e26736f</code></a>
      Fix CI</li>
      <li><a
      href="https://github.com/matklad/once_cell/commit/5f88676dd00a6648578b74e1b018f4c944d0a93e"><code>5f88676</code></a>
      Use portable_atomic instead of atomic-polyfill</li>
      <li><a
      href="https://github.com/matklad/once_cell/commit/874f9373abd7feaf923a3b3c34bfb3383529c671"><code>874f937</code></a>
      clarify that MSRV does bump the minor version</li>
      <li><a
      href="https://github.com/matklad/once_cell/commit/3cd65494663f003b9b2e0be5b37b3426e543f72a"><code>3cd6549</code></a>
      Merge <a
      href="https://redirect.github.com/matklad/once_cell/issues/245">#245</a></li>
      <li><a
      href="https://github.com/matklad/once_cell/commit/a2eabc917bf4309bc9d492be92d892176da4ecf4"><code>a2eabc9</code></a>
      Add <code>--generate-link-to-definition</code> option when building on
      docs.rs</li>
      <li>Additional commits viewable in <a
      href="https://github.com/matklad/once_cell/compare/v1.18.0...v1.19.0">compare
      view</a></li>
      </ul>
      </details>
      <br />
      
      
      [![Dependabot compatibility
      score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=once_cell&package-manager=cargo&previous-version=1.18.0&new-version=1.19.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
      
      Dependabot will resolve any conflicts with this PR as long as you don't
      alter it yourself. You can also trigger a rebase manually by commenting
      `@dependabot rebase`.
      
      [//]: # (dependabot-automerge-start)
      [//]: # (dependabot-automerge-end)
      
      ---
      
      <details>
      <summary>Dependabot commands and options</summary>
      <br />
      
      You can trigger Dependabot actions by commenting on this PR:
      - `@dependabot rebase` will rebase this PR
      - `@dependabot recreate` will recreate this PR, overwriting any edits
      that have been made to it
      - `@dependabot merge` will merge this PR after your CI passes on it
      - `@dependabot squash and merge` will squash and merge this PR after
      your CI passes on it
      - `@dependabot cancel merge` will cancel a previously requested merge
      and block automerging
      - `@dependabot reopen` will reopen this PR if it is closed
      - `@dependabot close` will close this PR and stop Dependabot recreating
      it. You can achieve the same result by closing it manually
      - `@dependabot show <dependency name> ignore conditions` will show all
      of the ignore conditions of the specified dependency
      - `@dependabot ignore <dependency name> major version` will close this
      group update PR and stop Dependabot creating any more for the specific
      dependency's major version (unless you unignore this specific
      dependency's major version or upgrade to it yourself)
      - `@dependabot ignore <dependency name> minor version` will close this
      group update PR and stop Dependabot creating any more for the specific
      dependency's minor version (unless you unignore this specific
      dependency's minor version or upgrade to it yourself)
      - `@dependabot ignore <dependency name>` will close this group update PR
      and stop Dependabot creating any more for the specific dependency
      (unless you unignore this specific dependency or upgrade to it yourself)
      - `@dependabot unignore <dependency name>` will remove all of the ignore
      conditions of the specified dependency
      - `@dependabot unignore <dependency name> <ignore condition>` will
      remove the ignore condition of the specified dependency and ignore
      conditions
      
      
      </details>
      
      Signed-off-by: default avatardependabot[bot] <[email protected]>
      Co-authored-by: default avatardependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
      b79bf4fb
    • s0me0ne-unkn0wn's avatar
      Use dynamic aura slot duration in lookahead collator (#3211) · ec6bf5d0
      s0me0ne-unkn0wn authored
      It's a follow-up of #2949. It enables the lookahead collator to
      dynamically adjust the aura slot size, which may change during the
      runtime upgrade. It also addressed a couple of issues with time
      constants I missed in the original PR.
      
      Good news: it works. The parachain successfully switches from sync
      backing with 12s slots to async backing with 6s slots.
      
      Bad news: during the transitional period of a single block in which the
      actual runtime upgrade is performed, it still gets the old slot duration
      of 12s (as it gets it from the best block), resulting in a runtime panic
      (logs follow). That doesn't affect the following block production of the
      parachain. Ideas on how to improve the situation are appreciated.
      
      <details>
      
      ```
      2024-02-05 12:59:36.373  INFO tokio-runtime-worker sc_basic_authorship::basic_authorship: [Parachain] 🙌 Starting consensus session on top of parent 0x6fd2d8f904f12c22531bfabf77b16dc84a6a29e45d9ae358aa6547fbf3f0438b    
      2024-02-05 12:59:36.373 ERROR tokio-runtime-worker runtime: [Parachain] panicked at /home/s0me0ne/wrk/parity/polkadot-sdk/cumulus/pallets/aura-ext/src/consensus_hook.rs:69:9:
      assertion `left == right` failed: slot number mismatch
        left: Slot(142261198)
       right: Slot(284522396)    
      2024-02-05 12:59:36.373  WARN tokio-runtime-worker sp_state_machine::overlayed_changes::changeset: [Parachain] 1 storage transactions are left open by the runtime. Those will be rolled back.    
      2024-02-05 12:59:36.373  WARN tokio-runtime-worker sp_state_machine::overlayed_changes::changeset: [Parachain] 1 storage transactions are left open by the runtime. Those will be rolled back.    
      2024-02-05 12:59:36.373  WARN tokio-runtime-worker basic-authorship: [Parachain]  Inherent extrinsic returned unexpected error: Error at calling runtime api: Execution failed: Execution aborted due to trap: wasm trap: wasm `unreachable` instruction executed
      WASM backtrace:
      error while executing at wasm backtrace:
          0: 0x4e4a3b - <unknown>!rust_begin_unwind
          1: 0x46cf57 - <unknown>!core::panicking::panic_fmt::h3c280dba88683724
          2: 0x46d238 - <unknown>!core::panicking::assert_failed_inner::hebac5970933beb4d
          3: 0x3d00fc - <unknown>!core::panicking::assert_failed::h640a47e2fb5dfb4b
          4: 0xd0db3 - <unknown>!frame_support::storage::transactional::with_transaction::hcbc31515f81b2ee1
          5: 0x34d654 - <unknown>!<cumulus_pallet_parachain_system::pallet::Call<T> as frame_support::traits::dispatch::UnfilteredDispatchable>::dispatch_bypass_filter::{{closure}}::hb7c2c9a11fa88301
          6: 0x3547db - <unknown>!environmental::local_key::LocalKey<T>::with::h783f2605ae27d6d3
          7: 0x7f454 - <unknown>!<asset_hub_rococo_runtime::RuntimeCall as frame_support::traits::dispatch::UnfilteredDispatchable>::dispatch_bypass_filter::h5e11a01ab97c06c7
          8: 0x7f237 - <unknown>!<asset_hub_rococo_runtime::RuntimeCall as sp_runtime::traits::Dispatchable>::dispatch::h7f8ae4a8fede71ca
          9: 0x26a0f3 - <unknown>!frame_executive::Executive<System,Block,Context,UnsignedValidator,AllPalletsWithSystem,COnRuntimeUpgrade>::apply_extrinsic::h75e524ff34738391
         10: 0x282211 - <unknown>!BlockBuilder_apply_extrinsic. Dropping.    
      2024-02-05 12:59:36.374 ERROR tokio-runtime-worker runtime: [Parachain] panicked at /home/s0me0ne/wrk/parity/polkadot-sdk/substrate/frame/aura/src/lib.rs:416:9:
      assertion `left == right` failed: Timestamp slot must match `CurrentSlot`
        left: Slot(142261198)
       right: Slot(284522396)    
      2024-02-05 12:59:36.374  WARN tokio-runtime-worker sp_state_machine::overlayed_changes::changeset: [Parachain] 1 storage transactions are left open by the runtime. Those will be rolled back.    
      2024-02-05 12:59:36.374  WARN tokio-runtime-worker sp_state_machine::overlayed_changes::changeset: [Parachain] 1 storage transactions are left open by the runtime. Those will be rolled back.    
      2024-02-05 12:59:36.374  WARN tokio-runtime-worker basic-authorship: [Parachain] 
      
       Inherent extrinsic returned unexpected error: Error at calling runtime api: Execution failed: Execution aborted due to trap: wasm trap: wasm `unreachable` instruction executed
      WASM backtrace:
      error while executing at wasm backtrace:
          0: 0x4e4a3b - <unknown>!rust_begin_unwind
          1: 0x46cf57 - <unknown>!core::panicking::panic_fmt::h3c280dba88683724
          2: 0x46d238 - <unknown>!core::panicking::assert_failed_inner::hebac5970933beb4d
          3: 0x3d00fc - <unknown>!core::panicking::assert_failed::h640a47e2fb5dfb4b
          4: 0x9ece6 - <unknown>!frame_support::storage::transactional::with_transaction::h26f75cb9f9462088
          5: 0x356d7e - <unknown>!environmental::local_key::LocalKey<T>::with::hbcf2d4e17b48fdb5
          6: 0x7f507 - <unknown>!<asset_hub_rococo_runtime::RuntimeCall as frame_support::traits::dispatch::UnfilteredDispatchable>::dispatch_bypass_filter::h5e11a01ab97c06c7
          7: 0x7f237 - <unknown>!<asset_hub_rococo_runtime::RuntimeCall as sp_runtime::traits::Dispatchable>::dispatch::h7f8ae4a8fede71ca
          8: 0x26a0f3 - <unknown>!frame_executive::Executive<System,Block,Context,UnsignedValidator,AllPalletsWithSystem,COnRuntimeUpgrade>::apply_extrinsic::h75e524ff34738391
          9: 0x282211 - <unknown>!BlockBuilder_apply_extrinsic. Dropping.    
      2024-02-05 12:59:36.374 DEBUG tokio-runtime-worker runtime::xcmp-queue-migration: [Parachain] Lazy migration finished: item gone    
      2024-02-05 12:59:36.374 ERROR tokio-runtime-worker runtime: [Parachain] panicked at /home/s0me0ne/wrk/parity/polkadot-sdk/cumulus/pallets/parachain-system/src/lib.rs:265:18:
      set_validation_data inherent needs to be present in every block!    
      2024-02-05 12:59:36.374 ERROR tokio-runtime-worker aura::cumulus: [Parachain] err=Error { inner: Proposing
      
      Caused by:
          0: Error at calling runtime api: Execution failed: Execution aborted due to trap: wasm trap: wasm `unreachable` instruction executed
             WASM backtrace:
             error while executing at wasm backtrace:
                 0: 0x4e4a3b - <unknown>!rust_begin_unwind
                 1: 0x46cf57 - <unknown>!core::panicking::panic_fmt::h3c280dba88683724
                 2: 0x46da8b - <unknown>!core::option::expect_failed::hdf18d99c3adabca7
                 3: 0x2134cb - <unknown>!<cumulus_pallet_parachain_system::pallet::Pallet<T> as frame_support::traits::hooks::OnFinalize<<<<T as frame_system::pallet::Config>::Block as sp_runtime::traits::HeaderProvider>::HeaderT as sp_runtime::traits::Header>::Number>>::on_finalize::hf98aac39802896ba
                 4: 0x26a9d6 - <unknown>!frame_executive::Executive<System,Block,Context,UnsignedValidator,AllPalletsWithSystem,COnRuntimeUpgrade>::idle_and_finalize_hook::h32775c0df0749d92
                 5: 0x26ad9f - <unknown>!frame_executive::Executive<System,Block,Context,UnsignedValidator,AllPalletsWithSystem,COnRuntimeUpgrade>::finalize_block::h15e5a1a6b9ca8032
                 6: 0x2822bd - <unknown>!BlockBuilder_finalize_block
          1: Execution failed: Execution aborted due to trap: wasm trap: wasm `unreachable` instruction executed
             WASM backtrace:
             error while executing at wasm backtrace:
                 0: 0x4e4a3b - <unknown>!rust_begin_unwind
                 1: 0x46cf57 - <unknown>!core::panicking::panic_fmt::h3c280dba88683724
                 2: 0x46da8b - <unknown>!core::option::expect_failed::hdf18d99c3adabca7
                 3: 0x2134cb - <unknown>!<cumulus_pallet_parachain_system::pallet::Pallet<T> as frame_support::traits::hooks::OnFinalize<<<<T as frame_system::pallet::Config>::Block as sp_runtime::traits::HeaderProvider>::HeaderT as sp_runtime::traits::Header>::Number>>::on_finalize::hf98aac39802896ba
                 4: 0x26a9d6 - <unknown>!frame_executive::Executive<System,Block,Context,UnsignedValidator,AllPalletsWithSystem,COnRuntimeUpgrade>::idle_and_finalize_hook::h32775c0df0749d92
                 5: 0x26ad9f - <unknown>!frame_executive::Executive<System,Block,Context,UnsignedValidator,AllPalletsWithSystem,COnRuntimeUpgrade>::finalize_block::h15e5a1a6b9ca8032
                 6: 0x2822bd - <unknown>!BlockBuilder_finalize_block }
      ```
      
      </details>
      
      ---------
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      ec6bf5d0
    • Bastian Köcher's avatar
      Fix compilation on latest nightly because of `stdsimd` (#3296) · 349132f0
      Bastian Köcher authored
      We need to bump `ahash` to make it compile again.
      
      Closes: https://github.com/paritytech/polkadot-sdk/issues/3269
      349132f0
    • Alexander Samusev's avatar
      [ci] Fix gitspiegel trigger (#3297) · 4c96dca6
      Alexander Samusev authored
      PR removes `pull_request_target` from gitspiegel trigger because it
      breaks the logic. With `pull_request_target` the action runs in any case
      even for first-time contributors.
      
      cc @mutantcornholio
      4c96dca6
    • Bruno Galvao's avatar
      Use `TEST_WS` in all remote-externalities tests (#3284) · b2a62a56
      Bruno Galvao authored
      
      
      Refactor in accordance with
      https://github.com/paritytech/polkadot-sdk/issues/2245#issuecomment-1937025951
      
      Prior to this PR, the `remote_tests` test module would either use
      `TEST_WS` or `DEFAULT_HTTP_ENDPOINT`.
      
      With the PR, `TEST_WS` is the default for the `remote_tests` test module
      and the fallback is `DEFAULT_HTTP_ENDPOINT`.
      
      The only downside I see to this PR is that for particular tests in the
      `remote_tests` module, one would want to use a different http endpoint.
      If that is the case, they would have to manually hardcode the http
      endpoint for that particular test.
      
      Note: The `TEST_WS` node should fulfill the role for all test cases e.g.
      include child tries.
      
      Give it a _try_:
      ```
      TEST_WS=wss://rococo-try-runtime-node.parity-chains.parity.io:443 cargo test --features=remote-test -p frame-remote-externalities -- --nocapture
      ```
      
      ---------
      
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      b2a62a56
  4. Feb 12, 2024
    • Javier Viola's avatar
      Fix(zombienet): allow finality_lag be to be 1 or less and increase timeout (#3299) · 044d914c
      Javier Viola authored
      Change `parityDb` test assertions after a quick check with @alexggh in
      order to resolve failures in
      `zombienet-polkadot-misc-0001-parachains-paritydb`(e.g
      https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/5186277).
      Thx!
      044d914c
    • Radha's avatar
      AlreadyVoting Error - Remove ambiguity (#3280) · 396fffa5
      Radha authored
      This error suggests using either `unvote` or `reap_vote` calls which are
      unavailable in the pallet. The only available call for this is
      `remove_vote`.
      
      EDIT: Please ignore my earlier write-up. I was able to delegate with
      conviction after calling `remove_vote` on all decided proposals
      
      ---------
      
      Co-authored-by: command-bot <>
      396fffa5
    • Serban Iorga's avatar
      Add bridge zombienet test back to the CI (#3264) · e661dc0b
      Serban Iorga authored
      Related to https://github.com/paritytech/polkadot-sdk/issues/3176
      
      This PR only adds the first bridge zombienet test back to the CI after
      fixing it, reverting
      https://github.com/paritytech/polkadot-sdk/pull/3071
      
      Credits to @svyatonik for building all the CI infrastructure around
      this.
      e661dc0b
    • Alexandru Vasile's avatar
      rpc-v2/tx: Implement `transaction_unstable_broadcast` and `transaction_unstable_stop` (#3079) · bde0bbe5
      Alexandru Vasile authored
      
      
      This PR implements the
      [transaction_unstable_broadcast](https://github.com/paritytech/json-rpc-interface-spec/blob/main/src/api/transaction_unstable_broadcast.md)
      and
      [transaction_unstable_stop](https://github.com/paritytech/json-rpc-interface-spec/blob/main/src/api/transaction_unstable_stop.md).
      
      
      The
      [transaction_unstable_broadcast](https://github.com/paritytech/json-rpc-interface-spec/blob/main/src/api/transaction_unstable_broadcast.md)
      submits the provided transaction at the best block of the chain.
      If the transaction is dropped or declared invalid, the API tries to
      resubmit the transaction at the next available best block.
      
      ### Broadcasting 
      The broadcasting operation continues until either:
      
      - the user called `transaction_unstable_stop` with the operation ID that
      identifies the broadcasting operation
      - the transaction state is one of the following: 
        - Finalized: the transaction is part of the chain
      - FinalizedTimeout: we have waited for 256 finalized blocks and timedout
        - Usurped the transaction has been replaced in the tx pool
        
      The broadcasting retires to submit the transaction when the transaction
      state is:
      - Invalid: the transaction might become valid at a later time
      - Dropped: the transaction pool's capacity is full at the moment, but
      might clear when other transactions are finalized/dropped
      
      ### Stopping
      
      The `transaction_unstable_broadcast` spawns an abortable future and
      tracks the abort handler.
      When the
      [transaction_unstable_stop](https://github.com/paritytech/json-rpc-interface-spec/blob/main/src/api/transaction_unstable_stop.md)
      is called with a valid operation ID; the abort handler of the
      corresponding `transaction_unstable_broadcast` future is called. This
      behavior ensures the broadcast future is finishes on the next polling.
      When the `transaction_unstable_stop` is called with an invalid operation
      ID, an invalid jsonrpc specific error object is returned.
      
      
      ### Testing
      
      This PR adds the testing harness of the transaction API and validates
      two basic scenarios:
      - transaction enters and exits the transaction pool
      - transaction stop returns appropriate values when called with valid and
      invalid operation IDs
      
      
      Closes: https://github.com/paritytech/polkadot-sdk/issues/3039
      
      Note that the API should be enabled after:
      https://github.com/paritytech/polkadot-sdk/issues/3084.
      
      cc @paritytech/subxt-team
      
      ---------
      
      Signed-off-by: default avatarAlexandru Vasile <[email protected]>
      Co-authored-by: default avatarSebastian Kunert <[email protected]>
      bde0bbe5
    • Dónal Murray's avatar
      Bump coretime-rococo to get leases fix (#3289) · cecdf760
      Dónal Murray authored
      Leases can be force set, but since Leases is a StorageValue, if a lease
      misses its sale rotation in which it should expire, it can never be
      cleared.
      
      This can happen if a lease is added with an until timeslice that lies in
      a region whose sale has already started or has passed, even if the
      timeslice itself hasn't passed.
      
      Trappist is currently trapped in a lease that will never end, so this
      will remove it at the next sale rotation.
      
      A fix was introduced in
      https://github.com/paritytech/polkadot-sdk/pull/3213 but this missed the
      1.7 release. This PR bumps the `coretime-rococo` version to get these
      changes on Rococo.
      cecdf760
    • Oliver Tale-Yazdi's avatar
      Lift dependencies to the workspace (Part 1) (#2070) · e80c2473
      Oliver Tale-Yazdi authored
      Changes (partial https://github.com/paritytech/polkadot-sdk/issues/994):
      - Set log to `0.4.20` everywhere
      - Lift `log` to the workspace
      
      Starting with a simpler one after seeing
      https://github.com/paritytech/polkadot-sdk/pull/2065 from @jsdw
      
      .
      This sets the `default-features` to `false` in the root and then
      overwrites that in each create to its original value. This is necessary
      since otherwise the `default` features are additive and its impossible
      to disable them in the crate again once they are enabled in the
      workspace.
      
      I am using a tool to do this, so its mostly a test to see that it works
      as expected.
      
      ---------
      
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      e80c2473
    • Alexandru Gheorghe's avatar
      statement-distribution: Fix CostMinor("Unexpected Statement") (#3223) · 8362a681
      Alexandru Gheorghe authored
      
      
      On grid distribution messages have two paths of reaching a node, so
      there is the possiblity of a race when two peers send each other the
      same statement around the same time. Statement local_knowledge will tell
      us that the peer should have not send the statement because we sent it
      to it.
      
      Fix it by also keeping track only of the statement we received from a
      given peer and penalize it only if it sends it to us more than once.
      
      Fixes: https://github.com/paritytech/polkadot-sdk/issues/2346
      
      Additionally, also use different Cost labels for different paths to make
      it easier to debug things.
      
      ---------
      
      Signed-off-by: default avatarAlexandru Gheorghe <[email protected]>
      8362a681
    • Alexander Samusev's avatar
      [ci] Don't run prdoc and lables GHA on master (#3257) · c3489aaf
      Alexander Samusev authored
      PR adds condition to ignore master branch for prdoc and labels GHA.
      
      This option doesn't work because all PRs are for master thus the actions
      won't start:
      ```yml
      on:
        pull_request:
          branches-ignore:
            - master
      ```
      
      This option doesn't work because actions don't see the PR number and
      [break](https://github.com/paritytech/polkadot-sdk/actions/runs/7827272667/job/21354764953):
      ```yml
      on:
        push:
          branches-ignore:
            - master
      ```
      
      cc https://github.com/paritytech/ci_cd/issues/940
      cc https://github.com/paritytech/polkadot-sdk/issues/3240
      c3489aaf
    • Serban Iorga's avatar
      Bridge zombienet tests refactoring (#3260) · dfc8e469
      Serban Iorga authored
      Related to https://github.com/paritytech/polkadot-sdk/issues/3242
      
      Reorganizing the bridge zombienet tests in order to:
      - separate the environment spawning from the actual tests
      - offer better control over the tests and some possibility to
      orchestrate them as opposed to running everything from the zndsl file
      
      Only rewrote the asset transfer test using this new "framework". The old
      logic and old tests weren't functionally modified or deleted. The plan
      is to get feedback on this approach first and if this is agreed upon,
      migrate the other 2 tests later in separate PRs and also do other
      improvements later.
      dfc8e469
    • Alexandru Vasile's avatar
      transaction-pool: Improve transaction status documentation and add helpers (#3215) · 4f13d5b7
      Alexandru Vasile authored
      
      
      This PR improves the transaction status documentation.
      - Added doc references for describing the main states
      - Extra comment wrt pool ready / future queues
      - `FinalityTimeout` no longer describes a lagging finality gadget, it
      signals that the maximum number of finality gadgets has been reached
      
      A few helper methods are added to indicate when:
      - a final event is generated by the transaction pool for a given event
      - a final event is provided, although the transaction might become valid
      at a later time and could be re-submitted
      
      The helper methods are used and taken from
      https://github.com/paritytech/polkadot-sdk/pull/3079 to help us better
      keep it in sync.
      
      
      cc @paritytech/subxt-team
      
      ---------
      
      Signed-off-by: default avatarAlexandru Vasile <[email protected]>
      4f13d5b7
    • Andrei Eres's avatar
      subsystem-bench: polish imports (#3262) · cbd68467
      Andrei Eres authored
      cbd68467
  5. Feb 11, 2024
    • maksimryndin's avatar
      refactor pvf security module (#3047) · 4883e144
      maksimryndin authored
      
      
      resolve https://github.com/paritytech/polkadot-sdk/issues/2321
      
      - [x] refactor `security` module into a conditionally compiled
      - [x] rename `amd64` into x86-64 for consistency with conditional
      compilation guards and remove reference to a particular vendor
      - [x] run unit tests and zombienet
      
      ---------
      
      Co-authored-by: default avatars0me0ne-unkn0wn <[email protected]>
      4883e144
  6. Feb 09, 2024
    • Eugen Snitko's avatar
      Add forklift to remaining jobs (#3236) · edd95b37
      Eugen Snitko authored
      Add [forklift
      caching](https://gitlab.parity.io/parity/infrastructure/ci_cd/forklift/forklift)
      to remainig jobs
      
      by .sh and .py scripts:
      - cargo-check-each-crate x6 (`.gitlab/check-each-crate.py`)
      - build-linux-stable (`polkadot/scripts/build-only-wasm.sh`)
      
      by before_script:
      - build-linux-substrate
      - build-subkey-linux (with `.build-subkey` job)
      - cargo-check-benches x2
      
      **To disable feature set FORKLIFT_BYPASS variable to true in [project
      settings in
      gitlab](https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/settings/ci_cd)**
      (forklift now handles FORKLIFT_BYPASS by itself)
      edd95b37
    • Egor_P's avatar
      [Backport] Version bumps from 1.7.0 release (#3254) · b2c81b58
      Egor_P authored
      This PR backports version bumps from `1.7.0` release branch and moves
      related prdoc files to the appropriate folder.
      b2c81b58
  7. Feb 08, 2024
    • Oliver Tale-Yazdi's avatar
      [FRAME] Parameters pallet (#2061) · e53ebd8c
      Oliver Tale-Yazdi authored
      
      
      Closes #169  
      
      Fork of the `orml-parameters-pallet` as introduced by
      https://github.com/open-web3-stack/open-runtime-module-library/pull/927
      (cc @xlc)
      It greatly changes how the macros work, but keeps the pallet the same.
      The downside of my code is now that it does only support constant keys
      in the form of types, not value-bearing keys.
      I think this is an acceptable trade off, give that it can be used by
      *any* pallet without any changes.
      
      The pallet allows to dynamically set parameters that can be used in
      pallet configs while also restricting the updating on a per-key basis.
      The rust-docs contains a complete example.
      
      Changes:
      - Add `parameters-pallet`
      - Use in the kitchensink as demonstration
      - Add experimental attribute to define dynamic params in the runtime.
      - Adding a bunch of traits to `frame_support::traits::dynamic_params`
      that can be re-used by the ORML macros
      
      ## Example
      
      First to define the parameters in the runtime file. The syntax is very
      explicit about the codec index and errors if there is no.
      ```rust
      #[dynamic_params(RuntimeParameters, pallet_parameters::Parameters::<Runtime>))]
      pub mod dynamic_params {
      	use super::*;
      
      	#[dynamic_pallet_params]
      	#[codec(index = 0)]
      	pub mod storage {
      		/// Configures the base deposit of storing some data.
      		#[codec(index = 0)]
      		pub static BaseDeposit: Balance = 1 * DOLLARS;
      
      		/// Configures the per-byte deposit of storing some data.
      		#[codec(index = 1)]
      		pub static ByteDeposit: Balance = 1 * CENTS;
      	}
      
      	#[dynamic_pallet_params]
      	#[codec(index = 1)]
      	pub mod contracts {
      		#[codec(index = 0)]
      		pub static DepositPerItem: Balance = deposit(1, 0);
      
      		#[codec(index = 1)]
      		pub static DepositPerByte: Balance = deposit(0, 1);
      	}
      }
      ```
      
      Then the pallet is configured with the aggregate:  
      ```rust
      impl pallet_parameters::Config for Runtime {
      	type AggregratedKeyValue = RuntimeParameters;
      	type AdminOrigin = EnsureRootWithSuccess<AccountId, ConstBool<true>>;
      	...
      }
      ```
      
      And then the parameters can be used in a pallet config:
      ```rust
      impl pallet_preimage::Config for Runtime {
      	type DepositBase = dynamic_params::storage::DepositBase;
      }
      ```
      
      A custom origin an be defined like this:  
      ```rust
      pub struct DynamicParametersManagerOrigin;
      
      impl EnsureOriginWithArg<RuntimeOrigin, RuntimeParametersKey> for DynamicParametersManagerOrigin {
      	type Success = ();
      
      	fn try_origin(
      		origin: RuntimeOrigin,
      		key: &RuntimeParametersKey,
      	) -> Result<Self::Success, RuntimeOrigin> {
      		match key {
      			RuntimeParametersKey::Storage(_) => {
      				frame_system::ensure_root(origin.clone()).map_err(|_| origin)?;
      				return Ok(())
      			},
      			RuntimeParametersKey::Contract(_) => {
      				frame_system::ensure_root(origin.clone()).map_err(|_| origin)?;
      				return Ok(())
      			},
      		}
      	}
      
      	#[cfg(feature = "runtime-benchmarks")]
      	fn try_successful_origin(_key: &RuntimeParametersKey) -> Result<RuntimeOrigin, ()> {
      		Ok(RuntimeOrigin::Root)
      	}
      }
      ```
      
      ---------
      
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      Co-authored-by: default avatarNikhil Gupta <[email protected]>
      Co-authored-by: default avatarKian Paimani <[email protected]>
      Co-authored-by: command-bot <>
      e53ebd8c
    • Gonçalo Pestana's avatar
      Fixes `TotalValueLocked` out of sync in nomination pools (#3052) · aac07af0
      Gonçalo Pestana authored
      The `TotalLockedValue` storage value in nomination pools pallet may get
      out of sync if the staking pallet does implicit withdrawal of unlocking
      chunks belonging to a bonded pool stash. This fix is based on a new
      method in the `OnStakingUpdate` traits, `on_withdraw`, which allows the
      nomination pools pallet to adjust the `TotalLockedValue` every time
      there is an implicit or explicit withdrawal from a bonded pool's stash.
      
      This PR also adds a migration that checks and updates the on-chain TVL
      if it got out of sync due to the bug this PR fixes.
      
      **Changes to `trait OnStakingUpdate`**
      
      In order for staking to notify the nomination pools pallet that chunks
      where withdrew, we add a new method, `on_withdraw` to the
      `OnStakingUpdate` trait. The nomination pools pallet filters the
      withdraws that are related to bonded pool accounts and updates the
      `TotalValueLocked` accordingly.
      
      **Others**
      - Adds try-state checks to the EPM/staking e2e tests
      - Adds tests for auto withdrawing in the context of nomination pools
      
      **To-do**
      - [x] check if we need a migration to fix the current `TotalValueLocked`
      (run try-runtime)
      - [x] migrations to fix the current on-chain TVL value 
      
        **Kusama**:
      ```
      TotalValueLocked: 99.4559 kKSM
      TotalValueLocked (calculated) 99.4559 kKSM
      ```
      
      
      ️ **Westend**:
      ```
      TotalValueLocked: 18.4060 kWND
      TotalValueLocked (calculated) 18.4050 kWND
      ```
      **Polkadot**: TVL not released yet.
      
      Closes https://github.com/paritytech/polkadot-sdk/issues/3055
      
      ---------
      
      Co-authored-by: command-bot <>
      Co-authored-by: default avatarRoss Bulat <[email protected]>
      Co-authored-by: default avatarDónal Murray <[email protected]>
      aac07af0
    • Oliver Tale-Yazdi's avatar
      `bench pallet`: only require `Hash` instead of `Block` (#3244) · c36c51ca
      Oliver Tale-Yazdi authored
      
      
      Preparation for https://github.com/paritytech/polkadot-sdk/issues/2664
      
      Changes:
      - Only require `Hash` instead of `Block` for the benchmarking
      - Refactor DB types to do the same
      
      ## Integration
      
      This breaking change can easily be integrated into your node via:  
      ```patch
      - cmd.run::<Block, ()>(config)
      + cmd.run::<HashingFor<Block>, ()>(config)
      ```
      
      Status: waiting for CI checks
      
      ---------
      
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      Co-authored-by: default avatarcheme <[email protected]>
      c36c51ca
    • Radha's avatar
      a2e6256c
    • drskalman's avatar
      Make BEEFY client keystore generic over BEEFY `AuthorityId` type (#2258) · 0a94124d
      drskalman authored
      
      
      This is the significant step to make BEEFY client able to handle both
      ECDSA and (ECDSA, BLS) type signature. The idea is having BEEFY Client
      generic on crypto types makes migration to new types smoother.
      
      This makes the BEEFY Keystore generic over AuthorityId and extends its
      tests to cover the case when the AuthorityId is of type (ECDSA,
      BLS12-377)
      
      ---------
      
      Co-authored-by: default avatarDavide Galassi <[email protected]>
      Co-authored-by: default avatarRobert Hambrock <[email protected]>
      0a94124d
    • PG Herveou's avatar
      Contracts update doc.rs metadata (#3241) · bc5a758c
      PG Herveou authored
      
      
      Adding Rust metadata for doc
      see https://docs.rs/about/metadata
      
      ---------
      
      Co-authored-by: default avatarAlexander Theißen <[email protected]>
      bc5a758c
    • Alexander Theißen's avatar
      contracts: Remove no longer enforced limits from the `Schedule` (#3184) · d54412ce
      Alexander Theißen authored
      When switching from the instrumented gas metering to the wasmi gas
      metering we also removed all imposed limits regarding Wasm module
      internals. All those things do not interact with the host and have to be
      handled by wasmi. For example, Wasmi charges additional gas for
      parameters to each function because as they incur some overhead.
      
      Back then we took the opportunity to remove the dependency on the
      deprecated `parity-wasm` which was used to enforce those limits.
      
      This PR merely removes them from the `Schedule` they aren't enforced for
      a while.
      d54412ce