Skip to content
  1. Apr 02, 2024
    • Serban Iorga's avatar
      Align dependencies with `parity-bridges-common` (#3937) · 8e95a3e1
      Serban Iorga authored
      Working towards migrating the `parity-bridges-common` repo inside
      `polkadot-sdk`. This PR upgrades some dependencies in order to align
      them with the versions used in `parity-bridges-common`
      
      Related to
      https://github.com/paritytech/parity-bridges-common/issues/2538
      8e95a3e1
    • Alexandru Vasile's avatar
      chainHead: Allow methods to be called from within a single connection context... · 7430f413
      Alexandru Vasile authored
      
      chainHead: Allow methods to be called from within a single connection context and limit connections (#3481)
      
      This PR ensures that the chainHead RPC class can be called only from
      within the same connection context.
      
      The chainHead methods are now registered as raw methods. 
      - https://github.com/paritytech/jsonrpsee/pull/1297
      The concept of raw methods is introduced in jsonrpsee, which is an async
      method that exposes the connection ID:
      The raw method doesn't have the concept of a blocking method. Previously
      blocking methods are now spawning a blocking task to handle their
      blocking (ie DB) access. We spawn the same number of tasks as before,
      however we do that explicitly.
      
      Another approach would be implementing a RPC middleware that captures
      and decodes the method parameters:
      - https://github.com/paritytech/polkadot-sdk/pull/3343
      However, that approach is prone to errors since the methods are
      hardcoded by name. Performace is affected by the double deserialization
      that needs to happen to extract the subscription ID we'd like to limit.
      Once from the middleware, and once from the methods itself.
      
      This PR paves the way to implement the chainHead connection limiter:
      - https://github.com/paritytech/polkadot-sdk/issues/1505
      Registering tokens (subscription ID / operation ID) on the
      `RpcConnections` could be extended to return an error when the maximum
      number of operations is reached.
      
      While at it, have added an integration-test to ensure that chainHead
      methods can be called from within the same connection context.
      
      Before this is merged, a new JsonRPC release should be made to expose
      the `raw-methods`:
      - [x] Use jsonrpsee from crates io (blocked by:
      https://github.com/paritytech/jsonrpsee/pull/1297)
      
      Closes: https://github.com/paritytech/polkadot-sdk/issues/3207
      
      
      cc @paritytech/subxt-team
      
      ---------
      
      Signed-off-by: default avatarAlexandru Vasile <[email protected]>
      Co-authored-by: default avatarNiklas Adolfsson <[email protected]>
      7430f413
    • Adrian Catangiu's avatar
      beefy: error logs for validators with dummy keys (#3939) · 5eff3f94
      Adrian Catangiu authored
      
      
      This outputs:
      ```
      2024-04-02 14:36:02.135 ERROR tokio-runtime-worker beefy: 🥩 for session starting at block 21990151
      no BEEFY authority key found in store, you must generate valid session keys
      (https://wiki.polkadot.network/docs/maintain-guides-how-to-validate-polkadot#generating-the-session-keys)
      ```
      error log entry, once every session, for nodes running with
      `Role::Authority` that have no public BEEFY key in their keystore
      
      ---------
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      5eff3f94
    • Serban Iorga's avatar
      Update bridges subtree (#3938) · d5617cf3
      Serban Iorga authored
      Pulling the latest changes from `parity-bridges-common`
      d5617cf3
    • Javier Viola's avatar
      chore(zombienet): bump version (#3933) · db1af43c
      Javier Viola authored
      This version includes:
      
      - Internal metrics of zombienet (used to benchmark with v2).
      db1af43c
    • Bastian Köcher's avatar
      Fix parachain upgrade scheduling when done by the owner/root (#3341) · 12eb285d
      Bastian Köcher authored
      When using `schedule_code_upgrade` to change the code of a parachain in
      the relay chain runtime, we had already fixed to not set the `GoAhead`
      signal. This was done to not brick any parachain after the upgrade,
      because they were seeing the signal without having any upgrade prepared.
      The remaining problem is that the parachain code is only upgraded after
      a parachain header was enacted, aka the parachain made some progress.
      However, this is quite complicated if the parachain is bricked (which is
      the most common scenario why to manually schedule a code upgrade). Thus,
      this pull request replaces `SetGoAhead` with `UpgradeStrategy` to signal
      to the logic kind of strategy want to use. The strategies are either
      `SetGoAheadSignal` or `ApplyAtExpectedBlock`. `SetGoAheadSignal` sets
      the go ahead signal as before and awaits a parachain block.
      `ApplyAtExpectedBlock` schedules the upgrade and applies it directly at
      the `expected_block` without waiting for the parachain to make any kind
      of progress.
      12eb285d
    • Adrian Catangiu's avatar
      pallet-xcm: fix weights for all XTs and deprecate unlimited weight ones (#3927) · d0ebb850
      Adrian Catangiu authored
      
      
      Fix "double-weights" for extrinsics, use only the ones benchmarked in
      the runtime.
      
      Deprecate extrinsics that don't specify WeightLimit, remove their usage
      across the repo.
      
      ---------
      
      Signed-off-by: default avatarAdrian Catangiu <[email protected]>
      Co-authored-by: command-bot <>
      d0ebb850
    • Sam Johnson's avatar
      Update derive syn parse 0.2.0 (+ docify) (#3920) · 9a62de27
      Sam Johnson authored
      
      
      derive-syn-parse v0.2.0 came out recently which (finally) adds support
      for syn 2x.
      
      Upgrading to this will remove many of the places where syn 1x was still
      compiling alongside syn 2x in the polkadot-sdk workspace.
      
      This also upgrades `docify` to 0.2.8 which is the version that upgrades
      derive-syn-pasre to 0.2.0.
      
      Additionally, this consolidates the `docify` versions in the repo to all
      use the latest, and in one case upgrades to the 0.2x syntax where 0.1.x
      was still being used.
      
      ---------
      
      Co-authored-by: default avatarLiam Aharon <[email protected]>
      9a62de27
  2. Apr 01, 2024
    • s0me0ne-unkn0wn's avatar
      `im-online` removal final cleanup (#3902) · 52e10378
      s0me0ne-unkn0wn authored
      Rejoice! Rejoice! The story is nearly over.
      
      This PR removes stale migrations, auxiliary structures, and package
      dependencies, thus making Rococo and Westend totally free from any
      `im-online`-related stuff.
      
      `im-online` still stays a part of the Substrate node and its runtime:
      https://github.com/paritytech/polkadot-sdk/blob/0d932484/substrate/bin/node/runtime/src/lib.rs#L2276-L2277
      I'm not sure if it makes sense to remove it from there considering that
      we're not removing `im-online` from FRAME. Please share your opinion.
      52e10378
    • Andrei Sandu's avatar
      pallet-scheduler: fix test (#3923) · bf1ca86f
      Andrei Sandu authored
      
      
      fix https://github.com/paritytech/polkadot-sdk/issues/3921
      
      ---------
      
      Signed-off-by: default avatarAndrei Sandu <[email protected]>
      bf1ca86f
    • Serban Iorga's avatar
      Fix links (#3928) · 9805ba2c
      Serban Iorga authored
      Fix links
      
      Related CI failure:
      https://github.com/paritytech/polkadot-sdk/actions/runs/8455425042/job/23162858534?pr=3859
      9805ba2c
    • Alexandru Gheorghe's avatar
      primitives: Move out of staging released APIs (#3925) · d6f68bb9
      Alexandru Gheorghe authored
      
      
      Runtime release 1.2 includes bumping of the ParachainHost APIs up to
      v10, so let's move all the released APIs out of vstaging folder, this PR
      does not include any logic changes only renaming of the modules and some
      moving around.
      
      Signed-off-by: default avatarAlexandru Gheorghe <[email protected]>
      d6f68bb9
    • Alexandru Gheorghe's avatar
      Fix 0007-dispute-freshly-finalized.zndsl failing (#3893) · e6bd9205
      Alexandru Gheorghe authored
      Test started failing after
      https://github.com/paritytech/polkadot-sdk/commit/66051adb
      
      
      which enabled approval coalescing, that was expected to happen because
      the test required an polkadot_parachain_approval_checking_finality_lag
      of 0, which can't happen with max_approval_coalesce_count greater than 1
      because we always delay the approval for no_show_duration_ticks/2 in
      case we can coalesce it with other approvals.
      
      
      So relax a bit the restrictions, since we don't actually care that the
      lags are 0, but the fact the finalities are progressing and are not
      stuck.
      
      Signed-off-by: default avatarAlexandru Gheorghe <[email protected]>
      e6bd9205
    • Ross Bulat's avatar
      Pools: Make `PermissionlessWithdraw` the default claim permission (#3438) · b772cb57
      Ross Bulat authored
      Related Issue https://github.com/paritytech/polkadot-sdk/issues/3398
      
      This PR makes permissionless withdrawing the default option, giving any
      network participant access to claim pool rewards on member's behalf. Of
      course, members can still opt out of this by setting a `Permissioned`
      claim permission.
      
      Permissionless claiming has been a part of the nomination pool pallet
      for around 9 months now, with very limited uptake (~4% of total pool
      members). 1.6% of pool members are using `PermissionlessAll`, strongly
      suggesting it is not wanted - it is too ambiguous and doesn't provide
      guidance to claimers.
      
      Stakers expect rewards to be claimed on their behalf by default - I have
      expanded upon this in detail within the [accompanying issue's
      discussion](https://github.com/paritytech/polkadot-sdk/issues/3398).
      Other protocols have this behaviour, whereby staking rewards are
      received without the staker having to take any action. From this
      perspective, permissionless claiming is not intuitive for pool members.
      As evidence of this, over 150,000 DOT is currently unclaimed on
      Polkadot, and is growing at a non-linear rate.
      b772cb57
    • Andrei Sandu's avatar
      Improve `HostConfiguration` consistency check (#3897) · 07720dd1
      Andrei Sandu authored
      
      
      fixes https://github.com/paritytech/polkadot-sdk/issues/3886
      
      ---------
      
      Signed-off-by: default avatarAndrei Sandu <[email protected]>
      07720dd1
    • Alessandro Siniscalchi's avatar
      [parachain-template] pallet configurations into `mod configs` (#3809) · 8d305343
      Alessandro Siniscalchi authored
      
      
      This PR introduces a refactor of the parachain runtime configuration by
      consolidating all pallet configurations into a new module named
      `configs`. This change aims to improve the readability and
      maintainability of the runtime configuration by centralizing all
      configuration parameters.
      
      ## Changes
      - **Creation of `configs.rs`**: A new file `configs.rs` has been added
      under `templates/parachain/runtime/src/`, containing all the runtime
      configurations previously scattered across `lib.rs`.
      - **Refactoring of `lib.rs`**: The `lib.rs` file has been significantly
      slimmed down by removing the inline pallet configurations and importing
      them from `configs.rs` instead.
      - **Optimization of Import Statements**: Reorganized import statements
      to clarify the runtime's dependency structure.
      
      ### Benefits
      - **Improved Readability**: With configurations being centralized,
      developers can now easily locate and review runtime parameters without
      navigating through the `lib.rs` file.
      
      This refactor does not introduce any changes to the runtime logic but
      improves the project structure for better development experience.
      
      ---------
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      8d305343
    • Alexandru Gheorghe's avatar
      network:bridge: fix peer_count metric (#3711) · e0c081db
      Alexandru Gheorghe authored
      
      
      The metric records the current protocol_version of the validator that
      just connected with the peer_map.len(), which contains all peers that
      connected, that has the effect the metric will be wrong since it won't
      tell us how many peers we have connected per version because it will
      always record the total number of peers
      
      Fix this by counting by version inside peer_map, additionally because
      that might be a bit heavier than len(), publish it only on-active
      leaves.
      
      ---------
      
      Signed-off-by: default avatarAlexandru Gheorghe <[email protected]>
      e0c081db
    • Matteo Muraca's avatar
      Removed `pallet::getter` usage from `pallet-alliance` (#3738) · a2c9ab8c
      Matteo Muraca authored
      Part of #3326 
      
      cc @Kianenigma @ggwpez @liamaharon
      
       
      
      polkadot address: 12poSUQPtcF1HUPQGY3zZu2P8emuW9YnsPduA4XG3oCEfJVp
      
      ---------
      
      Signed-off-by: default avatarMatteo Muraca <[email protected]>
      Co-authored-by: default avatarLiam Aharon <[email protected]>
      Co-authored-by: default avatarKian Paimani <[email protected]>
      a2c9ab8c
  3. Mar 31, 2024
  4. Mar 29, 2024
  5. Mar 28, 2024
    • Alexander Samusev's avatar
      [ci] fix subsystem-benchmarks gha (#3876) · eb6f5abe
      Alexander Samusev authored
      PR adds variables validation and app credentials for pushing into
      gh-pages
      
      cc https://github.com/paritytech/ci_cd/issues/934
      eb6f5abe
    • tugy's avatar
      add missing syscalls for workers (#2212) · c106dbd0
      tugy authored
      
      
      # Description
      
      Since the binary split additional syscalls are getting blocked in
      relation to the workers.
      
      With the hardened systemd file it shows the following warning:
      
      ```
      Cannot fully enable landlock, a Linux kernel security feature. Running validation of malicious PVF code has a higher risk of compromising this machine. Consider upgrading the kernel version for maximum security. status=Ok(NotEnforced) abi=1
      ```
      
      For it to work we need to allow additionally:
      - mount
      - umount2
      - pivot_root
      
      and set `RestrictNamespaces=false`
      
      Added new line `SystemCallFilter=pivot_root` because otherwise it would
      get blocked by ~\@\privileged
      
      Co-authored-by: default avatars0me0ne-unkn0wn <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      c106dbd0
    • Alin Dima's avatar
    • dharjeezy's avatar
      Try State Hook for Beefy (#3246) · 79b08d88
      dharjeezy authored
      Part of: https://github.com/paritytech/polkadot-sdk/issues/239
      
      Polkadot address: 12GyGD3QhT4i2JJpNzvMf96sxxBLWymz4RdGCxRH5Rj5agKW
      79b08d88
    • Sebastian Kunert's avatar
      Export unified ParachainHostFunctions (#3854) · 2e4e6571
      Sebastian Kunert authored
      
      
      This PR exports unified hostfunctions needed for parachains. Basicaly
      `SubstrateHostFunctions` + `storage_proof_size::HostFunctions`.
      
      Also removes the native executor from the parachain template.
      
      ---------
      
      Co-authored-by: default avatarMichal Kucharczyk <[email protected]>
      2e4e6571
    • Rodrigo Quelhas's avatar
      Update benchmarking README.md (#3862) · 987f1c24
      Rodrigo Quelhas authored
      
      
      Fix reference links
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      987f1c24
    • PG Herveou's avatar
      Contracts: add test builders (#3796) · 78b1cab9
      PG Herveou authored
      Cleanup tests (-2.7k lines !) using some builder patterns to build
      pallet_contracts api calls
      78b1cab9
    • Alessandro Siniscalchi's avatar
      [parachain-template] runtime API Implementations into `mod apis` (#3817) · 60846a08
      Alessandro Siniscalchi authored
      This PR significantly refactors the runtime API implementations to
      improve project structure, maintainability, and readability. Key changes
      include:
      
      1. **Enhancing Visibility**: Adjusts the visibility of
      `RUNTIME_API_VERSIONS` in `impl_runtime_apis.rs` to `pub`, making it
      accessible throughout the runtime module.
      2. **Centralizing API Implementations**: Introduces a new file,
      `apis.rs`, within the parachain template's runtime directory.
      3. **Streamlining `lib.rs`**: Updates the main runtime library file to
      reflect these structural changes. It removes redundant API
      implementations and points `VERSION` to the newly exposed
      `RUNTIME_API_VERSIONS` from `apis.rs`, simplifying the overall runtime
      configuration.
      
      ### Motivations Behind the Refactoring:
      - **Improved Project Structure**: Centralizing API implementations in
      `apis.rs` offers a clearer, more navigable project structure.
      - **Better Readability**: Streamlining `lib.rs` and reducing clutter
      enhance readability, making it easier for new contributors to understand
      the project layout and logic.
      
      ### Summary of Changes:
      - Made `RUNTIME_API_VERSIONS` public in `impl_runtime_apis.rs`.
      - Added `apis.rs` to centralize runtime API implementations.
      - Streamlined `lib.rs` to adjust to the refactored project structure.
      60846a08
    • Liam Aharon's avatar
      [prdoc] Require SemVer bump level (#3816) · 1ed44af3
      Liam Aharon authored
      A prerequisite for adding a stable branch and respecting SemVer on new
      stable releases is including SemVer bump levels in our PRDocs.
      
      Next release is scheduled for April 3rd, so it would be great to get
      this merged before then.
      
      Also added "None" as a valid bump option, to support test/benchmark
      changes and CI to ensure changed crates have an entry.
      1ed44af3
    • Tin Chung's avatar
      Deprecate scheduler traits v1 and v2 (#3718) · daf04f01
      Tin Chung authored
      
      
      This PR add `#[deprecated]` attribute to v1 and v2 of the schedule
      trait. Proposed in this issue:
      https://github.com/paritytech/polkadot-sdk/issues/3676
      
      ```rust
      #[allow(deprecated)]
      #[deprecated = "traits::schedule::v1 is deprecated. Please use v3 instead."]
      pub mod v1 {
      ...
      }
      
      #[allow(deprecated)]
      #[deprecated = "traits::schedule::v2 is deprecated. Please use v3 instead."]
      pub mod v2 {
      ...
      }
      ```
      
      polkadot address: 19nSqFQorfF2HxD3oBzWM3oCh4SaCRKWt1yvmgaPYGCo71J
      
      ---------
      
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      Co-authored-by: default avatarLiam Aharon <[email protected]>
      daf04f01
  6. Mar 27, 2024
    • Bastian Köcher's avatar
      pallet-referenda: Detect incorrect pre-image length (#3850) · 5d314eb0
      Bastian Köcher authored
      There has been a case that a referenda failed because the length given
      to `submit` was incorrect. The pallet can actually check the length if
      the pre-image already exists to ensure that these kind of issues are not
      happening again.
      5d314eb0
    • Bastian Köcher's avatar
      pallet-scheduler: Unrequest call on failed lookup (#3849) · 597ea920
      Bastian Köcher authored
      When the scheduler fails to lookup a `call`, it should unrequest it,
      because it will not be required anymore.
      597ea920
    • Gonçalo Pestana's avatar
      Extrinsic to restore corrupt staking ledgers (#3706) · bbdbeb7e
      Gonçalo Pestana authored
      This PR adds a new extrinsic `Call::restore_ledger ` gated by
      `StakingAdmin` origin that restores a corrupted staking ledger. This
      extrinsic will be used to recover ledgers that were affected by the
      issue discussed in
      https://github.com/paritytech/polkadot-sdk/issues/3245.
      
      The extrinsic will re-write the storage items associated with a stash
      account provided as input parameter. The data used to reset the ledger
      can be either i) fetched on-chain or ii) partially/totally set by the
      input parameters of the call.
      
      In order to use on-chain data to restore the staking locks, we need a
      way to read the current lock in the balances pallet. This PR adds a
      `InspectLockableCurrency` trait and implements it in the pallet
      balances. An alternative would be to tightly couple staking with the
      pallet balances but that's inelegant (an example of how it would look
      like in [this
      branch](https://github.com/paritytech/polkadot-sdk/tree/gpestana/ledger-badstate-clean_tightly)).
      
      More details on the type of corruptions and corresponding fixes
      https://hackmd.io/DLb5jEYWSmmvqXC9ae4yRg?view#/
      
      We verified that the `Call::restore_ledger` does fix all current
      corrupted ledgers in Polkadot and Kusama. You can verify it here
      https://hackmd.io/v-XNrEoGRpe7APR-EZGhOA.
      
      **Changes introduced**
      - Adds `Call::restore_ledger ` extrinsic to recover a corrupted ledger;
      - Adds trait `frame_support::traits::currency::InspectLockableCurrency`
      to allow external pallets to read current locks given an account and
      lock ID;
      - Implements the `InspectLockableCurrency` in the pallet-balances.
      - Adds staking locks try-runtime checks
      (https://github.com/paritytech/polkadot-sdk/issues/3751)
      
      **Todo**
      - [x] benchmark `Call::restore_ledger`
      - [x] throughout testing of all ledger recovering cases
      - [x] consider adding the staking locks try-runtime checks to this PR
      (https://github.com/paritytech/polkadot-sdk/issues/3751)
      - [x] simulate restoring all ledgers
      (https://hackmd.io/Dsa2tvhISNSs7zcqriTaxQ?view) in Polkadot and Kusama
      using chopsticks -- https://hackmd.io/v-XNrEoGRpe7APR-EZGhOA
      
      Related to https://github.com/paritytech/polkadot-sdk/issues/3245
      Closes https://github.com/paritytech/polkadot-sdk/issues/3751
      
      ---------
      
      Co-authored-by: command-bot <>
      bbdbeb7e
    • Alexander Samusev's avatar
      [ci] Fix publish benchmarks job (#3864) · 374aefa4
      Alexander Samusev authored
      Few fixes in CI to publish benchmarks jobs.
      
      cc https://github.com/paritytech/ci_cd/issues/934
      374aefa4
    • Ermal Kaleci's avatar
      process enqueued messages on idle (#3844) · 8342947b
      Ermal Kaleci authored
      
      
      This will make it possible to use remaining weight on idle for
      processing enqueued messages.
      More context here https://github.com/paritytech/polkadot-sdk/issues/3709
      
      ---------
      
      Co-authored-by: default avatarAdrian Catangiu <[email protected]>
      8342947b