Skip to content
  1. Nov 27, 2023
  2. Nov 25, 2023
  3. Nov 24, 2023
    • Dónal Murray's avatar
      Remove `RuntimeApi` dependency on system parachain runtime code (#2455) · d07186b8
      Dónal Murray authored
      
      
      The last issue blocking the removal of the Polkadot and Kusama system
      parachains from the repo in #1737 is the dependency on the runtime code
      through the RuntimeApi in `polkadot-parachain`.
      
      This PR introduces two fake runtimes to satisfy the build requirements
      and changes the `new_partial` function to make it not be generic over
      the runtimes.
      The reason for the second runtime is the different Aura keys used in
      Polkadot Asset Hub, as the impl for AuraApi depends on this type.
      If this changes the `RuntimeApi` generic could be removed completely
      from all functions in `services.rs` and and generic type parameters in
      `services.rs` and specified as a concrete type to TFullClient`.
      
      ---------
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      d07186b8
    • Liam Aharon's avatar
      Remove dmp-queue pallet from Rococo Asset Hub and Bridge Hub (#2483) · 7554f53f
      Liam Aharon authored
      DMP queue migration is complete and the pallet should be removed to fix
      the check runtime upgrade CI.
      
      <img width="1501" alt="Screenshot 2023-11-24 at 16 05 37"
      src="https://github.com/paritytech/polkadot-sdk/assets/16665596/ee1da6bb-2756-4423-8085-1e4c73553ad5">
      
      <img width="1501" alt="Screenshot 2023-11-24 at 16 06 44"
      src="https://github.com/paritytech/polkadot-sdk/assets/16665596/03f3e88f-aed8-4eaa-aab6-7998f72258be">
      7554f53f
    • Xiliang Chen's avatar
      pallet-xcm: ensure xcm outcome is always complete, revert effects otherwise (#2405) · 41631525
      Xiliang Chen authored
      
      
      On extrinsics/call, ensure local XCM execution is complete/successful.
      Otherwise, fail the extrinsic so that state changes don't get committed
      to the db.
      
      Added regression tests that fail without the fix.
      
      fixes #2237
      
      ---------
      
      Co-authored-by: default avatarAdrian Catangiu <[email protected]>
      41631525
  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
    • dependabot[bot]'s avatar
      Bump secp256k1 from 0.24.3 to 0.28.0 (#2357) · 794ee980
      dependabot[bot] authored
      
      
      Bumps [secp256k1](https://github.com/rust-bitcoin/rust-secp256k1) from
      0.24.3 to 0.28.0.
      <details>
      <summary>Changelog</summary>
      <p><em>Sourced from <a
      href="https://github.com/rust-bitcoin/rust-secp256k1/blob/master/CHANGELOG.md">secp256k1's
      changelog</a>.</em></p>
      <blockquote>
      <h1>0.28.0 - 2023-10-23</h1>
      <ul>
      <li>Add bindings to the ElligatorSwift implementation <a
      href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/627">#627</a></li>
      <li>Depend on recent release of <code>bitcoin_hashes</code> v0.13.0 <a
      href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/621">#621</a></li>
      <li>Add a verify function to <code>PublicKey</code> <a
      href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/618">#618</a></li>
      <li>Add serialize function for schnorr::Signature <a
      href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/607">#607</a></li>
      <li>Bump MSRV to 1.48 <a
      href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/595">#595</a></li>
      <li>Remove implementations of <code>PartialEq</code>, <code>Eq</code>,
      <code>PartialOrd</code>, <code>Ord</code>, and <code>Hash</code> from
      the
      <code>impl_array_newtype</code> macro. Users will now need to derive
      these traits if they are wanted.</li>
      </ul>
      <h1>0.27.0 - 2023-03-15</h1>
      <ul>
      <li><a
      href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/588">Depend
      on newly release <code>bitcoin_hashes</code> v0.12</a>.</li>
      <li><a
      href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/578">Implement
      <code>Debug</code> trait for <code>Scalar</code> type</a>.</li>
      <li><a
      href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/582">Implement
      <code>insecure-erase</code></a>.</li>
      </ul>
      <h1>0.26.0 - 2202-12-19</h1>
      <ul>
      <li>Update libsecp25k1 to v0.2.0</li>
      </ul>
      <h1>0.25.0 - 2022-12-07</h1>
      <ul>
      <li><a
      href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/548">Fix
      soundness issue with <code>preallocated_gen_new</code></a></li>
      <li>Update to <code>secp256k1-sys</code> <a
      href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/549">v0.7.0</a></li>
      <li>Use type system to <a
      href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/483">improve
      safety</a>.</li>
      <li><a
      href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/490">Change
      secp256k1-sys symbol names to 0_6_1</a>.</li>
      <li><a
      href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/499">Introduce
      <code>rustfmt</code></a> to the codebase.</li>
      <li><a
      href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/507">Make
      all raw pointer methods go through the CPtr trait</a>.</li>
      <li><a
      href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/518">Make
      comparison functions stable</a>.</li>
      <li><a
      href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/512">Remove</a>
      public constant <code>ONE_KEY</code> (consider using
      <code>FromStr</code> as a replacement).</li>
      </ul>
      <h1>0.24.1 - 2022-10-25</h1>
      <ul>
      <li><a
      href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/issues/491">Fix
      broken deserialization logic of <code>KeyPair</code></a> that previously
      always panicked. After the patch deserialization only panics if neither
      the <code>global-context</code> nor the <code>alloc</code> (default)
      feature is active.</li>
      </ul>
      <h1>0.24.0 - 2022-07-20</h1>
      <ul>
      <li>Upgrade to new release of <a
      href="https://github.com/rust-bitcoin/bitcoin_hashes/releases/tag/0.11.0">bitcoin_hashes</a>.</li>
      </ul>
      <h1>0.23.4 - 2022-07-14</h1>
      <ul>
      <li><a
      href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/474">Disable
      automatic rerandomization of contexts under WASM</a></li>
      </ul>
      <h1>0.23.3 - 2022-06-29</h1>
      <ul>
      <li><a
      href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/465">Add
      must_use for mut self key manipulation methods</a></li>
      <li><a
      href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/466">Fix
      fuzzing feature guard</a></li>
      </ul>
      <h1>0.23.2 - 2022-06-27</h1>
      <!-- raw HTML omitted -->
      </blockquote>
      <p>... (truncated)</p>
      </details>
      <details>
      <summary>Commits</summary>
      <ul>
      <li><a
      href="https://github.com/rust-bitcoin/rust-secp256k1/commit/7de09c8050da12a13ef9ee3850597f69c887952d"><code>7de09c8</code></a>
      Merge <a
      href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/issues/256">rust-bitcoin/rust-secp256k1256</a>:
      Tracking PR for release: `secp256k1 v0...</li>
      <li><a
      href="https://github.com/rust-bitcoin/rust-secp256k1/commit/3dc5b165401f249c01a88cec54061301cffd97a0"><code>3dc5b16</code></a>
      Bump version to v0.28.0</li>
      <li><a
      href="https://github.com/rust-bitcoin/rust-secp256k1/commit/3aada83180beec2b9f5ab8e7b9280a5517d3bcde"><code>3aada83</code></a>
      Merge <a
      href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/issues/256">rust-bitcoin/rust-secp256k1256</a>:
      Add bindings to the ElligatorSwift imp...</li>
      <li><a
      href="https://github.com/rust-bitcoin/rust-secp256k1/commit/39febcb866ce285d53052a3636602f04483aa710"><code>39febcb</code></a>
      Create rust-bidings</li>
      <li><a
      href="https://github.com/rust-bitcoin/rust-secp256k1/commit/da4f67b274c3061717723a568cfb182e4e2e7cce"><code>da4f67b</code></a>
      Merge <a
      href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/issues/256">rust-bitcoin/rust-secp256k1256</a>:
      Update vendored lib secp256k1 to v0.4.0</li>
      <li><a
      href="https://github.com/rust-bitcoin/rust-secp256k1/commit/80b2a8d4aa6ffa72041d569eab2278cd8c1ace2a"><code>80b2a8d</code></a>
      Update vendored libsecp to v0.4.0</li>
      <li><a
      href="https://github.com/rust-bitcoin/rust-secp256k1/commit/d2285c929a086276ce6d1670d795c49191e30c65"><code>d2285c9</code></a>
      ci: Remove MIPS* from CI</li>
      <li><a
      href="https://github.com/rust-bitcoin/rust-secp256k1/commit/0d58f50d523b40a78de0b87146208e3ad338c8ba"><code>0d58f50</code></a>
      ci: generalize grp in &quot;illegal callback&quot; test</li>
      <li><a
      href="https://github.com/rust-bitcoin/rust-secp256k1/commit/acf9ac13e9f8df84dd52d2f012cda7211a6af10c"><code>acf9ac1</code></a>
      delete <code>test_manual_create_destroy</code> test</li>
      <li><a
      href="https://github.com/rust-bitcoin/rust-secp256k1/commit/04ce50891bb0d49be5355f5c0d82db70d7dda65a"><code>04ce508</code></a>
      lib: fix bad unit test</li>
      <li>Additional commits viewable in <a
      href="https://github.com/rust-bitcoin/rust-secp256k1/compare/secp256k1-0.24.3...secp256k1-0.28.0">compare
      view</a></li>
      </ul>
      </details>
      <br />
      
      
      [![Dependabot compatibility
      score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=secp256k1&package-manager=cargo&previous-version=0.24.3&new-version=0.28.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
      
      Dependabot will resolve any conflicts with this PR as long as you don't
      alter it yourself. You can also trigger a rebase manually by commenting
      `@dependabot rebase`.
      
      [//]: # (dependabot-automerge-start)
      [//]: # (dependabot-automerge-end)
      
      ---
      
      <details>
      <summary>Dependabot commands and options</summary>
      <br />
      
      You can trigger Dependabot actions by commenting on this PR:
      - `@dependabot rebase` will rebase this PR
      - `@dependabot recreate` will recreate this PR, overwriting any edits
      that have been made to it
      - `@dependabot merge` will merge this PR after your CI passes on it
      - `@dependabot squash and merge` will squash and merge this PR after
      your CI passes on it
      - `@dependabot cancel merge` will cancel a previously requested merge
      and block automerging
      - `@dependabot reopen` will reopen this PR if it is closed
      - `@dependabot close` will close this PR and stop Dependabot recreating
      it. You can achieve the same result by closing it manually
      - `@dependabot show <dependency name> ignore conditions` will show all
      of the ignore conditions of the specified dependency
      - `@dependabot ignore <dependency name> major version` will close this
      group update PR and stop Dependabot creating any more for the specific
      dependency's major version (unless you unignore this specific
      dependency's major version or upgrade to it yourself)
      - `@dependabot ignore <dependency name> minor version` will close this
      group update PR and stop Dependabot creating any more for the specific
      dependency's minor version (unless you unignore this specific
      dependency's minor version or upgrade to it yourself)
      - `@dependabot ignore <dependency name>` will close this group update PR
      and stop Dependabot creating any more for the specific dependency
      (unless you unignore this specific dependency or upgrade to it yourself)
      - `@dependabot unignore <dependency name>` will remove all of the ignore
      conditions of the specified dependency
      - `@dependabot unignore <dependency name> <ignore condition>` will
      remove the ignore condition of the specified dependency and ignore
      conditions
      
      
      </details>
      
      ---------
      
      Signed-off-by: default avatardependabot[bot] <[email protected]>
      Co-authored-by: default avatardependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
      Co-authored-by: default avatarLiam Aharon <[email protected]>
      794ee980
  9. Nov 17, 2023
    • Davide Galassi's avatar
      Bump bandersnatch VRF revision (#2389) · 1d1c3719
      Davide Galassi authored
      Closes https://github.com/paritytech/polkadot-sdk/issues/2327
      
      cc @burdges
      1d1c3719
    • Nazar Mokrynskyi's avatar
      Do not panic if the `fdlimit` call to increase the file descriptor limit fails (#2155) · 079b14f6
      Nazar Mokrynskyi authored
      
      
      # Description
      
      Sometimes changing file descriptor limits is not allowed, but there is
      no need to crash the node if/when this happens. Since `fdlimit`'s author
      decided to use panics instead of returning `Result`, we need to catch
      it.
      
      # Checklist
      
      - [x] My PR includes a detailed description as outlined in the
      "Description" section above
      - [ ] My PR follows the [labeling requirements](CONTRIBUTING.md#Process)
      of this project (at minimum one label for `T`
        required)
      - [ ] I have made corresponding changes to the documentation (if
      applicable)
      - [ ] I have added tests that prove my fix is effective or that my
      feature works (if applicable)
      
      ---------
      
      Co-authored-by: default avatarKoute <[email protected]>
      079b14f6
    • Michal Kucharczyk's avatar
      crypto: `lazy_static` removed, light parser for address URI added (#2250) · 5007e2dd
      Michal Kucharczyk authored
      
      
      The `lazy_static` package does not work well in `no-std`: it requires
      `spin_no_std` feature, which also will propagate into `std` if enabled.
      This is not what we want.
      
      This PR provides simple address uri parser which allows to get rid of
      _regex_ which was used to parse the address uri, what in turns allows to
      remove lazy_static.
      
      Three regular expressions
      (`SS58_REGEX`,`SECRET_PHRASE_REGEX`,`JUNCTION_REGEX`) were replaced with
      the parser which unifies all of them.
      
      The new parser does not support Unicode, it is ASCII only.
      
      Related to: #2044
      
      ---------
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      Co-authored-by: default avatarKoute <[email protected]>
      Co-authored-by: command-bot <>
      5007e2dd
  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 ...
      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
    • Michal Kucharczyk's avatar
      `chain-spec`: getting ready for native-runtime-free world (#1256) · 8ba7a6ab
      Michal Kucharczyk authored
      
      
      This PR prepares chains specs for _native-runtime-free_  world.
      
      This PR has following changes:
      - `substrate`:
        - adds support for:
      - JSON based `GenesisConfig` to `ChainSpec` allowing interaction with
      runtime `GenesisBuilder` API.
      - interacting with arbitrary runtime wasm blob to[
      `chain-spec-builder`](https://github.com/paritytech/substrate/blob/3ef576eaeb3f42610e85daecc464961cf1295570/bin/utils/chain-spec-builder/src/lib.rs#L46)
      command line util,
      - removes
      [`code`](https://github.com/paritytech/substrate/blob/3ef576eaeb3f42610e85daecc464961cf1295570/frame/system/src/lib.rs#L660)
      from `system_pallet`
        - adds `code` to the `ChainSpec`
      - deprecates
      [`ChainSpec::from_genesis`](https://github.com/paritytech/substrate/blob/3ef576eaeb3f42610e85daecc464961cf1295570/client/chain-spec/src/chain_spec.rs#L263),
      but also changes the signature of this method extending it with `code`
      argument.
      [`ChainSpec::builder()`](https://github.com/paritytech/substrate/blob/20bee680ed098be7239cf7a6b804cd4de267983e/client/chain-spec/src/chain_spec.rs#L507)
      should be used instead.
      - `polkadot`:
      - all references to `RuntimeGenesisConfig` in `node/service` are
      removed,
      - all
      `(kusama|polkadot|versi|rococo|wococo)_(staging|dev)_genesis_config`
      functions now return the JSON patch for default runtime `GenesisConfig`,
        - `ChainSpecBuilder` is used, `ChainSpec::from_genesis` is removed,
      
      - `cumulus`:
        - `ChainSpecBuilder` is used, `ChainSpec::from_genesis` is removed,
      - _JSON_ patch configuration used instead of `RuntimeGenesisConfig
      struct` in all chain specs.
        
      ---------
      
      Co-authored-by: command-bot <>
      Co-authored-by: default avatarJavier Viola <[email protected]>
      Co-authored-by: default avatarDavide Galassi <[email protected]>
      Co-authored-by: default avatarFrancisco Aguirre <[email protected]>
      Co-authored-by: default avatarKevin Krone <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      8ba7a6ab
  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