1. Oct 27, 2023
  2. Oct 26, 2023
    • yjh's avatar
      add `authorities_len` for aura (#2040) · 86228fa4
      yjh authored
      86228fa4
    • Bastian Köcher's avatar
      sp-version: Improve the docs (#2027) · 42707bc9
      Bastian Köcher authored
      
      
      Co-authored-by: default avatarordian <[email protected]>
      42707bc9
    • Alin Dima's avatar
      cumulus: fix test runtimes panic (#2039) · 1b08bdd2
      Alin Dima authored
      the min slot duration should be 0 only if the `experimental` feature is
      enabled. otherwise, the runtime will panic on a division by 0.
      1b08bdd2
    • Dastan's avatar
      Expose collection attributes from `Inspect` trait (#1914) · 0bcebac4
      Dastan authored
      # Description
      
      - What does this PR do?
      
      While working with `pallet_nfts` through `nonfungibles_v2` traits
      `Inspect, Mutate`, I found out that once you have set the collection
      attribute with `<Nfts as Mutate>::set_collection_attribute()`, it's not
      possible to read it with `<Nfts as Inspect>::collection_attribute()`
      since they use different `namespace` values. When setting the attribute,
      `AttributeNamespace::Pallet` is used, while
      `AttributeNamespace::CollectionOwner` is used when reading.
      
      more context:
      https://github.com/freeverseio/laos/issues/7#issuecomment-1766137370
      
      This PR makes `item` an optional parameter in
      `Inspect::system_attribute()`, to be able to read collection attributes.
      
      - Why are these changes needed?
      
      To be able to read collection level attributes when reading attributes
      of the collection. It will be possible to read collection attributes by
      passing `None` for `item`
      
      - How were these changes implemented and what do they affect?
      
      `NftsApi` is also affected and `NftsApi::system_attribute()` now accepts
      optional `item` parameter.
      
      ## Breaking change
      
      Because of the change in the `NftsApi::system_attribute()` method's
      `item` param, parachains who integrated the `NftsApi` need to update
      their API code and frontend integrations accordingly. AssetHubs are
      unaffected since the NftsApi wasn't released on those parachains yet.
      0bcebac4
  3. Oct 25, 2023
    • Oliver Tale-Yazdi's avatar
    • Xiliang Chen's avatar
      publish pallet-root-testing (#2017) · b7a8532d
      Xiliang Chen authored
      so we can use it in our tests
      b7a8532d
    • PG Herveou's avatar
      Contracts: Add benchmarks to include files (#2022) · 3148063a
      PG Herveou authored
      Project that includes pallet-contracts via crates.io will fail to run 
      ```bash
      cargo check --features=runtime-benchmarks
      ```
      
      without the currently not included benchmarks files
      3148063a
    • Liam Aharon's avatar
      Small optimisation to `--profile dev` wasm builds (#1851) · ff3a3bca
      Liam Aharon authored
      `wasm-builder` was adjusted to default to building wasm blobs in
      `release` mode even when cargo is in `debug` because `debug` wasm is too
      slow.
      
      A side effect of this was `.compact` and `.compact.compressed` getting
      built when the dev is running build in `debug`, adding ~5s to the build
      time of every wasm runtime.
      
      I think it's reasonable to assume if the dev is running `debug` build
      they want to optimise speed and do not care about the size of the wasm
      binary. Compacting a blob has negligible impact on its actual
      performance.
      
      In this PR, I adjusted the behavior of the wasm builder so it does not
      produce `.compact` or `.compact.compressed` wasm when the user is
      running in `debug`. The builder will continue to produce the bloaty wasm
      in release mode unless it is overriden with an env var.
      
      As suggested by @koute in review, also refactored the
      `maybe_compact_wasm_and_copy_blobs` into multiple funuctions, and
      renamed things to better support RISC-V in the future.
      
      ---
      
      There is no `T-runtime` label so @KiChjang
      
       told me to put `T1-FRAME` :)
      
      ---------
      
      Co-authored-by: default avatarKoute <[email protected]>
      ff3a3bca
  4. Oct 24, 2023
  5. Oct 23, 2023
  6. Oct 22, 2023
    • Bastian Köcher's avatar
      sc-executor: Increase maximum instance count (#1856) · e2b21d00
      Bastian Köcher authored
      
      
      Changes the maximum instances count for `wasmtime` to `64`. It also
      allows to only pass in maximum `32` for `--max-runtime-instances` as
      `256` was way too big. With `64` instances in total and `32` that can be
      configured in maximum, there should be enough space to accommodate for
      extra instances that are may required to be allocated adhoc.
      
      ---------
      
      Co-authored-by: default avatarKoute <[email protected]>
      e2b21d00
  7. Oct 20, 2023
  8. Oct 19, 2023
  9. Oct 18, 2023
    • Keith Yeung's avatar
      Introduce XcmFeesToAccount fee manager (#1234) · 3dece311
      Keith Yeung authored
      
      
      Combination of paritytech/polkadot#7005, its addon PR
      paritytech/polkadot#7585 and its companion paritytech/cumulus#2433.
      
      This PR introduces a new XcmFeesToAccount struct which implements the
      `FeeManager` trait, and assigns this struct as the `FeeManager` in the
      XCM config for all runtimes.
      
      The struct simply deposits all fees handled by the XCM executor to a
      specified account. In all runtimes, the specified account is configured
      as the treasury account.
      
      XCM __delivery__ fees are now being introduced (unless the root origin
      is sending a message to a system parachain on behalf of the originating
      chain).
      
      # Note for reviewers
      
      Most file changes are tests that had to be modified to account for the
      new fees.
      Main changes are in:
      - cumulus/pallets/xcmp-queue/src/lib.rs <- To make it track the delivery
      fees exponential factor
      - polkadot/xcm/xcm-builder/src/fee_handling.rs <- Added. Has the
      FeeManager implementation
      - All runtime xcm_config files <- To add the FeeManager to the XCM
      configuration
      
      # Important note
      
      After this change, instructions that create and send a new XCM (Query*,
      Report*, ExportMessage, InitiateReserveWithdraw, InitiateTeleport,
      DepositReserveAsset, TransferReserveAsset, LockAsset and RequestUnlock)
      will require the corresponding origin account in the origin register to
      pay for transport delivery fees, and the onward message will fail to be
      sent if the origin account does not have the required amount. This
      delivery fee is on top of what we already collect as tx fees in
      pallet-xcm and XCM BuyExecution fees!
      
      Wallet UIs that want to expose the new delivery fee can do so using the
      formula:
      
      ```
      delivery_fee_factor * (base_fee + encoded_msg_len * per_byte_fee)
      ```
      
      where the delivery fee factor can be obtained from the corresponding
      pallet based on which transport you are using (UMP, HRMP or bridges),
      the base fee is a constant, the encoded message length from the message
      itself and the per byte fee is the same as the configured per byte fee
      for txs (i.e. `TransactionByteFee`).
      
      ---------
      
      Co-authored-by: default avatarBranislav Kontur <[email protected]>
      Co-authored-by: default avatarjoe petrowski <[email protected]>
      Co-authored-by: default avatarGiles Cope <[email protected]>
      Co-authored-by: command-bot <>
      Co-authored-by: default avatarFrancisco Aguirre <[email protected]>
      Co-authored-by: default avatarLiam Aharon <[email protected]>
      Co-authored-by: default avatarKian Paimani <[email protected]>
      3dece311
    • alexd10s's avatar
      Trading trait and deal with metadata in Mutate trait for nonfungibles_v2 (#1561) · 3aaf62ad
      alexd10s authored
      I have added some Traits that are missing and are useful for dealing
      with non-fungible tokens on other pallets and their implementations for
      NFTs pallet.
      
      - In the Mutate trait, added methods for dealing with the metadata:
      `set_metadata`, `set_collection_metadata`, `clear_metadata` and
      `clear_collection_metadata`.
      The motivation of adding this methods coming from a StackExchange
      question asking for it: [Setting metadata of an item of the Nfts pallet
      in a custom
      pallet](https://substrate.stackexchange.com/questions/9974/setting-metadata-of-an-item-of-the-nfts-pallet-in-a-custom-pallet)
      
      - A Trait for trading non-fungible items. The methods in that Trait are
      `buy_item`, `set_price` and `item_price`
      An example of where this Trait can be useful is a pallet that deals with
      [NFT
      Royalties](https://forum.polkadot.network/t/nfts-royalty-pallet/3766
      
      )
      and needs to perform this actions.
      
      ---------
      
      Co-authored-by: default avatarJegor Sidorenko <[email protected]>
      3aaf62ad
  10. Oct 17, 2023
  11. Oct 16, 2023
  12. Oct 15, 2023
    • Gonçalo Pestana's avatar
      Refactor staking ledger (#1484) · 8ee4042c
      Gonçalo Pestana authored
      This PR refactors the staking ledger logic to encapsulate all reads and
      mutations of `Ledger`, `Bonded`, `Payee` and stake locks within the
      `StakingLedger` struct implementation.
      
      With these changes, all the reads and mutations to the `Ledger`, `Payee`
      and `Bonded` storage map should be done through the methods exposed by
      StakingLedger to ensure the data and lock consistency of the operations.
      The new introduced methods that mutate and read Ledger are:
      
      - `ledger.update()`: inserts/updates a staking ledger in storage;
      updates staking locks accordingly (and ledger.bond(), which is synthatic
      sugar for ledger.update())
      - `ledger.kill()`: removes all Bonded and StakingLedger related data for
      a given ledger; updates staking locks accordingly;
      `StakingLedger::get(account)`: queries both the `Bonded` and `Ledger`
      storages and returns a `Option<StakingLedger>`. The pallet impl exposes
      fn ledger(account) as synthatic sugar for `StakingLedger::get(account)`.
      
      Retrieving a ledger with `StakingLedger::get()` can be done by providing
      either a stash or controller account. The input must be wrapped in a
      `StakingAccount` variant (Stash or Controller) which is treated
      accordingly. This simplifies the caller API but will eventually be
      deprecated once we completely get rid of the controller account in
      staking. However, this refactor will help with the work necessary when
      completely removing the controller.
      
      Other goals:
      
      - No logical changes have been introduced in this PR;
      - No breaking changes or updates in wallets required;
      - No new storage items or need to perform storage migrations;
      - Centralise the changes to bonds and ledger updates to simplify the
      OnStakingUpdate updates to the target list (related to
      https://github.com/paritytech/polkadot-sdk/issues/443)
      
      Note: it would be great to prevent or at least raise a warning if
      `Ledger<T>`, `Payee<T>` and `Bonded<T>` storage types are accessed
      outside the `StakingLedger` implementation. This PR should not get
      blocked by that feature, but there's a tracking issue here
      https://github.com/paritytech/polkadot-sdk/issues/149
      
      Related and step towards
      https://github.com/paritytech/polkadot-sdk/issues/443
      8ee4042c
    • drskalman's avatar
      Paired-key Crypto Scheme (#1705) · 1b34571c
      drskalman authored
      
      
      BEEFY needs two cryptographic keys at the same time. Validators should
      sign BEEFY payload using both ECDSA and BLS key. The network will gossip
      a payload which contains a valid ECDSA key. The prover nodes aggregate
      the BLS keys if aggregation fails to verifies the validator which
      provided a valid ECDSA signature but an invalid BLS signature is subject
      to slashing.
      
      As such BEEFY session should be initiated with both key. Currently there
      is no straight forward way of doing so, beside having a session with
      RuntimeApp corresponding to a crypto scheme contains both keys.
      
      This pull request implement a generic paired_crypto scheme as well as
      implementing it for (ECDSA, BLS) pair.
      
      ---------
      
      Co-authored-by: default avatarDavide Galassi <[email protected]>
      Co-authored-by: default avatarRobert Hambrock <[email protected]>
      1b34571c
    • S E R A Y A's avatar
      add link to rfc-0001 in broker README (#1862) · c9b51cd4
      S E R A Y A authored
      # Description
      - What does this PR do?
        - link added
      - Why are these changes needed?
        - improve docs
      - How were these changes implemented and what do they affect?
        - only concerns docs
      c9b51cd4