Skip to content
Snippets Groups Projects
  1. Jun 05, 2024
    • Oliver Tale-Yazdi's avatar
      Unify dependency aliases (#4633) · d2fd5364
      Oliver Tale-Yazdi authored
      
      Inherited workspace dependencies cannot be renamed by the crate using
      them (see [1](https://github.com/rust-lang/cargo/issues/12546),
      [2](https://stackoverflow.com/questions/76792343/can-inherited-dependencies-in-rust-be-aliased-in-the-cargo-toml-file)).
      Since we want to use inherited workspace dependencies everywhere, we
      first need to unify all aliases that we use for a dependency throughout
      the workspace.
      The umbrella crate is currently excluded from this procedure, since it
      should be able to export the crates by their original name without much
      hassle.
      
      For example: one crate may alias `parity-scale-codec` to `codec`, while
      another crate does not alias it at all. After this change, all crates
      have to use `codec` as name. The problematic combinations were:
      - conflicting aliases: most crates aliases as `A` but some use `B`.
      - missing alias: most of the crates alias a dep but some dont.
      - superfluous alias: most crates dont alias a dep but some do.
      
      The script that i used first determines whether most crates opted to
      alias a dependency or not. From that info it decides whether to use an
      alias or not. If it decided to use an alias, the most common one is used
      everywhere.
      
      To reproduce, i used
      [this](https://github.com/ggwpez/substrate-scripts/blob/master/uniform-crate-alias.py)
      python script in combination with
      [this](https://github.com/ggwpez/zepter/blob/38ad10585fe98a5a86c1d2369738bc763a77057b/renames.json)
      error output from Zepter.
      
      ---------
      
      Signed-off-by: default avatarOliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
      Co-authored-by: default avatarBastian Köcher <git@kchr.de>
    • ordian's avatar
      statement-distribution: prep for re-enabling (#4431) · 0d661eac
      ordian authored
      In preparation for launching re-enabling
      (https://github.com/paritytech/polkadot-sdk/issues/2418), we need to
      adjust the disabling strategy of statement-distribution to use the relay
      parent's state instead of the latest state (union of active leaves).
      This will also ensure no raciness of getting the latest state vs
      accepting statements from disabling validators at the cost of being more
      lenient/potentially accepting more statements from disabled validators.
      
      - [x] PRDoc
    • Oliver Tale-Yazdi's avatar
      Rococo AH: cleanup storage (#4444) · d1299683
      Oliver Tale-Yazdi authored
      
      Follow up on #4414 to clean up the old storage.
      
      ---------
      
      Signed-off-by: default avatarOliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
    • Michal Kucharczyk's avatar
      chain-spec-doc: some minor fixes (#4700) · f65beb7f
      Michal Kucharczyk authored
      some minor text fixes.
    • Przemek Rzad's avatar
      Update the `polkadot_builder` Dockerfile (#4638) · 8ffe2290
      Przemek Rzad authored
      
      This Dockerfile seems outdated - it currently fails to build (on my
      machine).
      I don't see it being built anywhere on CI.
      
      I did a couple of tweaks to make it build.
      
      ---------
      
      Co-authored-by: default avatarAlexander Samusev <41779041+alvicsam@users.noreply.github.com>
    • georgepisaltu's avatar
      [Identity] Remove double encoding username signature payload (#4646) · 3977f389
      georgepisaltu authored
      In order to receive a username in `pallet-identity`, users have to,
      among other things, provide a signature of the desired username. Right
      now, there is an [extra encoding
      step](https://github.com/paritytech/polkadot-sdk/blob/4ab078d6
      
      /substrate/frame/identity/src/lib.rs#L1119)
      when generating the payload to sign.
      
      Encoding a `Vec` adds extra bytes related to the length, which changes
      the payload. This is unnecessary and confusing as users expect the
      payload to sign to be just the username bytes. This PR fixes this issue
      by validating the signature directly against the username bytes.
      
      ---------
      
      Signed-off-by: default avatargeorgepisaltu <george.pisaltu@parity.io>
  2. Jun 04, 2024
  3. Jun 03, 2024
  4. Jun 02, 2024
  5. May 31, 2024
  6. May 30, 2024
  7. May 29, 2024
    • Bastian Köcher's avatar
      pallet-staking: Put tests behind `cfg(debug_assertions)` (#4620) · 4ab078d6
      Bastian Köcher authored
      Otherwise these tests are failing if you don't run with
      `debug_assertions` enabled, which happens if you run tests locally in
      release mode.
    • eskimor's avatar
      Broker new price adapter (#4521) · f4dc8d22
      eskimor authored
      
      Fixes #4360 
      
      Also rename: AllowedRenewals -> PotentialRenewals to avoid confusion of
      future readers. (An entry in `AllowedRenewals` is not enough to allow a
      renewal, the assignment also has to be complete, which is only checked
      afterwards.)
      
      - [x] Does not work with renewals as is - fix.
      - [x] More tests
      - [x] PR docs
      
      Edit 1:
      (Relevant blog post:
      https://grillapp.net/12935/agile-coretime-pricing-explained-166522?ref=29715)
      
      ---------
      
      Co-authored-by: default avatareskimor <eskimor@no-such-url.com>
      Co-authored-by: default avatarDónal Murray <donal.murray@parity.io>
      Co-authored-by: command-bot <>
    • Francisco Aguirre's avatar
      Change `XcmDryRunApi::dry_run_extrinsic` to take a call instead (#4621) · d5053ac4
      Francisco Aguirre authored
      
      Follow-up to the new `XcmDryRunApi` runtime API introduced in
      https://github.com/paritytech/polkadot-sdk/pull/3872.
      
      Taking an extrinsic means the frontend has to sign first to dry-run and
      once again to submit.
      This is bad UX which is solved by taking an `origin` and a `call`.
      This also has the benefit of being able to dry-run as any account, since
      it needs no signature.
      
      This is a breaking change since I changed `dry_run_extrinsic` to
      `dry_run_call`, however, this API is still only on testnets.
      The crates are bumped accordingly.
      
      As a part of this PR, I changed the name of the API from `XcmDryRunApi`
      to just `DryRunApi`, since it can be used for general dry-running :)
      
      Step towards https://github.com/paritytech/polkadot-sdk/issues/690.
      
      Example of calling the API with PAPI, not the best code, just testing :)
      
      ```ts
      // We just build a call, the arguments make it look very big though.
      const call = localApi.tx.XcmPallet.transfer_assets({
        dest: XcmVersionedLocation.V4({ parents: 0, interior: XcmV4Junctions.X1(XcmV4Junction.Parachain(1000)) }),
        beneficiary: XcmVersionedLocation.V4({ parents: 0, interior: XcmV4Junctions.X1(XcmV4Junction.AccountId32({ network: undefined, id: Binary.fromBytes(encodeAccount(account.address)) })) }),
        weight_limit: XcmV3WeightLimit.Unlimited(),
        assets: XcmVersionedAssets.V4([{
          id: { parents: 0, interior: XcmV4Junctions.Here() },
          fun: XcmV3MultiassetFungibility.Fungible(1_000_000_000_000n) }
        ]),
        fee_asset_item: 0,
      });
      // We call the API passing in a signed origin 
      const result = await localApi.apis.XcmDryRunApi.dry_run_call(
        WestendRuntimeOriginCaller.system(DispatchRawOrigin.Signed(account.address)),
        call.decodedCall
      );
      if (result.success && result.value.execution_result.success) {
        // We find the forwarded XCM we want. The first one going to AssetHub in this case.
        const xcmsToAssetHub = result.value.forwarded_xcms.find(([location, _]) => (
          location.type === "V4" &&
            location.value.parents === 0 &&
            location.value.interior.type === "X1"
            && location.value.interior.value.type === "Parachain"
            && location.value.interior.value.value === 1000
        ))!;
      
        // We can even find the delivery fees for that forwarded XCM.
        const deliveryFeesQuery = await localApi.apis.XcmPaymentApi.query_delivery_fees(xcmsToAssetHub[0], xcmsToAssetHub[1][0]);
      
        if (deliveryFeesQuery.success) {
          const amount = deliveryFeesQuery.value.type === "V4" && deliveryFeesQuery.value.value[0].fun.type === "Fungible" && deliveryFeesQuery.value.value[0].fun.value.valueOf() || 0n;
          // We store them in state somewhere.
          setDeliveryFees(formatAmount(BigInt(amount)));
        }
      }
      ```
      
      ---------
      
      Co-authored-by: default avatarBastian Köcher <git@kchr.de>
    • Joshua Cheong's avatar
      Update README.md (#4623) · aa32faae
      Joshua Cheong authored
      
      Minor edit to a broken link for Rust Docs on the README.md
      
      Co-authored-by: default avatarKian Paimani <5588131+kianenigma@users.noreply.github.com>
    • Kian Paimani's avatar
      Publish `chain-spec-builder` (#4518) · dfcfa4ab
      Kian Paimani authored
      
      marking it as release-able, attaching the same version number that is
      attached to other binaries such as `polkadot` and `polkadot-parachain`.
      
      I have more thoughts about the version number, though. The chain-spec
      builder is mainly a user of the `sp-genesis-builder` api. So the
      versioning should be such that it helps users know give a version of
      `sp-genesis-builder` in their runtime, which version of
      `chain-spec-builder` should they use?
      
      With this, we can possibly alter the version number to always match
      `sp-genesis-builder`.
      
      Fixes https://github.com/paritytech/polkadot-sdk/issues/4352
      
      - [x] Add to release artifacts ~~similar to
      https://github.com/paritytech/polkadot-sdk/pull/4405~~ done here:
      https://github.com/paritytech/polkadot-sdk/pull/4557
      
      ---------
      
      Co-authored-by: default avatarBranislav Kontur <bkontur@gmail.com>
    • Egor_P's avatar
      Add omni bencher & chain-spec-builder bins to release (#4557) · 89604daa
      Egor_P authored
      
      Closes: https://github.com/paritytech/polkadot-sdk/issues/4354
      
      This PR adds the steps to build and attach `frame-omni-bencher` and
      `chain-spec-builder` binaries to the release draft
      
      ## TODO
      - [x] add also chain-spec-builder binary
      - [ ] ~~check/investigate Kian's comment: `chain spec builder. Ideally I
      want it to match the version of the sp-genesis-builder crate`~~ see
      [comment](https://github.com/paritytech/polkadot-sdk/pull/4518#issuecomment-2134731355)
      - [ ] Backport to `polkadot-sdk@1.11` release, so we can use it for next
      fellows release: https://github.com/polkadot-fellows/runtimes/pull/324
      - [ ] Backport to `polkadot-sdk@1.12` release
      
      ---------
      
      Co-authored-by: default avatarBranislav Kontur <bkontur@gmail.com>
    • gupnik's avatar
      Moves runtime macro out of experimental flag (#4249) · 5f68c930
      gupnik authored
      
      Step in https://github.com/paritytech/polkadot-sdk/issues/3688
      
      Now that the `runtime` macro (Construct Runtime V2) has been
      successfully deployed on Westend, this PR moves it out of the
      experimental feature flag and makes it generally available for runtime
      devs.
      
      ---------
      
      Co-authored-by: default avatarBastian Köcher <git@kchr.de>
      Co-authored-by: default avatarKian Paimani <5588131+kianenigma@users.noreply.github.com>
  8. May 28, 2024
    • Przemek Rzad's avatar
      Filter workspace dependencies in the templates (#4599) · d6cf147c
      Przemek Rzad authored
      This detaches the templates from monorepo's workspace dependencies.
      
      Currently the templates [re-use the monorepo's
      dependencies](https://github.com/paritytech/polkadot-sdk-minimal-template/blob/bd8afe66ec566d61f36b0e3d731145741a9e9e19/Cargo.toml#L45-L58),
      most of which are not needed.
      
      The simplest approach is to specify versions directly and not use
      workspace dependencies in the templates.
      
      Another approach would be to programmatically filter dependencies that
      are actually needed - but not sure if it's worth it, given that it would
      complicate the synchronization job.
      
      cc @Kianenigma @gupnik
    • Bastian Köcher's avatar
      parachain-inherent: Make `para_id` more prominent (#4555) · 2b1c606a
      Bastian Köcher authored
      This should make it more obvious that at instantiation of the
      `MockValidationDataInherentDataProvider` the `para_id` needs to be
      passed.