1. Nov 17, 2023
  2. Nov 16, 2023
  3. Nov 15, 2023
    • 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
    • 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
    • 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
  4. Nov 14, 2023
  5. 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
    • 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
    • Marcin S.'s avatar
  6. 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
  7. Nov 09, 2023
    • Lulu's avatar
      Add license to tracking-allocator and add staging-prefix (#2261) · 03ee44d9
      Lulu authored
      The staging- rename commit was missing from the last PR for some reason.
      03ee44d9
    • Lulu's avatar
    • Oliver Tale-Yazdi's avatar
      Add descriptions to all published crates (#2029) · 48ea86f0
      Oliver Tale-Yazdi authored
      
      
      Missing descriptions (47):  
      
      - [x] `cumulus/client/collator/Cargo.toml`
      - [x] `cumulus/client/relay-chain-inprocess-interface/Cargo.toml`
      - [x] `cumulus/client/cli/Cargo.toml`
      - [x] `cumulus/client/service/Cargo.toml`
      - [x] `cumulus/client/relay-chain-rpc-interface/Cargo.toml`
      - [x] `cumulus/client/relay-chain-interface/Cargo.toml`
      - [x] `cumulus/client/relay-chain-minimal-node/Cargo.toml`
      - [x] `cumulus/parachains/pallets/parachain-info/Cargo.toml`
      - [x] `cumulus/parachains/pallets/ping/Cargo.toml`
      - [x] `cumulus/primitives/utility/Cargo.toml`
      - [x] `cumulus/primitives/aura/Cargo.toml`
      - [x] `cumulus/primitives/core/Cargo.toml`
      - [x] `cumulus/primitives/parachain-inherent/Cargo.toml`
      - [x] `cumulus/test/relay-sproof-builder/Cargo.toml`
      - [x] `cumulus/pallets/xcmp-queue/Cargo.toml`
      - [x] `cumulus/pallets/dmp-queue/Cargo.toml`
      - [x] `cumulus/pallets/xcm/Cargo.toml`
      - [x] `polkadot/erasure-coding/Cargo.toml`
      - [x] `polkadot/statement-table/Cargo.toml`
      - [x] `polkadot/primitives/Cargo.toml`
      - [x] `polkadot/rpc/Cargo.toml`
      - [x] `polkadot/node/service/Cargo.toml`
      - [x] `polkadot/node/core/parachains-inherent/Cargo.toml`
      - [x] `polkadot/node/core/approval-voting/Cargo.toml`
      - [x] `polkadot/node/core/dispute-coordinator/Cargo.toml`
      - [x] `polkadot/node/core/av-store/Cargo.toml`
      - [x] `polkadot/node/core/chain-api/Cargo.toml`
      - [x] `polkadot/node/core/prospective-parachains/Cargo.toml`
      - [x] `polkadot/node/core/backing/Cargo.toml`
      - [x] `polkadot/node/core/provisioner/Cargo.toml`
      - [x] `polkadot/node/core/runtime-api/Cargo.toml`
      - [x] `polkadot/node/core/bitfield-signing/Cargo.toml`
      - [x] `polkadot/node/network/dispute-distribution/Cargo.toml`
      - [x] `polkadot/node/network/bridge/Cargo.toml`
      - [x] `polkadot/node/network/collator-protocol/Cargo.toml`
      - [x] `polkadot/node/network/approval-distribution/Cargo.toml`
      - [x] `polkadot/node/network/availability-distribution/Cargo.toml`
      - [x] `polkadot/node/network/bitfield-distribution/Cargo.toml`
      - [x] `polkadot/node/network/gossip-support/Cargo.toml`
      - [x] `polkadot/node/network/availability-recovery/Cargo.toml`
      - [x] `polkadot/node/collation-generation/Cargo.toml`
      - [x] `polkadot/node/overseer/Cargo.toml`
      - [x] `polkadot/runtime/parachains/Cargo.toml`
      - [x] `polkadot/runtime/common/slot_range_helper/Cargo.toml`
      - [x] `polkadot/runtime/metrics/Cargo.toml`
      - [x] `polkadot/xcm/pallet-xcm-benchmarks/Cargo.toml`
      - [x] `polkadot/utils/generate-bags/Cargo.toml`
      - [x]  `substrate/bin/minimal/runtime/Cargo.toml`
      
      ---------
      
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      Signed-off-by: default avataralindima <[email protected]>
      Co-authored-by: default avatarordian <[email protected]>
      Co-authored-by: default avatarTsvetomir Dimitrov <[email protected]>
      Co-authored-by: default avatarMarcin S <[email protected]>
      Co-authored-by: default avataralindima <[email protected]>
      Co-authored-by: default avatarSebastian Kunert <[email protected]>
      Co-authored-by: default avatarDmitry Markin <[email protected]>
      Co-authored-by: default avatarjoe petrowski <[email protected]>
      Co-authored-by: default avatarLiam Aharon <[email protected]>
      48ea86f0
    • Keith Yeung's avatar
      Remove unnecessary map_error (#2239) · d347d688
      Keith Yeung authored
      This was discovered during a debugging session, and it only served to
      mask the underlying error, which was not great.
      d347d688
  8. Nov 08, 2023
  9. Nov 07, 2023
  10. Nov 06, 2023
  11. Nov 05, 2023
  12. Nov 03, 2023
    • georgepisaltu's avatar
      Identity pallet improvements (#2048) · 21fbc00d
      georgepisaltu authored
      This PR is a follow up to #1661 
      
      - [x] rename the `simple` module to `legacy`
      - [x] fix benchmarks to disregard the number of additional fields
      - [x] change the storage deposits to charge per encoded byte of the
      identity information instance, removing the need for `fn
      additional(&self) -> usize` in `IdentityInformationProvider`
      - [x] ~add an extrinsic to rejig deposits to account for the change
      above~
      - [ ] ~ensure through proper configuration that the new byte-based
      deposit is always lower than whatever is reserved now~
      - [x] remove `IdentityFields` from the `set_fields` extrinsic signature,
      as per [this
      discussion](https://github.com/paritytech/polkadot-sdk/pull/1661#discussion_r1371703403)
      
      > ensure through proper configuration that the new byte-based deposit is
      always lower than whatever is reserved now
      
      Not sure this is needed anymore. If the new deposits are higher than
      what is currently on chain and users don't have enough funds to reserve
      what is needed, the extrinisc fails and they're basically grandfathered
      and frozen until they add more funds and/or make a change to their
      identity. This behavior seems fine to me. Original idea
      [here](https://github.com/paritytech/polkadot-sdk/pull/1661#issuecomment-1779606319).
      
      > add an extrinsic to rejig deposits to account for the change above
      
      This was initially implemented but now removed from this PR in favor of
      the implementation detailed
      [here](https://github.com/paritytech/polkadot-sdk/pull/2088
      
      ).
      
      ---------
      
      Signed-off-by: default avatargeorgepisaltu <[email protected]>
      Co-authored-by: default avatarjoepetrowski <[email protected]>
      21fbc00d