1. Nov 27, 2023
  2. Nov 25, 2023
  3. Nov 24, 2023
  4. Nov 23, 2023
  5. Nov 22, 2023
  6. Nov 21, 2023
    • Sophia Gold's avatar
      Update tick collator for async backing (#1497) · 50811d6b
      Sophia Gold authored
      This updates the tick runtime and polkadot-parachain collator to use
      async backing.
      50811d6b
    • Francisco Aguirre's avatar
      Different XCM builders, default one requires fee payment (#2253) · b3841b6b
      Francisco Aguirre authored
      Adding on top of the new builder pattern for creating XCM programs, I'm
      adding some more APIs:
      
      ```rust
      let paying_fees: Xcm<()> = Xcm::builder() // Only allow paying for fees
        .withdraw_asset() // First instruction has to load the holding register
        .buy_execution() // Second instruction has to be `buy_execution`
        .build();
      
      let paying_fees_invalid: Xcm<()> = Xcm::builder()
        .withdraw_asset()
        .build(); // Invalid, need to pay for fees
      
      let not_paying_fees: Xcm<()> = Xcm::builder_unpaid()
        .unpaid_execution() // Needed
        .withdraw_asset()
        .deposit_asset()
        .build();
      
      let all_goes: Xcm<()> = Xcm::builder_unsafe() // You can do anything
        .withdraw_asset()
        .deposit_asset()
        .build();
      ```
      
      The invalid bits are because the methods don't even exist on the types
      that you'd want to call them on.
      
      ---------
      
      Co-authored-by: command-bot <>
      b3841b6b
    • Michal Kucharczyk's avatar
      `chain-spec-builder`: cleanup (#2174) · 2fd8c51e
      Michal Kucharczyk authored
      
      
      This PR removes:
      -  `New`, `Generate`, `Edit` commands,
      - `kitchensink` dependency
      from the `chain-spec-builder` util.
      
      New `convert-to-raw`, `update-code` commands were added.
      
      Additionally renames the `runtime` command (which was added in #1256) to
      `create`.
      
      ---------
      
      Co-authored-by: default avatarSebastian Kunert <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      Co-authored-by: command-bot <>
      2fd8c51e
  7. Nov 19, 2023
  8. Nov 18, 2023
  9. Nov 17, 2023
  10. Nov 15, 2023
    • Bastian Köcher's avatar
      frame-system: Add `last_runtime_upgrade_spec_version` (#2351) · ea4085ab
      Bastian Köcher authored
      
      
      Adds a function for querying the last runtime upgrade spec version. This
      can be useful for when writing runtime level migrations to ensure that
      they are not executed multiple times. An example would be a session key
      migration.
      
      ---------
      
      Co-authored-by: default avatarLiam Aharon <[email protected]>
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      ea4085ab
    • Branislav Kontur's avatar
      [testnet] Remove Wococo stuff from BridgeHubRococo/AssetHubRococo (#2300) · f4bb17cc
      Branislav Kontur authored
      Rococo<>Wococo bridge is replaced by Rococo<Westend bridge, so this PR
      removes unneeded code.
      
      - [x] update bridges subtree after
      https://github.com/paritytech/parity-bridges-common/pull/2692
      
      
      
      ---------
      
      Co-authored-by: command-bot <>
      Co-authored-by: default avatarSvyatoslav Nikolsky <[email protected]>
      f4bb17cc
    • Dónal Murray's avatar
      Add `collectives-westend` and `glutton-westend` runtimes (#2024) · 0226b55f
      Dónal Murray authored
      Add collectives and glutton parachain westend runtimes to prepare for
      #1737.
      
      The removal of system parachain native runtimes #1737 is blocked until
      chainspecs and runtime APIs can be dealt with cleanly (merge of #1256
      and follow up PRs).
      
      In the meantime, these additions are ready to be merged to `master`, so
      I have separated them out into this PR.
      
      Also marked `bridge-hub-westend` as unimplemented in line with [this
      issue](https://github.com/paritytech/parity-bridges-common/issues/2602
      
      ).
      
      TODO
      - [x] add to `command-bot` benchmarks
      - [x] add to `command-bot-scripts` benchmarks
      - [x] generate weights
      
      ---------
      
      Co-authored-by: default avatarjoe petrowski <[email protected]>
      Co-authored-by: default avatarMuharem <[email protected]>
      Co-authored-by: command-bot <>
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      Co-authored-by: default avatarBranislav Kontur <[email protected]>
      0226b55f
    • joe petrowski's avatar
      Identity Deposits Relay to Parachain Migration (#1814) · c79b234b
      joe petrowski authored
      The goal of this PR is to migrate Identity deposits from the Relay Chain
      to a system parachain.
      
      The problem I want to solve is that `IdentityOf` and `SubsOf` both store
      an amount that's held in reserve as a storage deposit. When migrating to
      a parachain, we can take a snapshot of the actual `IdentityInfo` and
      sub-account mappings, but should migrate (off chain) the `deposit`s to
      zero, since the chain (and by extension, accounts) won't have any funds
      at genesis.
      
      The good news is that we expect parachain deposits to be significantly
      lower (possibly 100x) on the parachain. That is, a deposit of 21 DOT on
      the Relay Chain would need 0.21 DOT on a parachain. This PR proposes to
      migrate the deposits in the following way:
      
      1. Introduces a new pallet with two extrinsics: 
      - `reap_identity`: Has a configurable `ReapOrigin`, which would be set
      to `EnsureSigned` on the Relay Chain (i.e. callable by anyone) and
      `EnsureRoot` on the parachain (we don't want identities reaped from
      there).
      - `poke_deposit`: Checks what deposit the pallet holds (at genesis,
      zero) and attempts to update the amount based on the calculated deposit
      for storage data.
      2. `reap_identity` clears all storage data for a `target` account and
      unreserves their deposit.
      3. A `ReapIdentityHandler` teleports the necessary DOT to the parachain
      and calls `poke_deposit`. Since the parachain deposit is much lower, and
      was just unreserved, we know we have enough.
      
      One awkwardness I ran into was that the XCMv3 instruction set does not
      provide a way for the system to teleport assets without a fee being
      deducted on reception. Users shouldn't have to pay a fee for the system
      to migrate their info to a more efficient location. So I wrote my own
      program and did the `InitiateTeleport` accounting on my own to send a
      program with `UnpaidExecution`. Have discussed an
      `InitiateUnpaidTeleport` instruction with @franciscoaguirre . Obviously
      any chain executing this would have to pass a `Barrier` for free
      execution.
      
      TODO:
      
      - [x] Confirm People Chain ParaId
      - [x] Confirm People Chain deposit rates (determined in
      https://github.com/paritytech/polkadot-sdk/pull/2281
      
      )
      - [x] Add pallet to Westend
      
      ---------
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      c79b234b
  11. Nov 14, 2023
  12. Nov 13, 2023
    • Adrian Catangiu's avatar
      pallet-xcm: enhance `reserve_transfer_assets` to support remote reserves (#1672) · 18257373
      Adrian Catangiu authored
      ## Motivation
      
      `pallet-xcm` is the main user-facing interface for XCM functionality,
      including assets manipulation functions like `teleportAssets()` and
      `reserve_transfer_assets()` calls.
      
      While `teleportAsset()` works both ways, `reserve_transfer_assets()`
      works only for sending reserve-based assets to a remote destination and
      beneficiary when the reserve is the _local chain_.
      
      ## Solution
      
      This PR enhances `pallet_xcm::(limited_)reserve_withdraw_assets` to
      support transfers when reserves are other chains.
      This will allow complete, **bi-directional** reserve-based asset
      transfers user stories using `pallet-xcm`.
      
      Enables following scenarios:
      - transferring assets with local reserve (was previously supported iff
      asset used as fee also had local reserve - now it works in all cases),
      - transferring assets with reserve on destination,
      - transferring assets with reserve on remote/third-party chain (iff
      assets and fees have same remote reserve),
      - transferring assets with reserve different than the reserve of the
      asset to be used as fees - meaning can be used to transfer random asset
      with local/dest reserve while using DOT for fees on all involved chains,
      even if DOT local/dest reserve doesn't match asset reserve,
      - transferring assets with any type of local/dest reserve while using
      fees which can be teleported between involved chains.
      
      All of the above is done by pallet inner logic without the user having
      to specify which scenario/reserves/teleports/etc. The correct scenario
      and corresponding XCM programs are identified, and respectively, built
      automatically based on runtime configuration of trusted teleporters and
      trusted reserves.
      
      #### Current limitations:
      - while `fees` and "non-fee" `assets` CAN have different reserves (or
      fees CAN be teleported), the remaining "non-fee" `assets` CANNOT, among
      themselves, have different reserve locations (this is also implicitly
      enforced by `MAX_ASSETS_FOR_TRANSFER=2`, but this can be safely
      increased in the future).
      - `fees` and "non-fee" `assets` CANNOT have **different remote**
      reserves (this could also be supported in the future, but adds even more
      complexity while possibly not being worth it - we'll see what the future
      holds).
      
      Fixes https://github.com/paritytech/polkadot-sdk/issues/1584
      Fixes https://github.com/paritytech/polkadot-sdk/issues/2055
      
      
      
      ---------
      
      Co-authored-by: default avatarFrancisco Aguirre <[email protected]>
      Co-authored-by: default avatarBranislav Kontur <[email protected]>
      18257373
    • gupnik's avatar
      Adds syntax for marking calls feeless (#1926) · 60c77a2e
      gupnik authored
      Fixes https://github.com/paritytech/polkadot-sdk/issues/1725
      
      
      
      This PR adds the following changes:
      1. An attribute `pallet::feeless_if` that can be optionally attached to
      a call like so:
      ```rust
      #[pallet::feeless_if(|_origin: &OriginFor<T>, something: &u32| -> bool {
      	*something == 0
      })]
      pub fn do_something(origin: OriginFor<T>, something: u32) -> DispatchResult {
           ....
      }
      ```
      The closure passed accepts references to arguments as specified in the
      call fn. It returns a boolean that denotes the conditions required for
      this call to be "feeless".
      
      2. A signed extension `SkipCheckIfFeeless<T: SignedExtension>` that
      wraps a transaction payment processor such as
      `pallet_transaction_payment::ChargeTransactionPayment`. It checks for
      all calls annotated with `pallet::feeless_if` to see if the conditions
      are met. If so, the wrapped signed extension is not called, essentially
      making the call feeless.
      
      In order to use this, you can simply replace your existing signed
      extension that manages transaction payment like so:
      ```diff
      - pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
      + pallet_skip_feeless_payment::SkipCheckIfFeeless<
      +	Runtime,
      +	pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
      + >,
      ```
      
      ### Todo
      - [x] Tests
      - [x] Docs
      - [x] Prdoc
      
      ---------
      
      Co-authored-by: Nikhil Gupta <>
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      Co-authored-by: default avatarFrancisco Aguirre <[email protected]>
      Co-authored-by: default avatarLiam Aharon <[email protected]>
      60c77a2e
  13. Nov 10, 2023
  14. Nov 09, 2023
  15. Nov 08, 2023
    • Sebastian Kunert's avatar
      Add prospective-parachain subsystem to minimal-relay-node + QoL improvements (#2223) · 69494ea7
      Sebastian Kunert authored
      This PR contains some fixes and cleanups for parachain nodes:
      
      1. When using async backing, node no longer complains about being unable
      to reach the prospective-parachain subsystem.
      2. Parachain warp sync now informs users that the finalized para block
      has been retrieved.
      ```
      2023-11-08 13:24:42 [Parachain] 🎉 Received finalized parachain header #5747719 (0xa0aa…674b) from the relay chain.
      ```
      3. When a user supplied an invalid `--relay-chain-rpc-url`, we were
      crashing with a very verbose message. Removed the `expect` and improved
      the error message.
      ```
      2023-11-08 13:57:56 [Parachain] No valid RPC url found. Stopping RPC worker.
      2023-11-08 13:57:56 [Parachain] Essential task `relay-chain-rpc-worker` failed. Shutting down service.
      Error: Service(Application(WorkerCommunicationError("RPC worker channel closed. This can hint and connectivity issues with the supplied RPC endpoints. Message: oneshot canceled")))
      ```
      69494ea7
    • Ignacio Palacios's avatar
      [xcm-emulator] Chains generic over Network & Integration tests restructure (#2092) · ffa0e30e
      Ignacio Palacios authored
      Closes:
      - #1383 
      - Declared chains can be now be imported and reused in a different
      crate.
      - Chain declaration are now generic over a generic type `N` (the
      Network)
      - #1389
      - Solved #1383, chains and networks declarations can be restructure to
      avoid having to compile all chains when running integrations tests where
      are not needed.
      - Chains are now declared on its own crate (removed from
      `integration-tests-common`)
      - Networks are now declared on its own crate (removed from
      `integration-tests-common`)
          - Integration tests will import only the relevant Network crate
      - `integration-tests-common` is renamed to
      `emulated-integration-tests-common`
      
      All this is necessary to be able to implement what is described here:
      https://github.com/paritytech/roadmap/issues/56#issuecomment-1777010553
      
      ---------
      
      Co-authored-by: command-bot <>
      ffa0e30e
    • Bastian Köcher's avatar
      validate-block: Fix `TrieCache` implementation (#2214) · 1bc08858
      Bastian Köcher authored
      The trie cache implementation was ignoring the `storage_root` when
      setting up the value cache. The problem with this is that the value
      cache works using `storage_keys` and these keys are not unique across
      different tries. A block can actually have different tries (main trie
      and multiple child tries). This pull request fixes the issue by not
      ignoring the `storage_root` and returning an unique `value_cache` per
      `storage_root`. It also adds a test for the seen bug and improves
      documentation that this doesn't happen again.
      1bc08858
    • Adrian Catangiu's avatar
      [testnets][xcm-emulator] add bridge-hub-westend and hook it up to emulator (#2204) · 2e2a75ff
      Adrian Catangiu authored
      
      
      `bridge-hub-westend-runtime` was added to cumulus/parachains, but wasn't
      hooked up to xcm-emulator to run tests against it.
      
      This commit addresses that ^.
      
      Signed-off-by: default avatarAdrian Catangiu <[email protected]>
      2e2a75ff
    • Francisco Aguirre's avatar
      XCM builder pattern (#2107) · 0524aa51
      Francisco Aguirre authored
      
      
      Added a proc macro to be able to write XCMs using the builder pattern.
      This means we go from having to do this:
      
      ```rust
      let message: Xcm<()> = Xcm(vec![
        WithdrawAsset(assets),
        BuyExecution { fees: asset, weight_limit: Unlimited },
        DepositAsset { assets, beneficiary },
      ]);
      ```
      
      to this:
      
      ```rust
      let message: Xcm<()> = Xcm::builder()
        .withdraw_asset(assets)
        .buy_execution(asset, Unlimited),
        .deposit_asset(assets, beneficiary)
        .build();
      ```
      
      ---------
      
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      Co-authored-by: command-bot <>
      0524aa51
  16. Nov 06, 2023
    • Andrei Sandu's avatar
      approval-voting improvement: include all tranche0 assignments in one certificate (#1178) · 0570b6fa
      Andrei Sandu authored
      **_PR migrated from https://github.com/paritytech/polkadot/pull/6782_** 
      
      This PR will upgrade the network protocol to version 3 -> VStaging which
      will later be renamed to V3. This version introduces a new kind of
      assignment certificate that will be used for tranche0 assignments.
      Instead of issuing/importing one tranche0 assignment per candidate,
      there will be just one certificate per relay chain block per validator.
      However, we will not be sending out the new assignment certificates,
      yet. So everything should work exactly as before. Once the majority of
      the validators have been upgraded to the new protocol version we will
      enable the new certificates (starting at a specific relay chain block)
      with a new client update.
      
      There are still a few things that need to be done:
      
      - [x] Use bitfield instead of Vec<CandidateIndex>:
      https://github.com/paritytech/polkadot/pull/6802
      
      
        - [x] Fix existing approval-distribution and approval-voting tests
        - [x] Fix bitfield-distribution and statement-distribution tests
        - [x] Fix network bridge tests
        - [x] Implement todos in the code
        - [x] Add tests to cover new code
        - [x] Update metrics
        - [x] Remove the approval distribution aggression levels: TBD PR
        - [x] Parachains DB migration 
        - [x] Test network protocol upgrade on Versi
        - [x] Versi Load test
        - [x] Add Zombienet test
        - [x] Documentation updates
      - [x] Fix for sending DistributeAssignment for each candidate claimed by
      a v2 assignment (warning: Importing locally an already known assignment)
       - [x]  Fix AcceptedDuplicate
       - [x] Fix DB migration so that we can still keep old data.
       - [x] Final Versi burn in
      
      ---------
      
      Signed-off-by: default avatarAndrei Sandu <[email protected]>
      Signed-off-by: default avatarAlexandru Gheorghe <[email protected]>
      Co-authored-by: default avatarAlexandru Gheorghe <[email protected]>
      0570b6fa
    • Michal Kucharczyk's avatar
      `serde_json`: bumped to 1.0.108 (#2168) · 305aefc4
      Michal Kucharczyk authored
      This PR updates the version of `serde_json` to `1.0.108` throughout the
      codebase.
      305aefc4
  17. Nov 05, 2023
  18. Nov 03, 2023
    • Bastian Köcher's avatar
      `sc-block-builder`: Remove `BlockBuilderProvider` (#2099) · ca5f1056
      Bastian Köcher authored
      The `BlockBuilderProvider` was a trait that was defined in
      `sc-block-builder`. The trait was implemented for `Client`. This
      basically meant that you needed to import `sc-block-builder` any way to
      have access to the block builder. So, this trait was not providing any
      real value. This pull request is removing the said trait. Instead of the
      trait it introduces a builder for creating a `BlockBuilder`. The builder
      currently has the quite fabulous name `BlockBuilderBuilder` (I'm open to
      any better name 😅
      
      ). The rest of the pull request is about
      replacing the old trait with the new builder.
      
      # Downstream code changes
      
      If you used `new_block` or `new_block_at` before you now need to switch
      it over to the new `BlockBuilderBuilder` pattern:
      
      ```rust
      // `new` requires a type that implements `CallApiAt`. 
      let mut block_builder = BlockBuilderBuilder::new(client)
                      // Then you need to specify the hash of the parent block the block will be build on top of
      		.on_parent_block(at)
                      // The block builder also needs the block number of the parent block. 
                      // Here it is fetched from the given `client` using the `HeaderBackend`
                      // However, there also exists `with_parent_block_number` for directly passing the number
      		.fetch_parent_block_number(client)
      		.unwrap()
                      // Enable proof recording if required. This call is optional.
      		.enable_proof_recording()
                      // Pass the digests. This call is optional.
                      .with_inherent_digests(digests)
      		.build()
      		.expect("Creates new block builder");
      ```
      
      ---------
      
      Co-authored-by: default avatarSebastian Kunert <[email protected]>
      Co-authored-by: command-bot <>
      ca5f1056