Skip to content
  1. Oct 18, 2023
    • Keith Yeung's avatar
      Introduce XcmFeesToAccount fee manager (#1234) · 3dece311
      Keith Yeung authored
      
      
      Combination of paritytech/polkadot#7005, its addon PR
      paritytech/polkadot#7585 and its companion paritytech/cumulus#2433.
      
      This PR introduces a new XcmFeesToAccount struct which implements the
      `FeeManager` trait, and assigns this struct as the `FeeManager` in the
      XCM config for all runtimes.
      
      The struct simply deposits all fees handled by the XCM executor to a
      specified account. In all runtimes, the specified account is configured
      as the treasury account.
      
      XCM __delivery__ fees are now being introduced (unless the root origin
      is sending a message to a system parachain on behalf of the originating
      chain).
      
      # Note for reviewers
      
      Most file changes are tests that had to be modified to account for the
      new fees.
      Main changes are in:
      - cumulus/pallets/xcmp-queue/src/lib.rs <- To make it track the delivery
      fees exponential factor
      - polkadot/xcm/xcm-builder/src/fee_handling.rs <- Added. Has the
      FeeManager implementation
      - All runtime xcm_config files <- To add the FeeManager to the XCM
      configuration
      
      # Important note
      
      After this change, instructions that create and send a new XCM (Query*,
      Report*, ExportMessage, InitiateReserveWithdraw, InitiateTeleport,
      DepositReserveAsset, TransferReserveAsset, LockAsset and RequestUnlock)
      will require the corresponding origin account in the origin register to
      pay for transport delivery fees, and the onward message will fail to be
      sent if the origin account does not have the required amount. This
      delivery fee is on top of what we already collect as tx fees in
      pallet-xcm and XCM BuyExecution fees!
      
      Wallet UIs that want to expose the new delivery fee can do so using the
      formula:
      
      ```
      delivery_fee_factor * (base_fee + encoded_msg_len * per_byte_fee)
      ```
      
      where the delivery fee factor can be obtained from the corresponding
      pallet based on which transport you are using (UMP, HRMP or bridges),
      the base fee is a constant, the encoded message length from the message
      itself and the per byte fee is the same as the configured per byte fee
      for txs (i.e. `TransactionByteFee`).
      
      ---------
      
      Co-authored-by: default avatarBranislav Kontur <[email protected]>
      Co-authored-by: default avatarjoe petrowski <[email protected]>
      Co-authored-by: default avatarGiles Cope <[email protected]>
      Co-authored-by: command-bot <>
      Co-authored-by: default avatarFrancisco Aguirre <[email protected]>
      Co-authored-by: default avatarLiam Aharon <[email protected]>
      Co-authored-by: default avatarKian Paimani <[email protected]>
      3dece311
    • Javyer's avatar
      upgraded review bot to v2.1.0 (#1908) · 1cf7d3aa
      Javyer authored
      Upgraded to version 2.1.0 which has paritytech/review-bot#94, a change
      in the logic of the action to overcome some problems with permissions
      coming from PRs from forks
      
      For this, we needed to divide the actions into two files:
      - A first action that triggers on PRs and reviews and uploads the PR
      number.
      - A second action which is triggered under the completion of the first
      one and runs as the action normally runs (but won't have any problems
      regarding permissions because it is triggered from the master branch)
      1cf7d3aa
    • alexd10s's avatar
      Trading trait and deal with metadata in Mutate trait for nonfungibles_v2 (#1561) · 3aaf62ad
      alexd10s authored
      
      
      I have added some Traits that are missing and are useful for dealing
      with non-fungible tokens on other pallets and their implementations for
      NFTs pallet.
      
      - In the Mutate trait, added methods for dealing with the metadata:
      `set_metadata`, `set_collection_metadata`, `clear_metadata` and
      `clear_collection_metadata`.
      The motivation of adding this methods coming from a StackExchange
      question asking for it: [Setting metadata of an item of the Nfts pallet
      in a custom
      pallet](https://substrate.stackexchange.com/questions/9974/setting-metadata-of-an-item-of-the-nfts-pallet-in-a-custom-pallet)
      
      - A Trait for trading non-fungible items. The methods in that Trait are
      `buy_item`, `set_price` and `item_price`
      An example of where this Trait can be useful is a pallet that deals with
      [NFT
      Royalties](https://forum.polkadot.network/t/nfts-royalty-pallet/3766)
      and needs to perform this actions.
      
      ---------
      
      Co-authored-by: default avatarJegor Sidorenko <[email protected]>
      3aaf62ad
    • joe petrowski's avatar
      Add Runtime Missing Crate Descriptions (#1909) · d3ea69b7
      joe petrowski authored
      Adds descriptions needed for publishing to crates.io.
      d3ea69b7
    • Chevdor's avatar
      Switch to the release env (#1910) · b6654094
      Chevdor authored
      Follow up of #1892, this PR now switches the env for release related
      workflows from `master` to `release`.
      b6654094
    • dependabot[bot]'s avatar
      Bump paritytech/review-bot from 2.0.1 to 2.1.0 (#1924) · 9c333a5c
      dependabot[bot] authored
      Bumps [paritytech/review-bot](https://github.com/paritytech/review-bot) from 2.0.1 to 2.1.0.
      9c333a5c
    • dependabot[bot]'s avatar
      Bump actions/checkout from 4.1.0 to 4.1.1 (#1925) · e34aa4b7
      dependabot[bot] authored
      Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.0 to 4.1.1.
      e34aa4b7
    • Serban Iorga's avatar
      Start BEEFY client by default for Polkadot nodes (#1913) · 6c39bb4a
      Serban Iorga authored
      Fellowship companion:
      https://github.com/polkadot-fellows/runtimes/pull/65
      
      This starts the BEEFY client by default for Polkadot nodes.
      
      Governance/sudo call is later required to enable/start consensus.
      
      Part of https://github.com/paritytech/parity-bridges-common/issues/2420
      6c39bb4a
    • Adrian Catangiu's avatar
      cumulus: add asset-hub-rococo runtime based on asset-hub-kusama and add... · 8b3905d2
      Adrian Catangiu authored
      
      cumulus: add asset-hub-rococo runtime based on asset-hub-kusama and add asset-bridging support to it (#1215)
      
      This commit adds Rococo Asset Hub dedicated runtime so we can test new
      features here, before merging them in Kusama Asset Hub.
      Also adds one such feature: asset transfer over bridge (Rococo AssetHub
      <> Wococo AssetHub)
      
      - clone `asset-hub-kusama-runtime` -> `asset-hub-rococo-runtime`
      - make it use Rococo primitives, names, assets, constants, etc
      - add asset-transfer-over-bridge support to Rococo AssetHub <> Wococo
      AssetHub
      
      Fixes #1128
      
      ---------
      
      Co-authored-by: default avatarBranislav Kontur <[email protected]>
      Co-authored-by: default avatarjoe petrowski <[email protected]>
      Co-authored-by: default avatarFrancisco Aguirre <[email protected]>
      8b3905d2
    • Ignacio Palacios's avatar
      Publish `penpal-runtime` crate (#1904) · e73729b1
      Ignacio Palacios authored
      Remove `publish = false` to publish the crate
      e73729b1
  2. Oct 17, 2023
  3. Oct 16, 2023
    • Liam Aharon's avatar
      Allow Locks/Holds/Reserves/Freezes by default when using `pallet_balances`... · fcc1bb41
      Liam Aharon authored
      Allow Locks/Holds/Reserves/Freezes by default when using `pallet_balances` `TestDefaultConfig` (#1880)
      
      Allow Locks/Holds/Reserves/Freezes by default when using
      `pallet_balances` `TestDefaultConfig`.
      fcc1bb41
    • Oliver Tale-Yazdi's avatar
      Workspace maintenance (#1884) · 9c1a2b38
      Oliver Tale-Yazdi authored
      
      
      Changes:
      - Add missing crate to the workspace
      - Remove versions from local dependency links
      
      Maybe it is finally worth it to add this scrip to the CI to find these
      things earlier:
      [check-deps.py](https://github.com/ggwpez/substrate-scripts/blob/master/import-runtime-repos/check-deps.py).
      
      @paritytech/ci what would be the best location for that check?  
      It takes only a second to run, so maybe we can squeeze it into one of
      the existing checks?
      Otherwise creating a new GH workflow feels a bit wasteful... maybe i can
      group it with https://github.com/paritytech/polkadot-sdk/pull/1831
      
      ---------
      
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      9c1a2b38
    • Ignacio Palacios's avatar
      Make System Parachains trusted Teleporters (#1368) · e0065cb8
      Ignacio Palacios authored
      
      
      Make System Parachain trusted Teleporters of each other.
      
      Migration of https://github.com/paritytech/cumulus/pull/2842
      
      ---------
      
      Co-authored-by: command-bot <>
      Co-authored-by: default avatarjoe petrowski <[email protected]>
      e0065cb8
    • Chevdor's avatar
      Add missing env (#1892) · 4145902f
      Chevdor authored
      This PR adds a missing env to allow publishing the Docker image.
      4145902f
    • Muharem Ismailov's avatar
      `extract` amount method for `fungible/s` `Imbalance` (#1847) · c422e3f5
      Muharem Ismailov authored
      Introduces an `extract` amount method for `fungible/s` `Imbalance`.
      c422e3f5
    • Adrian Catangiu's avatar
      sc-consensus-beefy: fix initialization when state is unavailable (#1888) · 646ecd0e
      Adrian Catangiu authored
      
      
      Fix situation where BEEFY initial validator set could not be determined.
      
      If state is unavailable at BEEFY genesis block to get initial validator
      set, get the info from header digests. For this, we need to walk back
      the chain starting from BEEFY genesis looking for the BEEFY digest
      announcing the active validator set for that respective session.
      
      This commit fixes a silly bug where walking back the chain was stopped
      when reaching BEEFY genesis block, which is incorrect when BEEFY genesis
      is not session boundary block. When BEEFY genesis is set to some random
      block within a session, we need to walk back to the start of the session
      to see the validator set announcement.
      
      Added regression test for this fix.
      
      Fixes https://github.com/paritytech/polkadot-sdk/issues/1885
      
      Signed-off-by: default avatarAdrian Catangiu <[email protected]>
      646ecd0e
    • Bastian Köcher's avatar
      sp-api: Improve error message for duplicate runtime apis (#1877) · 4e98bec3
      Bastian Köcher authored
      Co-authored-by: command-bot <>
      4e98bec3
    • Oliver Tale-Yazdi's avatar
      [CI] Add link checker (#1875) · e0e566bc
      Oliver Tale-Yazdi authored
      
      
      Adding link checker to the CI (closes
      https://github.com/paritytech/polkadot-sdk/issues/993). It would be nice
      to have the docs people own this and extend accordingly.
      Currently all known-bad links are excluded, but we should one-by-one
      include those as well until all are fixed.
      
      This check now ensures that 1) no new broken links are introduced into
      `.rs` files and 2) that no old links break unnoticed.
      
      ---------
      
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      e0e566bc
    • Bulat Saifullin's avatar
      Update the alerts to use a new metric substrate_unbounded_channel_size (#1568) · 73ec161e
      Bulat Saifullin authored
      # Description
      
      Follow up for https://github.com/paritytech/polkadot-sdk/pull/1489.
      Closes #611 
      
      Before we calculated the channel size during alert expression but in
      #1489 a new metric was introduced that reports channel size.
      ## Changes:
      1. updated alert rule to use new metric.
      73ec161e
    • Ignacio Palacios's avatar
      Publish `xcm-emulator` crate (#1881) · 8f1f2f35
      Ignacio Palacios authored
      Remove `publish = false` to publish the crate
      8f1f2f35
    • Alejandro Martinez Andres's avatar
      Adding migrations to clean Rococo Gov 1 storage & reserved funds (#1849) · 86fde367
      Alejandro Martinez Andres authored
      Following
      [polkadot#7314](https://github.com/paritytech/polkadot/pull/7314) and
      after merging https://github.com/paritytech/polkadot-sdk/pull/1177 this
      PR solves https://github.com/paritytech/polkadot-sdk/issues/1618
      
      The following is a summary of the outcome of the migration.
      
      | Module | Total Accounts | Total stake to unlock | Total deposit to
      unreserve |
      | ------- | --------------- | --------------------- |
      -------------------------- |
      | Elections Phragmen | 27 | 1,132.821063320441 ROC | 1.465386531600 ROC
      |
      | Democracy | 69 | 2733.923509345613 ROC | 0.166666665000 ROC |
      | Tips | 4 | N/A | 0.015099999849 ROC |
      
      The migrations will also remove the following amount of keys
      
      103 Democracy keys 🧹
      5 Council keys 🧹
      1 TechnicalCommittee keys 🧹
      25 PhragmenElection keys 🧹
      1 TechnicalMembership keys 🧹
      9 Tips keys 🧹
      86fde367
    • Davide Galassi's avatar
      Arkworks Elliptic Curve utils overhaul (#1870) · 38ef04eb
      Davide Galassi authored
      - Removal of Arkworks unit tests. These tests were just testing the
      arkworks upstream implementation which should be assumed correct. This
      is not the place to test well known dependencies.
      - Removal of some over-engineering. We just store the calls to Arkworks
      in one file. Per-curve sources are not required.
      - Docs formatting
      
      ---
      
      I also took the opportunity to bump the `bandersnatch-vrfs` crate
      revision internally providing some new shiny stuff.
      38ef04eb
    • shuoer86's avatar
      Fix typos (#1878) · 19f38ca3
      shuoer86 authored
      19f38ca3
  4. Oct 15, 2023
    • Daan van der Plas's avatar
      fix: GoAhead signal only set when runtime upgrade is enacted from parachain side (#1176) · 91c4360c
      Daan van der Plas authored
      The runtime code of a parachain can be replaced on the relay-chain via:
      
      [cumulus]:
      [enact_authorized_upgrade](https://github.com/paritytech/polkadot-sdk/blob/1a38d6d6/cumulus/pallets/parachain-system/src/lib.rs#L661);
      this is used for a runtime upgrade when a parachain is not bricked.
      
      [polkadot] (these are used when a parachain is bricked):
      -
      [force_set_current_code](https://github.com/paritytech/polkadot-sdk/blob/1a38d6d6/polkadot/runtime/parachains/src/paras/mod.rs#L823):
      immediately changes the runtime code of a given para without a pvf check
      (root).
      -
      [force_schedule_code_upgrade](https://github.com/paritytech/polkadot-sdk/blob/1a38d6d6/polkadot/runtime/parachains/src/paras/mod.rs#L864):
      schedules a change to the runtime code of a given para including a pvf
      check of the new code (root).
      -
      [schedule_code_upgrade](https://github.com/paritytech/polkadot-sdk/blob/1a38d6d6/polkadot/runtime/common/src/paras_registrar.rs#L395):
      schedules a change to the runtime code of a given para including a pvf
      check of the new code. Besides root, the parachain or parachain manager
      can call this extrinsic given that the parachain is unlocked.
      
      Polkadot signals a parachain to be ready for a runtime upgrade through
      the
      [GoAhead](https://github.com/paritytech/polkadot-sdk/blob/e4949344
      
      /polkadot/primitives/src/v5/mod.rs#L1229)
      signal.
      
      When in cumulus `enact_authorized_upgrade` is executed, the same
      underlying helper function of `force_schedule_code_upgrade` &
      `schedule_code_upgrade`:
      [schedule_code_upgrade](https://github.com/paritytech/polkadot/blob/09b61286da11921a3dda0a8e4015ceb9ef9cffca/runtime/parachains/src/paras/mod.rs#L1778),
      is called on the relay-chain, which sets the `GoAhead` signal (if the
      pvf is accepted).
      
      If Cumulus receives the `GoAhead` signal from polkadot without having
      the `PendingValidationCode` ready, it will panic
      ([ref](https://github.com/paritytech/polkadot/pull/7412)). For
      `enact_authorized_upgrade` we know for sure the `PendingValidationCode`
      is set. On the contrary, for `force_schedule_code_upgrade` &
      `schedule_code_upgrade` this is not the case.
      
      This PR includes a flag such that the `GoAhead` signal will only be set
      when a runtime upgrade is enacted by the parachain
      (`enact_authorized_upgrade`).
      
      additional info: https://github.com/paritytech/polkadot/pull/7412
      
      Closes #641
      
      ---------
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      91c4360c
    • Gonçalo Pestana's avatar
      Refactor staking ledger (#1484) · 8ee4042c
      Gonçalo Pestana authored
      This PR refactors the staking ledger logic to encapsulate all reads and
      mutations of `Ledger`, `Bonded`, `Payee` and stake locks within the
      `StakingLedger` struct implementation.
      
      With these changes, all the reads and mutations to the `Ledger`, `Payee`
      and `Bonded` storage map should be done through the methods exposed by
      StakingLedger to ensure the data and lock consistency of the operations.
      The new introduced methods that mutate and read Ledger are:
      
      - `ledger.update()`: inserts/updates a staking ledger in storage;
      updates staking locks accordingly (and ledger.bond(), which is synthatic
      sugar for ledger.update())
      - `ledger.kill()`: removes all Bonded and StakingLedger related data for
      a given ledger; updates staking locks accordingly;
      `StakingLedger::get(account)`: queries both the `Bonded` and `Ledger`
      storages and returns a `Option<StakingLedger>`. The pallet impl exposes
      fn ledger(account) as synthatic sugar for `StakingLedger::get(account)`.
      
      Retrieving a ledger with `StakingLedger::get()` can be done by providing
      either a stash or controller account. The input must be wrapped in a
      `StakingAccount` variant (Stash or Controller) which is treated
      accordingly. This simplifies the caller API but will eventually be
      deprecated once we completely get rid of the controller account in
      staking. However, this refactor will help with the work necessary when
      completely removing the controller.
      
      Other goals:
      
      - No logical changes have been introduced in this PR;
      - No breaking changes or updates in wallets required;
      - No new storage items or need to perform storage migrations;
      - Centralise the changes to bonds and ledger updates to simplify the
      OnStakingUpdate updates to the target list (related to
      https://github.com/paritytech/polkadot-sdk/issues/443)
      
      Note: it would be great to prevent or at least raise a warning if
      `Ledger<T>`, `Payee<T>` and `Bonded<T>` storage types are accessed
      outside the `StakingLedger` implementation. This PR should not get
      blocked by that feature, but there's a tracking issue here
      https://github.com/paritytech/polkadot-sdk/issues/149
      
      Related and step towards
      https://github.com/paritytech/polkadot-sdk/issues/443
      8ee4042c
    • drskalman's avatar
      Paired-key Crypto Scheme (#1705) · 1b34571c
      drskalman authored
      
      
      BEEFY needs two cryptographic keys at the same time. Validators should
      sign BEEFY payload using both ECDSA and BLS key. The network will gossip
      a payload which contains a valid ECDSA key. The prover nodes aggregate
      the BLS keys if aggregation fails to verifies the validator which
      provided a valid ECDSA signature but an invalid BLS signature is subject
      to slashing.
      
      As such BEEFY session should be initiated with both key. Currently there
      is no straight forward way of doing so, beside having a session with
      RuntimeApp corresponding to a crypto scheme contains both keys.
      
      This pull request implement a generic paired_crypto scheme as well as
      implementing it for (ECDSA, BLS) pair.
      
      ---------
      
      Co-authored-by: default avatarDavide Galassi <[email protected]>
      Co-authored-by: default avatarRobert Hambrock <[email protected]>
      1b34571c
    • Julian Eager's avatar
      Include polkadot version in artifact path (#1828) · 9e144704
      Julian Eager authored
      closes #695
      
      Could potentially be helpful to preserving caches when applicable, as
      discussed in #685
      
      kusama address: FvpsvV1GQAAbwqX6oyRjemgdKV11QU5bXsMg9xsonD1FLGK
      9e144704
    • S E R A Y A's avatar
      add link to rfc-0001 in broker README (#1862) · c9b51cd4
      S E R A Y A authored
      # Description
      - What does this PR do?
        - link added
      - Why are these changes needed?
        - improve docs
      - How were these changes implemented and what do they affect?
        - only concerns docs
      c9b51cd4
  5. Oct 14, 2023
    • Julian Eager's avatar
      Discard `Executor` (#1855) · 9f7656df
      Julian Eager authored
      
      
      closes #622 
      
      Pros:
      * simpler interface, just functions:
      `create_runtime_from_artifact_bytes()` and `execute_artifact()`
      
      Cons:
      * extra overhead of constructing executor semantics each time
      
      I could make it a combination of
      * `create_runtime_config(params)` (such that we could clone the
      constructed semantics)
      * `create_runtime(blob, config)`
      * `execute_artifact(blob, config, params)`
      
      Not sure if it's worth it though.
      
      ---------
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      9f7656df
    • juangirini's avatar
      Macros to use path instead of ident (#1474) · 7c87d61f
      juangirini authored
      7c87d61f
  6. Oct 13, 2023
    • Dónal Murray's avatar
      Remove clippy clone-double-ref lint noise (#1860) · 1f28cddd
      Dónal Murray authored
      The lint `clippy::clone_double_ref` was renamed to
      `suspicious_double_ref_op` in [this
      commit](https://github.com/rust-lang/rust/commit/5c99175a9efcaa3d65712c119f361add22e3a859)
      (thanks @liamaharon) and now generates a lot of noise in the terminal
      when run both in CI and locally with 1.73.
      
      This renames the lint in line with this, but does not change
      functionality.
      
      May cause issues for people running earlier versions locally - @altaua
      requesting review to get your opinion on this.
      1f28cddd
    • 0xmovses's avatar
      Refactor alliance benchmarks to v2 (#1868) · 24840290
      0xmovses authored
      - This PR refactors `alliance/src/benchmarkings.rs` to use benchmarking
      v2. These changes are needed to improve the readability and
      maintainability of the benchmarking code.
      
      - No known issue to backlink.
      
      ## Local Testing 
      1. `cargo build --features runtime-benchmarks` 
      2. `cargo run --locked --release -p node-cli --bin substrate-node
      --features runtime-benchmarks -- benchmark pallet --execution wasm
      --wasm-execution compiled --chain dev --pallet "*" --extrinsic "*"
      --steps 2 --repeat 1`
      24840290