1. Nov 15, 2023
    • 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
    • Adrian Catangiu's avatar
      xcm: SovereignPaidRemoteExporter: remove unused RefundSurplus instruction (#2312) · 824b7823
      Adrian Catangiu authored
      Refunding surplus happens anyway on xcm_executor::post_process(),
      automatically refunding surplus to original_origin at the end of
      execution. Since SovereignPaidRemoteExporter doesn't ClearOrigin, it can
      simply rely on the automatic mechanism.
      
      Furthermore, RefundSurplus instruction refunds _surplus_. Surplus exists
      only as a result of Transact, SetErrorHandler or SetAppendix
      instructions, none of which being part of the
      SovereignPaidRemoteExporter XCM program. So surplus is always zero here
      anyway.
      824b7823
    • 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
    • Alexander Samusev's avatar
      [CI] Prepare CI for Merge Queues (#2308) · 5b0622bc
      Alexander Samusev authored
      PR prepares CI to the GitHub Merge Queues. All github actions that were
      running in PR adjusted so they can run in the merge queues. Zombienet
      jobs will do nothing during PRs but they will run during merge queues.
      
      Jobs that will be skipped during PR:
       - all zombienet jobs
       - all publish docker jobs
      
      Jobs that will be skipped during merge queue:
       - check-labels
       - check-prdoc
       - pr-custom-review
       - review trigger
      
      cc https://github.com/paritytech/ci_cd/issues/862
      5b0622bc
    • Dmitry Markin's avatar
      Unify `ChainSync` actions under one enum (follow-up) (#2317) · 18165ebb
      Dmitry Markin authored
      
      
      Get rid of public `ChainSync::..._requests()` functions and return all
      requests as actions.
      
      ---------
      
      Co-authored-by: default avatarSebastian Kunert <[email protected]>
      18165ebb
    • Adrian Catangiu's avatar
      pallet-xcm: use XcmTeleportFilter for teleported fees in reserve transfers (#2322) · f5360436
      Adrian Catangiu authored
      Disallow reserve transfers that use teleportable fees if `(origin,
      fees)` matches `XcmTeleportFilter`.
      
      Add regression tests for filtering based on `XcmTeleportFilter` for both
      `(limited_)reserve_transfer_assets()` and `(limited_)teleport_assets`
      extrinsics.
      f5360436
  2. Nov 14, 2023
  3. Nov 13, 2023
    • Javyer's avatar
      review-bot: trigger only on review approvals (#2289) · 8d263790
      Javyer authored
      Moved the review event of review-bot to only be triggered in approvals.
      
      Because we only update the required reviews when someone approves, this
      will stop the bot from immediately requesting a new review when someone
      comments or request changes as they should have been already notified in
      the first batch.
      8d263790
    • Assem's avatar
      f332d688
    • Lulu's avatar
      Add CI to claim crates (#2299) · c7bd8804
      Lulu authored
      c7bd8804
    • 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
    • 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
    • Bastian Köcher's avatar
      pallet-grandpa: Remove `GRANDPA_AUTHORITIES_KEY` (#2181) · ebcf0a0f
      Bastian Köcher authored
      
      
      Remove the `GRANDPA_AUTHORITIES_KEY` key and its usage. Apparently this
      was used in the early days to communicate the grandpa authorities to the
      node. However, we have now a runtime api that does this for us. So, this
      pull request is moving from the custom managed storage item to a FRAME
      managed storage item.
      
      This pr also includes a migration for doing the switch on a running
      chain.
      
      ---------
      
      Co-authored-by: default avatarDavide Galassi <[email protected]>
      ebcf0a0f
    • Bastian Köcher's avatar
      wasm-builder: Optimize `rerun-if-changed` logic (#2282) · 604704a8
      Bastian Köcher authored
      Optimizes the `rerun-if-changed` logic by ignoring `dev-dependencies`
      and also not outputting paths. Because outputting paths could lead to
      include unwanted crates in the rerun checks.
      604704a8
    • Marcin S.'s avatar
    • Dmitry Markin's avatar
      Unify `ChainSync` actions under one enum (#2180) · 951bcceb
      Dmitry Markin authored
      All `ChainSync` actions that `SyncingEngine` should perform are unified
      under one `ChainSyncAction`. Processing of these actions put into a
      single place after `select!` in `SyncingEngine::run` instead of multiple
      places where calling `ChainSync` methods.
      951bcceb
  4. Nov 11, 2023
  5. Nov 10, 2023
    • PG Herveou's avatar
      Contracts: Add XCM traits to interface with contracts (#2086) · 6b7be115
      PG Herveou authored
      We are introducing a new set of `XcmController` traits (final name yet
      to be determined).
      These traits are implemented by `pallet-xcm` and allows other pallets,
      such as `pallet_contracts`, to rely on these traits instead of tight
      coupling them to `pallet-xcm`.
      
      Using only the existing Xcm traits would mean duplicating the logic from
      `pallet-xcm` in these other pallets, which we aim to avoid. Our
      objective is to ensure that when these APIs are called from
      `pallet-contracts`, they produce the exact same outcomes as if called
      directly from `pallet-xcm`.
      
      The other benefits is that we can also expose return values to
      `pallet-contracts` instead of just calling `pallet-xcm` dispatchable and
      getting a `DispatchResult` back.
      
      See traits integration in this PR
      https://github.com/paritytech/polkadot-sdk/pull/1248
      
      , where the traits
      are used as follow to define and implement `pallet-contracts` Config.
      ```rs
      // Contracts config:
      pub trait Config: frame_system::Config {
        // ...
      
        /// A type that exposes XCM APIs, allowing contracts to interact with other parachains, and
        /// execute XCM programs.
        type Xcm: xcm_executor::traits::Controller<
      	  OriginFor<Self>,
      	  <Self as frame_system::Config>::RuntimeCall,
      	  BlockNumberFor<Self>,
        >;
      }
      
      // implementation
      impl pallet_contracts::Config for Runtime {
              // ...
      
      	type Xcm = pallet_xcm::Pallet<Self>;
      }
      ```
      
      ---------
      
      Co-authored-by: default avatarAlexander Theißen <[email protected]>
      Co-authored-by: command-bot <>
      6b7be115
    • Liam Aharon's avatar
      Improve `VersionedMigration` naming conventions (#2264) · 84ddbaf6
      Liam Aharon authored
      As suggested by @ggwpez
      (https://github.com/paritytech/polkadot-sdk/pull/2142#discussion_r1388145872),
      remove the `VersionChecked` prefix from version checked migrations (but
      leave `VersionUnchecked` prefixes)
      
      ---------
      
      Co-authored-by: command-bot <>
      84ddbaf6
    • Vincent Geddes's avatar
      [pallet-message-queue] Implement impl_trait_for_tuples for QueuePausedQuery (#2227) · 3f0383a5
      Vincent Geddes authored
      These changes are required so that the bridgehub system runtimes can
      more easily be configured with multiple message processors
      
      Example usage:
      
      ```rust
      use frame_support::traits::QueuePausedQuery;
      
      impl pallet_message_queue::Config for Runtime {
          type QueuePausedQuery = (A, B, C)
      }
      3f0383a5
    • PG Herveou's avatar
      Contracts move fixtures to new crate (#2246) · 64effd0e
      PG Herveou authored
      Small PR that introduce a new crate that will host RISC-V & wasm
      fixtures for testing pallet-contracts
      64effd0e
  6. Nov 09, 2023