1. Oct 16, 2023
  2. Oct 15, 2023
  3. Oct 14, 2023
    • Julian Eager's avatar
      Discard `Executor` (#1855) · 9f7656df
      Julian Eager authored
      
      
      closes #622 
      
      Pros:
      * simpler interface, just functions:
      `create_runtime_from_artifact_bytes()` and `execute_artifact()`
      
      Cons:
      * extra overhead of constructing executor semantics each time
      
      I could make it a combination of
      * `create_runtime_config(params)` (such that we could clone the
      constructed semantics)
      * `create_runtime(blob, config)`
      * `execute_artifact(blob, config, params)`
      
      Not sure if it's worth it though.
      
      ---------
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      9f7656df
    • juangirini's avatar
      Macros to use path instead of ident (#1474) · 7c87d61f
      juangirini authored
      7c87d61f
  4. Oct 13, 2023
  5. Oct 12, 2023
  6. Oct 11, 2023
  7. Oct 10, 2023
    • Sam Johnson's avatar
      upgrade to macro_magic 0.4.3 (#1832) · 5adcb3e1
      Sam Johnson authored
      # Description
      
      Upgrades `macro_magic` to 0.4.3, which introduces the ability to have
      `export_tokens` use the same name as the underlying item for its
      auto-generated macro name. Ultimately this will allow for better dev ux
      in our derive_impl feature.
      5adcb3e1
    • Keith Yeung's avatar
      3f5edc52
    • Liam Aharon's avatar
      remote-ext: fix state download stall on slow connections and reduce memory usage (#1295) · 55f35442
      Liam Aharon authored
      Original PR https://github.com/paritytech/substrate/pull/14746
      
      ---
      
      ## Fixing stall
      
      ### Introduction
      I experienced an apparent stall downloading state from
      `https://rococo-try-runtime-node.parity-chains.parity.io:443` which was
      having networking difficulties only responding to my JSONRPC requests
      with 50-200KB/s of bandwidth.
      
      This PR fixes the issue causing the stall, and generally improves
      performance remote-ext when it downloads state by greatly reducing the
      chances of a timeout occuring.
      
      ### Description
      Introduces a new `REQUEST_DURATION_TARGET` constant and modifies
      `get_storage_data_dynamic_batch_size` to
      
      - Increase or decrease the batch size of the next request depending on
      whether the elapsed time of the last request was gt or lt the target
      - Reset the batch size to 1 if the request times out
      
      This fixes an issue on slow connections that can otherwise cause
      multiple timeouts and a stalled download when:
      
      1. The batch size increases rapidly as remote-ext downloads keys with
      small associated storage values
      2. remote-ext tries to process a large series of subsequent keys all
      with extremely large associated storage values (Rococo has a series of
      keys 1-5MB large)
      3. The huge storage values download for 5 minutes until the request
      times out
      4. The partially downloaded keys are thrown out and remote-ext tries
      again with a smaller batch size, but the batch size is still far too
      large and takes 5 minutes to be reduced again
      5. The download will be essentially stalled for many hours while the
      above step cycles
      
      
      After this PR, the request size will
      
      - Not grow as large to begin with, as it is regulated downwards as the
      request duration exceeds the target
      - Drop immediately to 1 if the request times out. A timeout indicates
      the keys next in line to download have extremely large storage values
      compared to previously downloaded keys, and we need to reset the batch
      size to figure out what our new ideal batch size is. By not resetting
      down to 1, we risk the next request timing out again.
      
      ## Reducing memory
      
      As suggested by @bkchr, I adjusted `get_storage_data_dynamic_batch_size`
      from being recursive to a loop which allows removing a bunch of clones
      that were chewing through a lot of memory. I noticed actually it was
      using up to 50GB swap previously when downloading Polkadot keys on a
      slow connection, because it needed to recurse and clone a lot.
      
      After this change it uses only ~1.5GB memory.
      55f35442
    • Bulat Saifullin's avatar
      Update testnet bootnode dns name (#1712) · 373b8ac7
      Bulat Saifullin authored
      # Description
      Update the DNS name of bootnodes to unify the deployment. 
      
      Each bootnode have 3 port exposed: `30333, 30334, 443`. Before, we had
      different DNS names for `30333, 30334` and `443` ports. It may confuse
      people and give the impression that it is two different nodes. Fixing it
      by using a single domain for all
      373b8ac7
    • Oliver Tale-Yazdi's avatar
      [FRAME] Warn on unchecked weight witness (#1818) · 64877492
      Oliver Tale-Yazdi authored
      Adds a warning to FRAME pallets when a function argument that starts
      with `_` is used in the weight formula.
      This is in most cases an error since the weight witness needs to be
      checked.
      
      Example:
      
      ```rust
      #[pallet::call_index(0)]
      #[pallet::weight(T::SystemWeightInfo::remark(_remark.len() as u32))]
      pub fn remark(_origin: OriginFor<T>, _remark: Vec<u8>) -> DispatchResultWithPostInfo {
      	Ok(().into())
      }
      ```
      
      Produces this warning:
      
      ```pre
      warning: use of deprecated constant `pallet::warnings::UncheckedWeightWitness_0::_w`: 
                       It is deprecated to not check weight witness data.
                       Please instead ensure that all witness data for weight calculation is checked before usage.
               
                       For more info see:
                           <https://github.com/paritytech/polkadot-sdk/pull/1818>
         --> substrate/frame/system/src/lib.rs:424:40
          |
      424 |         pub fn remark(_origin: OriginFor<T>, _remark: Vec<u8>) -> DispatchResultWithPostInfo {
          |                                              ^^^^^^^
          |
          = note: `#[warn(deprecated)]` on by default
      ```
      
      Can be suppressed like this, since in this case it is legit:
      
      ```rust
      #[pallet::call_index(0)]
      #[pallet::weight(T::SystemWeightInfo::remark(remark.len() as u32))]
      pub fn remark(_origin: OriginFor<T>, remark: Vec<u8>) -> DispatchResultWithPostInfo {
      	let _ = remark; // We dont need to check the weight witness.
      	Ok(().into())
      }
      ```
      
      Changes:
      - Add warning on uncheded weight witness
      - Respect `subkeys` limit in `System::kill_prefix`
      - Fix HRMP pallet and other warnings
      - Update`proc_macro_warning` dependency
      - Delete random folder `substrate/src/src` 🙈
      
       
      - Adding Prdoc
      
      ---------
      
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      Co-authored-by: default avatarjoe petrowski <[email protected]>
      64877492
    • Branislav Kontur's avatar
      [xcm] Use `Weight::MAX` for `reserve_asset_deposited`,... · e3c97e48
      Branislav Kontur authored
      [xcm] Use `Weight::MAX` for `reserve_asset_deposited`, `receive_teleported_asset` benchmarks (#1726)
      
      # Description
      
      ## Summary
      
      Previously, the `pallet_xcm::do_reserve_transfer_assets` and
      `pallet_xcm::do_teleport_assets` functions relied on weight estimation
      for remote chain execution, which was based on guesswork derived from
      the local chain. This approach led to complications for runtimes that
      did not provide or support specific [XCM
      configurations](https://github.com/paritytech/polkadot-sdk/blob/7cbe0c76ef8fd2aabf9f07de0156941ce3ed44b0/polkadot/xcm/xcm-executor/src/config.rs#L43-L47)
      for `IsReserve` or `IsTeleporter`. Consequently, such runtimes had to
      resort to implementing hard-coded weights for XCM instructions like
      `reserve_asset_deposited` or `receive_teleported_asset` to support
      extrinsics such as `pallet_xcm::reserve_transfer_assets` and
      `pallet_xcm::teleport_assets`, which depended on remote weight
      estimation.
      
      The issue of remote weight estimation was addressed and resolved by
      [Pull Request
      #1645](https://github.com/paritytech/polkadot-sdk/pull/1645), which
      removed the need for remote weight estimation.
      
      ## Solution
      
      As a continuation of this improvement, the current PR proposes further
      cleanup by removing unnecessary hard-coded values and rectifying
      benchmark results with `Weight::MAX` that previously used
      `T::BlockWeights::get().max_block` as an override for unsupported XCM
      instructions like `ReserveAssetDeposited` and `ReceiveTeleportedAsset`.
      
      
      ## Questions
      
      - [x] Can we remove now also `Hardcoded till the XCM pallet is fixed`
      for `deposit_asset`? E.g. for AssetHubKusama
      [here](https://github.com/paritytech/polkadot-sdk/blob/7cbe0c76ef8fd2aabf9f07de0156941ce3ed44b0/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/xcm/mod.rs#L129-L134)
      - [x] Are comments like
      [this](https://github.com/paritytech/polkadot-sdk/blob/7cbe0c76ef8fd2aabf9f07de0156941ce3ed44b0/polkadot/runtime/kusama/src/weights/xcm/mod.rs#L94)
      `// Kusama doesn't support ReserveAssetDeposited, so this benchmark has
      a default weight` still relevant? Shouldnt be removed/changed?
      
      
      ## TODO
      
      - [x] `bench bot` regenerate xcm weights for all runtimes
      - [x] remove hard-coded stuff from system parachain weight files
      - [ ] when merged, open `polkadot-fellow/runtimes` PR
      
      ## References
      
      Fixes #1132
      Closes #1132
      Old polkadot repo [PR](https://github.com/paritytech/polkadot/pull/7546)
      
      ---------
      
      Co-authored-by: command-bot <>
      e3c97e48