Skip to content
Snippets Groups Projects
  1. Jun 06, 2024
  2. Jun 05, 2024
    • Adrian Catangiu's avatar
      fix build on MacOS: bump secp256k1 and secp256k1-sys to patched versions (#4709) · 2460cddf
      Adrian Catangiu authored
      `secp256k1 v0.28.0` and `secp256k1-sys v0.9.0` were yanked because
      building them fails for `aarch64-apple-darwin` targets.
      
      Use the `secp256k1 v0.28.2` and `secp256k1-sys v0.9.2` patched versions
      that build fine on ARM chipset MacOS.
    • 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>
  3. Jun 04, 2024
  4. Jun 03, 2024
  5. Jun 02, 2024
  6. May 31, 2024
  7. May 30, 2024
  8. 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>