Skip to content
  1. Mar 22, 2024
    • Dmitry Markin's avatar
      Make public addresses go first in authority discovery DHT records (#3757) · 9d2963c2
      Dmitry Markin authored
      Make sure explicitly set by the operator public addresses go first in
      the authority discovery DHT records.
      
      Also update `Discovery` behavior to eliminate duplicates in the returned
      addresses.
      
      This PR should improve situation with
      https://github.com/paritytech/polkadot-sdk/issues/3519.
      
      Obsoletes https://github.com/paritytech/polkadot-sdk/pull/3657.
      9d2963c2
  2. Mar 20, 2024
    • s0me0ne-unkn0wn's avatar
      Enable PoV reclaim on `rococo-parachain` (#3765) · 1da8a6b8
      s0me0ne-unkn0wn authored
      This PR proposes enabling PoV reclaim on the `rococo-parachain`
      testchain to streamline testing and development of high-TPS stuff.
      1da8a6b8
    • eskimor's avatar
      Fix algorithmic complexity of on-demand scheduler with regards to number of cores. (#3190) · b74353d3
      eskimor authored
      
      
      We witnessed really poor performance on Rococo, where we ended up with
      50 on-demand cores. This was due to the fact that for each core the full
      queue was processed. With this change full queue processing will happen
      way less often (most of the time complexity is O(1) or O(log(n))) and if
      it happens then only for one core (in expectation).
      
      Also spot price is now updated before each order to ensure economic back
      pressure.
      
      
      TODO:
      
      - [x] Implement
      - [x] Basic tests
      - [x] Add more tests (see todos)
      - [x] Run benchmark to confirm better performance, first results suggest
      > 100x faster.
      - [x] Write migrations
      - [x] Bump scale-info version and remove patch in Cargo.toml
      - [x] Write PR docs: on-demand performance improved, more on-demand
      cores are now non problematic anymore. If need by also the max queue
      size can be increased again. (Maybe not to 10k)
      
      Optional: Performance can be improved even more, if we called
      `pop_assignment_for_core()`, before calling `report_processed` (Avoid
      needless affinity drops). The effect gets smaller the larger the claim
      queue and I would only go for it, if it does not add complexity to the
      scheduler.
      
      ---------
      
      Co-authored-by: default avatareskimor <[email protected]>
      Co-authored-by: default avatarantonva <[email protected]>
      Co-authored-by: command-bot <>
      Co-authored-by: default avatarAnton Vilhelm Ásgeirsson <[email protected]>
      Co-authored-by: default avatarordian <[email protected]>
      b74353d3
    • bader y's avatar
      Defensive Programming in Substrate Reference Document (#2615) · b686bfef
      bader y authored
      
      
      _This PR is being continued from
      https://github.com/paritytech/polkadot-sdk/pull/2206, which was closed
      when the developer_hub was merged._
      closes https://github.com/paritytech/polkadot-sdk-docs/issues/44
      
      ---
      # Description
      
      This PR adds a reference document to the `developer-hub` crate (see
      https://github.com/paritytech/polkadot-sdk/pull/2102). This specific
      reference document covers defensive programming practices common within
      the context of developing a runtime with Substrate.
      
      In particular, this covers the following areas: 
      
      - Default behavior of how Rust deals with numbers in general
      - How to deal with floating point numbers in runtime / fixed point
      arithmetic
      - How to deal with Integer overflows
      - General "safe math" / defensive programming practices for common
      pallet development scenarios
      - Defensive traits that exist within Substrate, i.e.,
      `defensive_saturating_add `, `defensive_unwrap_or`
      - More general defensive programming examples (keep it concise)
      - Link to relevant examples where these practices are actually in
      production / being used
      - Unwrapping (or rather lack thereof) 101
      
      todo
      -- 
      - [x] Apply feedback from previous PR
      - [x] This may warrant a PR to append some of these docs to
      `sp_arithmetic`
      
      ---------
      
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      Co-authored-by: default avatarGonçalo Pestana <[email protected]>
      Co-authored-by: default avatarKian Paimani <[email protected]>
      Co-authored-by: default avatarFrancisco Aguirre <[email protected]>
      Co-authored-by: default avatarRadha <[email protected]>
      b686bfef
    • dependabot[bot]'s avatar
      Bump anyhow from 1.0.75 to 1.0.81 (#3752) · bb973aa0
      dependabot[bot] authored
      Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.75 to 1.0.81.
      <details>
      <summary>Release notes</summary>
      <p><em>Sourced from <a
      href="https://github.com/dtolnay/anyhow/releases">anyhow's
      releases</a>.</em></p>
      <blockquote>
      <h2>1.0.81</h2>
      <ul>
      <li>Make backtrace support available when using -Dwarnings (<a
      href="https://redirect.github.com/dtolnay/anyhow/issues/354">#354</a>)</li>
      </ul>
      <h2>1.0.80</h2>
      <ul>
      <li>Fix unused_imports warnings when compiled by rustc 1.78</li>
      </ul>
      <h2>1.0.79</h2>
      <ul>
      <li>Work around improperly cached build script result by sccache (<a
      href="https://redirect.github.com/dtolnay/anyhow/issues/340">#340</a>)</li>
      </ul>
      <h2>1.0.78</h2>
      <ul>
      <li>Reduce spurious rebuilds under RustRover IDE when using a nightly
      toolchain (<a
      href="https://redirect.github.com/dtolnay/anyhow/issues/337">#337</a>)</li>
      </ul>
      <h2>1.0.77</h2>
      <ul>
      <li>Make <code>anyhow::Error::backtrace</code> available on stable Rust
      compilers 1.65+ (<a
      href="https://redirect.github.com/dtolnay/anyhow/issues/293">#293</a>,
      thanks <a
      href="https://github.com/LukasKalbertodt"><code>@​LukasKalbertodt</code></a>)</li>
      </ul>
      <h2>1.0.76</h2>
      <ul>
      <li>Opt in to <code>unsafe_op_in_unsafe_fn</code> lint (<a
      href="https://redirect.github.com/dtolnay/anyhow/issues/329">#329</a>)</li>
      </ul>
      </blockquote>
      </details>
      <details>
      <summary>Commits</summary>
      <ul>
      <li><a
      href="https://github.com/dtolnay/anyhow/commit/4aad4edebd9f09247d6c6b6784419a74bb116829"><code>4aad4ed</code></a>
      Release 1.0.81</li>
      <li><a
      href="https://github.com/dtolnay/anyhow/commit/8be90917c603199c5d1fdd73984237f023768e22"><code>8be9091</code></a>
      Merge pull request <a
      href="https://redirect.github.com/dtolnay/anyhow/issues/354">#354</a>
      from dtolnay/deadcode</li>
      <li><a
      href="https://github.com/dtolnay/anyhow/commit/a2eb7dd5e13add83f254b6dac0f68e043effc521"><code>a2eb7dd</code></a>
      Make compatible with -Dwarnings</li>
      <li><a
      href="https://github.com/dtolnay/anyhow/commit/54437197ee79c20678db433d98616fab7ddff1a5"><code>5443719</code></a>
      Release 1.0.80</li>
      <li><a
      href="https://github.com/dtolnay/anyhow/commit/dfc7bc07d4c41b61093c3251ed82becb51810bd4"><code>dfc7bc0c
      
      </code></a>
      Work around prelude redundant import warnings</li>
      <li><a
      href="https://github.com/dtolnay/anyhow/commit/6e4f86b48b5182ec71dbc8e308db9dc91e2ec8a5"><code>6e4f86b</code></a>
      Import from alloc not std, where possible</li>
      <li><a
      href="https://github.com/dtolnay/anyhow/commit/f885a133ede579c45e90ab489455126403d05db1"><code>f885a13</code></a>
      Ignore incompatible_msrv clippy false positives in test</li>
      <li><a
      href="https://github.com/dtolnay/anyhow/commit/fefbcbcb0b336a2d6c2ce6f0ee6d3fd02ef2cd3b"><code>fefbcbc</code></a>
      Ignore incompatible_msrv clippy lint</li>
      <li><a
      href="https://github.com/dtolnay/anyhow/commit/78f2d81cc71b79050a2fda270c45ff267557d853"><code>78f2d81</code></a>
      Update ui test suite to nightly-2024-02-08</li>
      <li><a
      href="https://github.com/dtolnay/anyhow/commit/edd88d3a43f11f1931330d3dd54189353ef00203"><code>edd88d3</code></a>
      Update ui test suite to nightly-2024-01-31</li>
      <li>Additional commits viewable in <a
      href="https://github.com/dtolnay/anyhow/compare/1.0.75...1.0.81">compare
      view</a></li>
      </ul>
      </details>
      <br />
      
      
      [![Dependabot compatibility
      score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=anyhow&package-manager=cargo&previous-version=1.0.75&new-version=1.0.81)](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 this major version` will close this PR and stop
      Dependabot creating any more for this major version (unless you reopen
      the PR or upgrade to it yourself)
      - `@dependabot ignore this minor version` will close this PR and stop
      Dependabot creating any more for this minor version (unless you reopen
      the PR or upgrade to it yourself)
      - `@dependabot ignore this dependency` will close this PR and stop
      Dependabot creating any more for this dependency (unless you reopen the
      PR or upgrade to it yourself)
      
      
      </details>
      
      Signed-off-by: default avatardependabot[bot] <[email protected]>
      Co-authored-by: default avatardependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
      bb973aa0
    • Tsvetomir Dimitrov's avatar
      Expose `ClaimQueue` via a runtime api and use it in `collation-generation` (#3580) · e58e854a
      Tsvetomir Dimitrov authored
      The PR adds two things:
      1. Runtime API exposing the whole claim queue
      2. Consumes the API in `collation-generation` to fetch the next
      scheduled `ParaEntry` for an occupied core.
      
      Related to https://github.com/paritytech/polkadot-sdk/issues/1797
      e58e854a
  3. Mar 19, 2024
    • dependabot[bot]'s avatar
      Bump the known_good_semver group with 2 updates (#3726) · e2ead888
      dependabot[bot] authored
      
      
      Bumps the known_good_semver group with 2 updates:
      [serde_yaml](https://github.com/dtolnay/serde-yaml) and
      [syn](https://github.com/dtolnay/syn).
      
      Updates `serde_yaml` from 0.9.32 to 0.9.33
      <details>
      <summary>Release notes</summary>
      <p><em>Sourced from <a
      href="https://github.com/dtolnay/serde-yaml/releases">serde_yaml's
      releases</a>.</em></p>
      <blockquote>
      <h2>0.9.33</h2>
      <ul>
      <li>Fix quadratic parse time for YAML containing deeply nested flow
      collections (<a
      href="https://redirect.github.com/dtolnay/unsafe-libyaml/issues/26">dtolnay/unsafe-libyaml#26</a>)</li>
      </ul>
      </blockquote>
      </details>
      <details>
      <summary>Commits</summary>
      <ul>
      <li><a
      href="https://github.com/dtolnay/serde-yaml/commit/f4c9ed92385c827a677dae60c2b5a894e24709f0"><code>f4c9ed9</code></a>
      Release 0.9.33</li>
      <li><a
      href="https://github.com/dtolnay/serde-yaml/commit/b4edaee907373ee69c6389687a35fced63d8addf"><code>b4edaee</code></a>
      Pull in yaml_parser_fetch_more_tokens fix from libyaml</li>
      <li><a
      href="https://github.com/dtolnay/serde-yaml/commit/8a5542ced61ae21d0772e504fac01bd1dbfaaa6b"><code>8a5542c</code></a>
      Resolve non_local_definitions warning in test</li>
      <li>See full diff in <a
      href="https://github.com/dtolnay/serde-yaml/compare/0.9.32...0.9.33">compare
      view</a></li>
      </ul>
      </details>
      <br />
      
      Updates `syn` from 2.0.52 to 2.0.53
      <details>
      <summary>Release notes</summary>
      <p><em>Sourced from <a
      href="https://github.com/dtolnay/syn/releases">syn's
      releases</a>.</em></p>
      <blockquote>
      <h2>2.0.53</h2>
      <ul>
      <li>Implement Copy, Clone, and ToTokens for syn::parse::Nothing (<a
      href="https://redirect.github.com/dtolnay/syn/issues/1597">#1597</a>)</li>
      </ul>
      </blockquote>
      </details>
      <details>
      <summary>Commits</summary>
      <ul>
      <li><a
      href="https://github.com/dtolnay/syn/commit/32dcf8df303c7181d95325f159ffbb1870a73e70"><code>32dcf8d</code></a>
      Release 2.0.53</li>
      <li><a
      href="https://github.com/dtolnay/syn/commit/fd1f2aa9979c557e5b95c85f35b8949b8059153f"><code>fd1f2aa</code></a>
      Merge pull request <a
      href="https://redirect.github.com/dtolnay/syn/issues/1597">#1597</a>
      from dtolnay/copyprintnothing</li>
      <li><a
      href="https://github.com/dtolnay/syn/commit/4f6c0528d63874495ce23d197a898cd63cb04d60"><code>4f6c052</code></a>
      Implement ToTokens for syn::parse::Nothing</li>
      <li><a
      href="https://github.com/dtolnay/syn/commit/3f37543794e5d43952399847a2ecbc1eb39f609f"><code>3f37543</code></a>
      Implement Copy for syn::parse::Nothing</li>
      <li><a
      href="https://github.com/dtolnay/syn/commit/36a412217d5217fab5657ab03ebcf29102d87a64"><code>36a4122</code></a>
      Update test suite to nightly-2024-03-16</li>
      <li><a
      href="https://github.com/dtolnay/syn/commit/bd931069f5adb81168e7e6186ead0663cc605257"><code>bd93106</code></a>
      Revert &quot;Temporarily disable nightly testing due to libLLVM link
      issue&quot;</li>
      <li><a
      href="https://github.com/dtolnay/syn/commit/06166a77b7d465b0e4c45e1a2162f15031d7f722"><code>06166a7</code></a>
      Update test suite to nightly-2024-03-09</li>
      <li><a
      href="https://github.com/dtolnay/syn/commit/ed545e75d8fdcab5078789ad25fc0efadc14e59b"><code>ed545e7</code></a>
      Work around doc_markdown lint in test_precedence</li>
      <li><a
      href="https://github.com/dtolnay/syn/commit/7aef1edbba28afe1bb6f9ddc0b5095dcd5135849"><code>7aef1ed</code></a>
      Temporarily disable nightly testing due to libLLVM link issue</li>
      <li><a
      href="https://github.com/dtolnay/syn/commit/556b10bf201264172e4b840f8cf1be38b8d75738"><code>556b10b</code></a>
      Update test suite to nightly-2024-03-06</li>
      <li>Additional commits viewable in <a
      href="https://github.com/dtolnay/syn/compare/2.0.52...2.0.53">compare
      view</a></li>
      </ul>
      </details>
      <br />
      
      
      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>
      e2ead888
  4. Mar 18, 2024
    • Squirrel's avatar
      sp-std removal from substrate/primitives (#3274) · 1b5f4243
      Squirrel authored
      
      
      This PR removes sp-std crate from substrate/primitives sub-directories.
      
      For now crates that have `pub use` of sp-std or export macros that would
      necessitate users of the macros to `extern crate alloc` have been
      excluded from this PR.
      
      There should be no breaking changes in this PR.
      
      ---------
      
      Co-authored-by: default avatarKoute <[email protected]>
      1b5f4243
  5. Mar 17, 2024
    • dependabot[bot]'s avatar
      Bump the known_good_semver group with 3 updates (#3717) · fe343cc7
      dependabot[bot] authored
      
      
      Bumps the known_good_semver group with 3 updates:
      [log](https://github.com/rust-lang/log),
      [syn](https://github.com/dtolnay/syn) and
      [clap](https://github.com/clap-rs/clap).
      
      Updates `log` from 0.4.20 to 0.4.21
      <details>
      <summary>Changelog</summary>
      <p><em>Sourced from <a
      href="https://github.com/rust-lang/log/blob/master/CHANGELOG.md">log's
      changelog</a>.</em></p>
      <blockquote>
      <h2>[0.4.21] - 2024-02-27</h2>
      <h2>What's Changed</h2>
      <ul>
      <li>Minor clippy nits by <a
      href="https://github.com/nyurik"><code>@​nyurik</code></a> in <a
      href="https://redirect.github.com/rust-lang/log/pull/578">rust-lang/log#578</a></li>
      <li>Simplify Display impl by <a
      href="https://github.com/nyurik"><code>@​nyurik</code></a> in <a
      href="https://redirect.github.com/rust-lang/log/pull/579">rust-lang/log#579</a></li>
      <li>Set all crates to 2021 edition by <a
      href="https://github.com/nyurik"><code>@​nyurik</code></a> in <a
      href="https://redirect.github.com/rust-lang/log/pull/580">rust-lang/log#580</a></li>
      <li>Various changes based on review by <a
      href="https://github.com/Thomasdezeeuw"><code>@​Thomasdezeeuw</code></a>
      in <a
      href="https://redirect.github.com/rust-lang/log/pull/583">rust-lang/log#583</a></li>
      <li>Fix typo in file_static() method doc by <a
      href="https://github.com/dimo414"><code>@​dimo414</code></a> in <a
      href="https://redirect.github.com/rust-lang/log/pull/590">rust-lang/log#590</a></li>
      <li>Specialize empty key value pairs by <a
      href="https://github.com/EFanZh"><code>@​EFanZh</code></a> in <a
      href="https://redirect.github.com/rust-lang/log/pull/576">rust-lang/log#576</a></li>
      <li>Fix incorrect lifetime in Value::to_str() by <a
      href="https://github.com/peterjoel"><code>@​peterjoel</code></a> in <a
      href="https://redirect.github.com/rust-lang/log/pull/587">rust-lang/log#587</a></li>
      <li>Remove some API of the key-value feature by <a
      href="https://github.com/Thomasdezeeuw"><code>@​Thomasdezeeuw</code></a>
      in <a
      href="https://redirect.github.com/rust-lang/log/pull/585">rust-lang/log#585</a></li>
      <li>Add logcontrol-log and log-reload by <a
      href="https://github.com/swsnr"><code>@​swsnr</code></a> in <a
      href="https://redirect.github.com/rust-lang/log/pull/595">rust-lang/log#595</a></li>
      <li>Add Serialization section to kv::Value docs by <a
      href="https://github.com/Thomasdezeeuw"><code>@​Thomasdezeeuw</code></a>
      in <a
      href="https://redirect.github.com/rust-lang/log/pull/593">rust-lang/log#593</a></li>
      <li>Rename Value::to_str to to_cow_str by <a
      href="https://github.com/Thomasdezeeuw"><code>@​Thomasdezeeuw</code></a>
      in <a
      href="https://redirect.github.com/rust-lang/log/pull/592">rust-lang/log#592</a></li>
      <li>Clarify documentation and simplify initialization of
      <code>STATIC_MAX_LEVEL</code> by <a
      href="https://github.com/ptosi"><code>@​ptosi</code></a> in <a
      href="https://redirect.github.com/rust-lang/log/pull/594">rust-lang/log#594</a></li>
      <li>Update docs to 2021 edition, test by <a
      href="https://github.com/nyurik"><code>@​nyurik</code></a> in <a
      href="https://redirect.github.com/rust-lang/log/pull/577">rust-lang/log#577</a></li>
      <li>Add &quot;alterable_logger&quot; link to README.md by <a
      href="https://github.com/brummer-simon"><code>@​brummer-simon</code></a>
      in <a
      href="https://redirect.github.com/rust-lang/log/pull/589">rust-lang/log#589</a></li>
      <li>Normalize line ending by <a
      href="https://github.com/EFanZh"><code>@​EFanZh</code></a> in <a
      href="https://redirect.github.com/rust-lang/log/pull/602">rust-lang/log#602</a></li>
      <li>Remove <code>ok_or</code> in favor of <code>Option::ok_or</code> by
      <a
      href="https://github.com/AngelicosPhosphoros"><code>@​AngelicosPhosphoros</code></a>
      in <a
      href="https://redirect.github.com/rust-lang/log/pull/607">rust-lang/log#607</a></li>
      <li>Use <code>Acquire</code> ordering for initialization check by <a
      href="https://github.com/AngelicosPhosphoros"><code>@​AngelicosPhosphoros</code></a>
      in <a
      href="https://redirect.github.com/rust-lang/log/pull/610">rust-lang/log#610</a></li>
      <li>Get structured logging API ready for stabilization by <a
      href="https://github.com/KodrAus"><code>@​KodrAus</code></a> in <a
      href="https://redirect.github.com/rust-lang/log/pull/613">rust-lang/log#613</a></li>
      </ul>
      <h2>New Contributors</h2>
      <ul>
      <li><a href="https://github.com/nyurik"><code>@​nyurik</code></a> made
      their first contribution in <a
      href="https://redirect.github.com/rust-lang/log/pull/578">rust-lang/log#578</a></li>
      <li><a href="https://github.com/dimo414"><code>@​dimo414</code></a> made
      their first contribution in <a
      href="https://redirect.github.com/rust-lang/log/pull/590">rust-lang/log#590</a></li>
      <li><a href="https://github.com/peterjoel"><code>@​peterjoel</code></a>
      made their first contribution in <a
      href="https://redirect.github.com/rust-lang/log/pull/587">rust-lang/log#587</a></li>
      <li><a href="https://github.com/ptosi"><code>@​ptosi</code></a> made
      their first contribution in <a
      href="https://redirect.github.com/rust-lang/log/pull/594">rust-lang/log#594</a></li>
      <li><a
      href="https://github.com/brummer-simon"><code>@​brummer-simon</code></a>
      made their first contribution in <a
      href="https://redirect.github.com/rust-lang/log/pull/589">rust-lang/log#589</a></li>
      <li><a
      href="https://github.com/AngelicosPhosphoros"><code>@​AngelicosPhosphoros</code></a>
      made their first contribution in <a
      href="https://redirect.github.com/rust-lang/log/pull/607">rust-lang/log#607</a></li>
      </ul>
      </blockquote>
      </details>
      <details>
      <summary>Commits</summary>
      <ul>
      <li><a
      href="https://github.com/rust-lang/log/commit/3ccdc286fef3076747fe18a2a93658ea4d4ae012"><code>3ccdc28</code></a>
      Merge pull request <a
      href="https://redirect.github.com/rust-lang/log/issues/617">#617</a>
      from rust-lang/cargo/0.4.21</li>
      <li><a
      href="https://github.com/rust-lang/log/commit/6153cb289f0e7b80f00ae07dbe5ee41cf3d3fcb0"><code>6153cb2</code></a>
      prepare for 0.4.21 release</li>
      <li><a
      href="https://github.com/rust-lang/log/commit/f0f74946a4bfb02cfc407795a3499c4b69d7a290"><code>f0f7494</code></a>
      Merge pull request <a
      href="https://redirect.github.com/rust-lang/log/issues/613">#613</a>
      from rust-lang/feat/kv-cleanup</li>
      <li><a
      href="https://github.com/rust-lang/log/commit/2b220bf3b705f2abc0ee591c7eb17972a979da3a"><code>2b220bf</code></a>
      clean up structured logging example</li>
      <li><a
      href="https://github.com/rust-lang/log/commit/646e9ab9917fb79e44b6b36b8375106a1a09766c"><code>646e9ab</code></a>
      use original Visitor name for VisitValue</li>
      <li><a
      href="https://github.com/rust-lang/log/commit/cf85c38d3519745d60e7b891c4b2025050a8389f"><code>cf85c38</code></a>
      add needed subfeatures to kv_unstable</li>
      <li><a
      href="https://github.com/rust-lang/log/commit/73e953905b970ef765a86bf6cbd69bc2c5e2bac4"><code>73e9539</code></a>
      fix up capturing of :err</li>
      <li><a
      href="https://github.com/rust-lang/log/commit/31bb4b0ff36e458c6bef304a336b71f6342ddcc7"><code>31bb4b0</code></a>
      move error macros together</li>
      <li><a
      href="https://github.com/rust-lang/log/commit/ad917118a5e781d0dd60b3a75ba519ce9839ba70"><code>ad91711</code></a>
      support field shorthand in macros</li>
      <li><a
      href="https://github.com/rust-lang/log/commit/90a347bd836873264a393a35bfd90fe478fadae2"><code>90a347b</code></a>
      restore removed APIs as deprecated</li>
      <li>Additional commits viewable in <a
      href="https://github.com/rust-lang/log/compare/0.4.20...0.4.21">compare
      view</a></li>
      </ul>
      </details>
      <br />
      
      Updates `syn` from 2.0.50 to 2.0.52
      <details>
      <summary>Release notes</summary>
      <p><em>Sourced from <a
      href="https://github.com/dtolnay/syn/releases">syn's
      releases</a>.</em></p>
      <blockquote>
      <h2>2.0.52</h2>
      <ul>
      <li>Add an expression parser that uses match-arm's boundary rules (<a
      href="https://redirect.github.com/dtolnay/syn/issues/1593">#1593</a>)</li>
      </ul>
      <h2>2.0.51</h2>
      <ul>
      <li>Resolve non_local_definitions warnings in generated code under rustc
      1.78-nightly</li>
      </ul>
      </blockquote>
      </details>
      <details>
      <summary>Commits</summary>
      <ul>
      <li><a
      href="https://github.com/dtolnay/syn/commit/07ede6a6b31adeb3a18899ada1f352f63b3a36b9"><code>07ede6a</code></a>
      Release 2.0.52</li>
      <li><a
      href="https://github.com/dtolnay/syn/commit/acbcfbc8c113fa1603469c9ad329d061ee74662e"><code>acbcfbc</code></a>
      Merge pull request <a
      href="https://redirect.github.com/dtolnay/syn/issues/1593">#1593</a>
      from dtolnay/boundary</li>
      <li><a
      href="https://github.com/dtolnay/syn/commit/4924a993dce23abe65128ac318dd662d1e2ceef2"><code>4924a99</code></a>
      Add an expression parser that uses match-arm's boundary rules</li>
      <li><a
      href="https://github.com/dtolnay/syn/commit/e06122bf2cfd31bd7f70304694477dd292fe7e1e"><code>e06122b</code></a>
      Resolve unnecessary_get_then_check clippy lint</li>
      <li><a
      href="https://github.com/dtolnay/syn/commit/018fc5a6298491525387910cb359a9ec618abe54"><code>018fc5a</code></a>
      Update test suite to nightly-2024-02-27</li>
      <li><a
      href="https://github.com/dtolnay/syn/commit/5e15a9b412cb1e2df481e3470e1be8defaee4495"><code>5e15a9b</code></a>
      Release 2.0.51</li>
      <li><a
      href="https://github.com/dtolnay/syn/commit/7e0d4e1f43a879078595f0a3876484a1920ab8f8"><code>7e0d4e1</code></a>
      Resolve non_local_definitions warning in debug impls</li>
      <li><a
      href="https://github.com/dtolnay/syn/commit/8667ad97c1d4e75ac1bb323fb5c7849269814145"><code>8667ad9</code></a>
      Ignore module_name_repetitions pedantic clippy lint in codegen</li>
      <li><a
      href="https://github.com/dtolnay/syn/commit/1fc32000e25bf8fda7371071073f91e012ddf808"><code>1fc3200</code></a>
      Update test suite to nightly-2024-02-26</li>
      <li><a
      href="https://github.com/dtolnay/syn/commit/07a2065576b27dcf0c104f56379cc446d2f3824b"><code>07a2065</code></a>
      Update test suite to nightly-2024-02-23</li>
      <li>See full diff in <a
      href="https://github.com/dtolnay/syn/compare/2.0.50...2.0.52">compare
      view</a></li>
      </ul>
      </details>
      <br />
      
      Updates `clap` from 4.5.1 to 4.5.3
      <details>
      <summary>Release notes</summary>
      <p><em>Sourced from <a
      href="https://github.com/clap-rs/clap/releases">clap's
      releases</a>.</em></p>
      <blockquote>
      <h2>v4.5.3</h2>
      <h2>[4.5.3] - 2024-03-15</h2>
      <h3>Internal</h3>
      <ul>
      <li><em>(derive)</em> Update <code>heck</code></li>
      </ul>
      <h2>v4.5.2</h2>
      <h2>[4.5.2] - 2024-03-06</h2>
      <h3>Fixes</h3>
      <ul>
      <li><em>(macros)</em> Silence a warning</li>
      </ul>
      </blockquote>
      </details>
      <details>
      <summary>Changelog</summary>
      <p><em>Sourced from <a
      href="https://github.com/clap-rs/clap/blob/master/CHANGELOG.md">clap's
      changelog</a>.</em></p>
      <blockquote>
      <h2>[4.5.3] - 2024-03-15</h2>
      <h3>Internal</h3>
      <ul>
      <li><em>(derive)</em> Update <code>heck</code></li>
      </ul>
      <h2>[4.5.2] - 2024-03-06</h2>
      <h3>Fixes</h3>
      <ul>
      <li><em>(macros)</em> Silence a warning</li>
      </ul>
      </blockquote>
      </details>
      <details>
      <summary>Commits</summary>
      <ul>
      <li><a
      href="https://github.com/clap-rs/clap/commit/4e07b438584bb8a19e37599d4c5b11797bec5579"><code>4e07b43</code></a>
      chore: Release</li>
      <li><a
      href="https://github.com/clap-rs/clap/commit/8247c7ddf05d8023729ac180d8e8df260f1da5ff"><code>8247c7d</code></a>
      docs: Update changelog</li>
      <li><a
      href="https://github.com/clap-rs/clap/commit/677c52ce0870115845a4c42e204f6c049b81a1e7"><code>677c52c</code></a>
      chore: Update <code>heck</code> requirement (<a
      href="https://redirect.github.com/clap-rs/clap/issues/5396">#5396</a>)</li>
      <li><a
      href="https://github.com/clap-rs/clap/commit/f65d421607ba16c3175ffe76a20820f123b6c4cb"><code>f65d421</code></a>
      chore: Release</li>
      <li><a
      href="https://github.com/clap-rs/clap/commit/886b2729e419114bf42f1a92c66d346c81aa8f33"><code>886b272</code></a>
      docs: Update changelog</li>
      <li><a
      href="https://github.com/clap-rs/clap/commit/3ba429752fdb19b7a1c2e151c41d5141ad5b9295"><code>3ba4297</code></a>
      Merge pull request <a
      href="https://redirect.github.com/clap-rs/clap/issues/5386">#5386</a>
      from amaanq/static-var-name</li>
      <li><a
      href="https://github.com/clap-rs/clap/commit/2aea9504c4894b3bddf9cd4d2d6cba889307c157"><code>2aea950</code></a>
      fix: Use SCREAMING_SNAKE_CASE for static variable
      <code>authors</code></li>
      <li><a
      href="https://github.com/clap-rs/clap/commit/690f5557d7f25904c31ec9f2a3c3657cbb68c98e"><code>690f555</code></a>
      Merge pull request <a
      href="https://redirect.github.com/clap-rs/clap/issues/5382">#5382</a>
      from clap-rs/renovate/pre-commit-action-3.x</li>
      <li><a
      href="https://github.com/clap-rs/clap/commit/a2aa644368ec19026b16b870ec32dc57b325ba9b"><code>a2aa644</code></a>
      chore(deps): update compatible (dev) (<a
      href="https://redirect.github.com/clap-rs/clap/issues/5381">#5381</a>)</li>
      <li><a
      href="https://github.com/clap-rs/clap/commit/c233de53c0cca4281f444cf16d16d161bc9c3cab"><code>c233de5</code></a>
      chore(deps): update pre-commit/action action to v3.0.1</li>
      <li>Additional commits viewable in <a
      href="https://github.com/clap-rs/clap/compare/clap_complete-v4.5.1...v4.5.3">compare
      view</a></li>
      </ul>
      </details>
      <br />
      
      
      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>
      fe343cc7
  6. Mar 15, 2024
  7. Mar 14, 2024
    • Ignacio Palacios's avatar
      Improve Penpal runtime + emulated tests (#3543) · cfc4050d
      Ignacio Palacios authored
      Issues addressed in this PR:
      - Improve *Penpal* runtime:
      - Properly handled received assets. Previously, it treated `(1, Here)`
      as the local native currency, whereas it should be treated as a
      `ForeignAsset`. This wasn't a great example of standard Parachain
      behaviour, as no Parachain treats the system asset as the local
      currency.
      - Remove `AllowExplicitUnpaidExecutionFrom` the system. Again, this
      wasn't a great example of standard Parachain behaviour.
      - Move duplicated
      `ForeignAssetFeeAsExistentialDepositMultiplierFeeCharger` to
      `assets_common` crate.
      - Improve emulated tests:
        - Update *Penpal* tests to new runtime.
      - To simplify tests, register the reserve transferred, teleported, and
      system assets in *Penpal* and *AssetHub* genesis. This saves us from
      having to create the assets repeatedly for each test
      - Add missing test case:
      `reserve_transfer_assets_from_para_to_system_para`.
        - Cleanup.
      - Prevent integration tests crates imports from being re-exported, as
      they were polluting the `polkadot-sdk` docs.
      
      There is still a test case missing for reserve transfers:
      - Reserve transfer of system asset from *Parachain* to *Parachain*
      trough *AssetHub*.
      - This is not yet possible with `pallet-xcm` due to the reasons
      explained in https://github.com/paritytech/polkadot-sdk/pull/3339
      
      ---------
      
      Co-authored-by: command-bot <>
      cfc4050d
  8. Mar 13, 2024
    • georgepisaltu's avatar
      Revert "FRAME: Create `TransactionExtension` as a replacement for... · bbd51ce8
      georgepisaltu authored
      
      Revert "FRAME: Create `TransactionExtension` as a replacement for `SignedExtension` (#2280)" (#3665)
      
      This PR reverts #2280 which introduced `TransactionExtension` to replace
      `SignedExtension`.
      
      As a result of the discussion
      [here](https://github.com/paritytech/polkadot-sdk/pull/3623#issuecomment-1986789700),
      the changes will be reverted for now with plans to reintroduce the
      concept in the future.
      
      ---------
      
      Signed-off-by: default avatargeorgepisaltu <[email protected]>
      bbd51ce8
  9. Mar 12, 2024
    • Michal Kucharczyk's avatar
      Support for `keyring` in runtimes (#2044) · a756baf3
      Michal Kucharczyk authored
      This functionality is required for #1984.
      
      This PR enables
      [`sp-keyring`](https://github.com/paritytech/polkadot-sdk/blob/21d36b7b/substrate/primitives/keyring/src/sr25519.rs#L31-L40)
      in `no-std` environments, allowing to generate the public key (e.g.
      `AccountKeyring::Alice.public().to_ss58check()`), which can be later
      used in the any of built-in [_runtime-genesis-config_
      variant](https://github.com/paritytech/polkadot-sdk/blob/21d36b7b/polkadot/node/service/src/chain_spec.rs#L1066-L1073).
      
      
      The proposal is as follows:
      - expose [`core::Pair`
      trait](https://github.com/paritytech/polkadot-sdk/blob/d6f15306
      
      /substrate/primitives/core/src/crypto.rs#L832)
      in `no-std`,
      - `full_crypto` feature enables `sign` method,
      - `std` feature enables `generate_with_phrase` and `generate` methods
      (randomness is required),
      - All other functionality, currently gated by `full_crypto` will be
      available unconditionally (`no-std`):
      -- `from_string`
      -- `from_string_with_seed`
      -- `from seed`
      -- `from_seed_slice`
      -- `from_phrase`
      -- `derive`
      -- `verify`
      
      ---
      
      Depends on https://github.com/rust-bitcoin/rust-bip39/pull/57
      
      ---------
      
      Co-authored-by: command-bot <>
      Co-authored-by: default avatarDavide Galassi <[email protected]>
      a756baf3
    • Koute's avatar
      Add a PolkaVM-based executor (#3458) · b0f34e4b
      Koute authored
      This PR adds a new PolkaVM-based executor to Substrate.
      
      - The executor can now be used to actually run a PolkaVM-based runtime,
      and successfully produces blocks.
      - The executor is always compiled-in, but is disabled by default.
      - The `SUBSTRATE_ENABLE_POLKAVM` environment variable must be set to `1`
      to enable the executor, in which case the node will accept both WASM and
      PolkaVM program blobs (otherwise it'll default to WASM-only). This is
      deliberately undocumented and not explicitly exposed anywhere (e.g. in
      the command line arguments, or in the API) to disincentivize anyone from
      enabling it in production. If/when we'll move this into production usage
      I'll remove the environment variable and do it "properly".
      - I did not use our legacy runtime allocator for the PolkaVM executor,
      so currently every allocation inside of the runtime will leak guest
      memory until that particular instance is destroyed. The idea here is
      that I will work on the https://github.com/polkadot-fellows/RFCs/pull/4
      which will remove the need for the legacy allocator under WASM, and that
      will also allow us to use a proper non-leaking allocator under PolkaVM.
      - I also did some minor cleanups of the WASM executor and deleted some
      dead code.
      
      No prdocs included since this is not intended to be an end-user feature,
      but an unofficial experiment, and shouldn't affect any current
      production user. Once this is production-ready a full Polkadot
      Fellowship RFC will be necessary anyway.
      b0f34e4b
  10. Mar 11, 2024
    • dependabot[bot]'s avatar
      Bump handlebars from 4.3.7 to 5.1.0 (#3248) · 7a644fa0
      dependabot[bot] authored
      
      
      Bumps [handlebars](https://github.com/sunng87/handlebars-rust) from
      4.3.7 to 5.1.0.
      <details>
      <summary>Release notes</summary>
      <p><em>Sourced from <a
      href="https://github.com/sunng87/handlebars-rust/releases">handlebars's
      releases</a>.</em></p>
      <blockquote>
      <h2>v5.1.0</h2>
      <h2>What's Changed</h2>
      <ul>
      <li>chore(deps-dev): bump follow-redirects from 1.15.2 to 1.15.4 in
      /playground/www by <a
      href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
      href="https://redirect.github.com/sunng87/handlebars-rust/pull/628">sunng87/handlebars-rust#628</a></li>
      <li>Add chained else expression support by <a
      href="https://github.com/progmboy"><code>@​progmboy</code></a> in <a
      href="https://redirect.github.com/sunng87/handlebars-rust/pull/629">sunng87/handlebars-rust#629</a></li>
      </ul>
      <h2>New Contributors</h2>
      <ul>
      <li><a href="https://github.com/progmboy"><code>@​progmboy</code></a>
      made their first contribution in <a
      href="https://redirect.github.com/sunng87/handlebars-rust/pull/629">sunng87/handlebars-rust#629</a></li>
      </ul>
      <p><strong>Full Changelog</strong>: <a
      href="https://github.com/sunng87/handlebars-rust/compare/v5.0.0...v5.1.0">https://github.com/sunng87/handlebars-rust/compare/v5.0.0...v5.1.0</a></p>
      <h2>v5.0.0</h2>
      <h2>5.0.0</h2>
      <p>A semver major release that introduces some API breaking changes.</p>
      <h3>Highlights</h3>
      <ul>
      <li><code>RenderError</code> has been rewritten for typed error reason.
      In previous versions we use string message for <code>RenderError</code>
      which is impossible to handle with code. This version introduces
      <code>RenderErrorReason</code> so you can use <code>match</code> to deal
      various error reasons.</li>
      <li>Lifetime in <code>Helper</code> trait has been simplified.</li>
      </ul>
      <h3>Changes compared to 4.3</h3>
      <ul>
      <li>[Added] public mutable access to local variables in
      <code>BlockContext</code> <a
      href="https://redirect.github.com/sunng87/handlebars-rust/issues/533">#533</a></li>
      <li>[Changed] Simplified lifetime specifiers for <code>Helper</code>,
      <code>ScopedJson</code> and some
      other related types and functions. <a
      href="https://redirect.github.com/sunng87/handlebars-rust/issues/532">#532</a></li>
      <li>[Changed] Updated <code>TemplateError</code> to reduce its size.
      Direct field access is
      removed in favor of access methods</li>
      <li>[Changed] Introducing <code>RenderErrorReason</code> for typed
      render error</li>
      <li>[Changed] Changed <code>register_template_directory</code> api for
      more customizations
      #[610]</li>
      <li>[Changed] Updated rust-embed to 8.0</li>
      </ul>
      <h2>Collaboration Wanted</h2>
      <p>I'm looking for collaborations to join the development with me on
      this project. Contact via email if your are interested in.</p>
      <h2>Auto-generated changelog</h2>
      <ul>
      <li>chore(deps): update criterion requirement from 0.3 to 0.4 by <a
      href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
      href="https://redirect.github.com/sunng87/handlebars-rust/pull/530">sunng87/handlebars-rust#530</a></li>
      <li>issue 529: simplify lifetime requirements by <a
      href="https://github.com/lovasoa"><code>@​lovasoa</code></a> in <a
      href="https://redirect.github.com/sunng87/handlebars-rust/pull/532">sunng87/handlebars-rust#532</a></li>
      <li>Allow public access to local variables by <a
      href="https://github.com/lovasoa"><code>@​lovasoa</code></a> in <a
      href="https://redirect.github.com/sunng87/handlebars-rust/pull/533">sunng87/handlebars-rust#533</a></li>
      <li>Fix issue when using partial context within each block by <a
      href="https://github.com/sunng87"><code>@​sunng87</code></a> in <a
      href="https://redirect.github.com/sunng87/handlebars-rust/pull/536">sunng87/handlebars-rust#536</a></li>
      <li>chore(deps): update tiny_http requirement from 0.11 to 0.12 by <a
      href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
      href="https://redirect.github.com/sunng87/handlebars-rust/pull/538">sunng87/handlebars-rust#538</a></li>
      <li>fix: enable include-exclude feature for rust-embed by <a
      href="https://github.com/sunng87"><code>@​sunng87</code></a> in <a
      href="https://redirect.github.com/sunng87/handlebars-rust/pull/542">sunng87/handlebars-rust#542</a></li>
      <li>Fix looking up provided null value in strict mode by <a
      href="https://github.com/sunng87"><code>@​sunng87</code></a> in <a
      href="https://redirect.github.com/sunng87/handlebars-rust/pull/543">sunng87/handlebars-rust#543</a></li>
      <li>chore(deps): update pprof requirement from 0.10 to 0.11 by <a
      href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
      href="https://redirect.github.com/sunng87/handlebars-rust/pull/544">sunng87/handlebars-rust#544</a></li>
      <li>Able to get the missing variable path from error by <a
      href="https://github.com/linw1995"><code>@​linw1995</code></a> in <a
      href="https://redirect.github.com/sunng87/handlebars-rust/pull/546">sunng87/handlebars-rust#546</a></li>
      <li>chore(deps): update env_logger requirement from 0.9 to 0.10 by <a
      href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
      href="https://redirect.github.com/sunng87/handlebars-rust/pull/547">sunng87/handlebars-rust#547</a></li>
      <li>fix: loading templates which has multiple extensions by <a
      href="https://github.com/sunng87"><code>@​sunng87</code></a> in <a
      href="https://redirect.github.com/sunng87/handlebars-rust/pull/551">sunng87/handlebars-rust#551</a></li>
      <li>Web playground by <a
      href="https://github.com/sunng87"><code>@​sunng87</code></a> in <a
      href="https://redirect.github.com/sunng87/handlebars-rust/pull/548">sunng87/handlebars-rust#548</a></li>
      <li>chore(deps): bump loader-utils from 1.2.3 to 1.4.2 in
      /playground/www by <a
      href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
      href="https://redirect.github.com/sunng87/handlebars-rust/pull/553">sunng87/handlebars-rust#553</a></li>
      </ul>
      <!-- raw HTML omitted -->
      </blockquote>
      <p>... (truncated)</p>
      </details>
      <details>
      <summary>Changelog</summary>
      <p><em>Sourced from <a
      href="https://github.com/sunng87/handlebars-rust/blob/master/CHANGELOG.md">handlebars's
      changelog</a>.</em></p>
      <blockquote>
      <h2><a
      href="https://github.com/sunng87/handlebars-rust/compare/5.0.0...5.1.0">5.1.0</a>
      - 2024-01-17</h2>
      <ul>
      <li>[Added] Chained <code>else if</code> block support <a
      href="https://redirect.github.com/sunng87/handlebars-rust/issues/629">#629</a></li>
      </ul>
      <h2><a
      href="https://github.com/sunng87/handlebars-rust/compare/4.3.4...5.0.0">5.0.0</a>
      - 2023-12-31</h2>
      <ul>
      <li>[Added] public mutable access to local variables in
      <code>BlockContext</code> <a
      href="https://redirect.github.com/sunng87/handlebars-rust/issues/533">#533</a></li>
      <li>[Changed] Simplified lifetime specifiers for <code>Helper</code>,
      <code>ScopedJson</code> and some
      other related types and functions. <a
      href="https://redirect.github.com/sunng87/handlebars-rust/issues/532">#532</a></li>
      <li>[Changed] Updated <code>TemplateError</code> to reduce its size.
      Direct field access is
      removed in favor of access methods</li>
      <li>[Changed] Introducing <code>RenderErrorReason</code> for typed
      render error</li>
      <li>[Changed] Changed <code>register_template_directory</code> api for
      more customizations
      #[610]</li>
      <li>[Changed] Updated rust-embed to 8.0</li>
      </ul>
      <h2><a
      href="https://github.com/sunng87/handlebars-rust/compare/4.3.3...4.3.4">4.3.4</a>
      - 2022-09-11</h2>
      <ul>
      <li>[Added] New <code>write_fmt</code> function for <code>Output</code>
      <a
      href="https://redirect.github.com/sunng87/handlebars-rust/issues/522">#522</a></li>
      <li>[Added] <code>reason()</code> method for <code>TemplateError</code>
      to access underlying reason,
      this replaces original direct <code>.reason</code> access.</li>
      <li>[Changed] Direct access to <code>TemplateError</code>'s
      <code>reason</code> field is depreacted will
      be removed in future.</li>
      </ul>
      <h2><a
      href="https://github.com/sunng87/handlebars-rust/compare/4.3.2...4.3.3">4.3.3</a>
      - 2022-07-20</h2>
      <ul>
      <li>[Fixed] Disable partial expression indentation with <code>{{~&gt;
      partial}}</code> to
      bring behavior closer in line with original javascript version. <a
      href="https://redirect.github.com/sunng87/handlebars-rust/issues/518">#518</a></li>
      <li>[Fixed] Support for using partial context together with partial
      parameters
      <a
      href="https://redirect.github.com/sunng87/handlebars-rust/issues/520">#520</a></li>
      </ul>
      <h2><a
      href="https://github.com/sunng87/handlebars-rust/compare/4.3.1...4.3.2">4.3.2</a>
      - 2022-07-14</h2>
      <ul>
      <li>[Added] Render functions that reuse <code>Context</code> for custom
      <code>std::io::Write</code>:
      <code>render_with_context_to_write</code> and
      <code>render_template_with_context_to_write</code></li>
      </ul>
      <h2><a
      href="https://github.com/sunng87/handlebars-rust/compare/4.3.0...4.3.1">4.3.1</a>
      - 2022-06-09</h2>
      <ul>
      <li>[Added] Added support for <code>{{~{variable}~}}</code> syntax <a
      href="https://redirect.github.com/sunng87/handlebars-rust/issues/509">#509</a></li>
      </ul>
      <h2><a
      href="https://github.com/sunng87/handlebars-rust/compare/4.2.2...4.3.0">4.3.0</a>
      - 2022-05-18</h2>
      <ul>
      <li>[Changed] update MSRV to 1.57 as rhai requires</li>
      <li>[Fixed] Reimplemented indent support for partial expression
      <code>{{&gt; partial}}</code>, which is introduced in 4.2.0. The new
      implementation is
      aligned with original javascript version, that every text line
      generated from partial are indented as <code>{{&gt; partial}}</code>
      does. <code>prevent_indent</code> will turn-off this feature. <a
      href="https://redirect.github.com/sunng87/handlebars-rust/issues/505">#505</a></li>
      <li>[Changed] changed error support library from quick_error to
      thiserror</li>
      </ul>
      <!-- raw HTML omitted -->
      </blockquote>
      <p>... (truncated)</p>
      </details>
      <details>
      <summary>Commits</summary>
      <ul>
      <li><a
      href="https://github.com/sunng87/handlebars-rust/commit/d8d9a78f4a11d1a5e2ad82cd5277a6edb24d3751"><code>d8d9a78</code></a>
      chore: Release handlebars version 5.1.0</li>
      <li><a
      href="https://github.com/sunng87/handlebars-rust/commit/137bce5863b6782252b966480c497246e904e008"><code>137bce5</code></a>
      chore: minor cleanup for chained else support in <a
      href="https://redirect.github.com/sunng87/handlebars-rust/issues/629">#629</a></li>
      <li><a
      href="https://github.com/sunng87/handlebars-rust/commit/e30d8abfa391b643aa93b0e8d5f424f5a436a8c6"><code>e30d8ab</code></a>
      Merge pull request <a
      href="https://redirect.github.com/sunng87/handlebars-rust/issues/629">#629</a>
      from progmboy/else_chain</li>
      <li><a
      href="https://github.com/sunng87/handlebars-rust/commit/8f16353281b565007ffccddcb8178389aa3bcdc1"><code>8f16353</code></a>
      format code</li>
      <li><a
      href="https://github.com/sunng87/handlebars-rust/commit/786d132c1deb295b1fc77441d85201b556685b82"><code>786d132</code></a>
      add else chain support</li>
      <li><a
      href="https://github.com/sunng87/handlebars-rust/commit/23672e837bf731a609080366450e587960d39b69"><code>23672e8</code></a>
      Merge pull request <a
      href="https://redirect.github.com/sunng87/handlebars-rust/issues/628">#628</a>
      from sunng87/dependabot/npm_and_yarn/playground/www/f...</li>
      <li><a
      href="https://github.com/sunng87/handlebars-rust/commit/b849efd171e2ec598383605349f4ef8bcd6b8631"><code>b849efd</code></a>
      chore(deps-dev): bump follow-redirects in /playground/www</li>
      <li><a
      href="https://github.com/sunng87/handlebars-rust/commit/7071c9d3ba572b7ac7f29bee43b2f4501652de83"><code>7071c9d</code></a>
      test: add test for error reason</li>
      <li><a
      href="https://github.com/sunng87/handlebars-rust/commit/4664a345f373eb9a96b1281640396d098221a28c"><code>4664a34</code></a>
      (cargo-release) version 5.0.0</li>
      <li><a
      href="https://github.com/sunng87/handlebars-rust/commit/ca277489dc80d2392c0029994e59ed26beb64636"><code>ca27748</code></a>
      Merge pull request <a
      href="https://redirect.github.com/sunng87/handlebars-rust/issues/625">#625</a>
      from sunng87/refactor/render-error-reason-2</li>
      <li>Additional commits viewable in <a
      href="https://github.com/sunng87/handlebars-rust/compare/v4.3.7...v5.1.0">compare
      view</a></li>
      </ul>
      </details>
      <br />
      
      
      [![Dependabot compatibility
      score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=handlebars&package-manager=cargo&previous-version=4.3.7&new-version=5.1.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
      
      You can trigger a rebase of this PR 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>
      
      > **Note**
      > Automatic rebases have been disabled on this pull request as it has
      been open for over 30 days.
      
      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 avatarBastian Köcher <[email protected]>
      7a644fa0
  11. Mar 09, 2024
    • Michal Kucharczyk's avatar
      core: replace secp256k with k256 in crypto::ecdsa (#3525) · 9f5d9fa9
      Michal Kucharczyk authored
      
      
      This PR replaces the usage of
      [secp256k](https://crates.io/crates/secp256k1) crate with
      [k256](https://crates.io/crates/k256) in `core::crypto::ecdsa` for
      `non-std` environments as outcome of discussion in #3448.
      
      `secp256k1` is used in `std`, meaning that we should not affect host
      performance with this PR.
      `k256` is enabled in runtimes (`no-std`), and is required to proceed
      with #2044.
      
      If desirable, in future we can switch to `k256` also for `std`. That
      would require some performance evaluation (e.g. for EVM chains as per
      https://github.com/paritytech/polkadot-sdk/issues/3448#issuecomment-1976780391).
      
      Closes https://github.com/paritytech/polkadot-sdk/issues/3448
      
      ---------
      
      Co-authored-by: command-bot <>
      Co-authored-by: default avatarDavide Galassi <[email protected]>
      9f5d9fa9
  12. Mar 07, 2024
  13. Mar 06, 2024
    • Branislav Kontur's avatar
      Make `penpal-runtime`'s `TrustedReserves` more connfigurable (#3564) · 117a9433
      Branislav Kontur authored
      
      
      The current `penpal` runtime utilizes the `EthereumLocation` parameter,
      which is employed for XCM emulated integration tests concerning the
      Rococo <> ETH bridge. It includes a hard-coded chainId for the Ethereum
      testnet utilized in Rococo. The `EthereumLocation` serves the purpose of
      aligning with the `TrustedReserves`. However, due to this hard-coded
      configuration, reusing `penpal` for testing various environments such as
      Kusama/Polkadot versus Ethereum bridge becomes unfeasible.
      
      This PR introduces the capability to easily customize the asset location
      for `TrustedReserves` without needing to know anything about Ethereum.
      
      
      ## TODO
      - [x] fix integration tests with
      `System::set_storage(CustomizableAssetFromSystemAssetHub::key(),
      <whatever-location-is-needed>)` @claravanstaden
      - [ ] ~~maybe add some helper function/macro to support `set_storage`
      for other runtimes (that we could reuse)~~
      - [ ] Release patch for: `penpal-runtime` + emulated crate with
      `set_storage` support (if needed)
        - [ ] backport to 1.7.0
        - [ ] backport to 1.8.0
      
      ---------
      
      Co-authored-by: default avatarClara van Staden <[email protected]>
      117a9433
  14. Mar 05, 2024
    • Kian Paimani's avatar
      Repot all templates into a single directory (#3460) · 4c810609
      Kian Paimani authored
      The first step towards
      https://github.com/paritytech/polkadot-sdk/issues/3155
      
      Brings all templates under the following structure
      
      ```
      templates
      |   parachain
      |   |   polkadot-launch
      |   |   runtime              --> parachain-template-runtime
      |   |   pallets              --> pallet-parachain-template
      |   |   node                 --> parachain-template-node
      |   minimal
      |   |   runtime              --> minimal-template-runtime
      |   |   pallets              --> pallet-minimal-template
      |   |   node                 --> minimal-template-node
      |   solochain
      |   |   runtime              --> solochain-template-runtime
      |   |   pallets              --> pallet-template (the naming is not consistent here)
      |   |   node                 --> solochain-template-node
      ```
      
      The only note-worthy changes in this PR are: 
      
      - More `Cargo.toml` fields are forwarded to use the one from the
      workspace.
      - parachain template now has weights and benchmarks
      - adds a shell pallet to the minimal template
      - remove a few unused deps 
      
      
      A list of possible follow-ups: 
      
      - [ ] Unify READMEs, create a parent README for all
      - [ ] remove references to `docs.substrate.io` in templates
      - [ ] make all templates use `#[derive_impl]`
      - [ ] update and unify all licenses
      - [ ] Remove polkadot launch, use
      https://github.com/paritytech/polkadot-sdk/blob/35349df9/cumulus/zombienet/examples/small_network.toml
      instead.
      4c810609
    • Niklas Adolfsson's avatar
      rpc server: add prometheus label `is_rate_limited` (#3504) · efcea0ed
      Niklas Adolfsson authored
      After some discussion with @kogeler
      
       after the we added the rate-limit
      middleware it may slow down
      the rpc call timings metrics significantly because it works as follows:
      
      1. The rate limit guard is checked when the call comes and if a slot is
      available -> process the call
      2. If no free spot is available then the call will be sleeping
      `jitter_delay + min_time_rate_guard` then woken up and checked at most
      ten times
      3. If no spot is available after 10 iterations -> the call is rejected
      (this may take tens of seconds)
      
      Thus, this PR adds a label "is_rate_limited" to filter those out on the
      metrics "substrate_rpc_calls_time" and "substrate_rpc_calls_finished".
      
      I had to merge two middleware layers Metrics and RateLimit to avoid
      shared state in a hacky way.
      
      ---------
      
      Co-authored-by: default avatarJames Wilson <[email protected]>
      efcea0ed
  15. Mar 04, 2024
    • dependabot[bot]'s avatar
      Bump mio from 0.8.8 to 0.8.11 (#3569) · ec30d2f5
      dependabot[bot] authored
      
      
      Bumps [mio](https://github.com/tokio-rs/mio) from 0.8.8 to 0.8.11.
      <details>
      <summary>Changelog</summary>
      <p><em>Sourced from <a
      href="https://github.com/tokio-rs/mio/blob/master/CHANGELOG.md">mio's
      changelog</a>.</em></p>
      <blockquote>
      <h1>0.8.11</h1>
      <ul>
      <li>Fix receiving IOCP events after deregistering a Windows named pipe
      (<a
      href="https://redirect.github.com/tokio-rs/mio/pull/1760">tokio-rs/mio#1760</a>,
      backport pr:
      <a
      href="https://redirect.github.com/tokio-rs/mio/pull/1761">tokio-rs/mio#1761</a>).</li>
      </ul>
      <h1>0.8.10</h1>
      <h2>Added</h2>
      <ul>
      <li>Solaris support
      (<a
      href="https://redirect.github.com/tokio-rs/mio/pull/1724">tokio-rs/mio#1724</a>).</li>
      </ul>
      <h1>0.8.9</h1>
      <h2>Added</h2>
      <ul>
      <li>ESP-IDF framework support
      (<a
      href="https://redirect.github.com/tokio-rs/mio/pull/1692">tokio-rs/mio#1692</a>).</li>
      <li>AIX operating system support
      (<a
      href="https://redirect.github.com/tokio-rs/mio/pull/1704">tokio-rs/mio#1704</a>).</li>
      <li>Vita support
      (<a
      href="https://redirect.github.com/tokio-rs/mio/pull/1721">tokio-rs/mio#1721</a>).</li>
      <li><code>{UnixListener,UnixStream}:bind_addr</code>
      (<a
      href="https://redirect.github.com/tokio-rs/mio/pull/1630">tokio-rs/mio#1630</a>).</li>
      <li><code>mio_unsupported_force_poll_poll</code> and
      <code>mio_unsupported_force_waker_pipe</code>
      <strong>unsupported</strong> configuration flags to force a specific
      poll or waker
      implementation
      (<a
      href="https://redirect.github.com/tokio-rs/mio/pull/1684">tokio-rs/mio#1684</a>,
      <a
      href="https://redirect.github.com/tokio-rs/mio/pull/1685">tokio-rs/mio#1685</a>,
      <a
      href="https://redirect.github.com/tokio-rs/mio/pull/1692">tokio-rs/mio#1692</a>).</li>
      </ul>
      <h2>Fixed</h2>
      <ul>
      <li>The <code>pipe(2)</code> based waker (swapped file descriptors)
      (<a
      href="https://redirect.github.com/tokio-rs/mio/pull/1722">tokio-rs/mio#1722</a>).</li>
      <li>The duplicate waker check to work correctly with cloned
      <code>Registry</code>s.
      (<a
      href="https://redirect.github.com/tokio-rs/mio/pull/1706">tokio-rs/mio#1706</a>).</li>
      </ul>
      </blockquote>
      </details>
      <details>
      <summary>Commits</summary>
      <ul>
      <li><a
      href="https://github.com/tokio-rs/mio/commit/0328bdef900b6396b8d00d33c825cd8af748553d"><code>0328bde</code></a>
      Release v0.8.11</li>
      <li><a
      href="https://github.com/tokio-rs/mio/commit/708449851283b57eb6f514c8f289b66e982720b3"><code>7084498</code></a>
      Fix warnings</li>
      <li><a
      href="https://github.com/tokio-rs/mio/commit/90d4fe00df870acd3d38f3dc4face9aacab8fbb9"><code>90d4fe0</code></a>
      named-pipes: fix receiving IOCP events after deregister</li>
      <li><a
      href="https://github.com/tokio-rs/mio/commit/c710a307f8627c4d63ac1003252aa45175e08399"><code>c710a30</code></a>
      Add v0.8.x to the CI</li>
      <li><a
      href="https://github.com/tokio-rs/mio/commit/c29e21c244b2b835e8b3e015b92c708c33c7d70a"><code>c29e21c</code></a>
      Release v0.8.10</li>
      <li><a
      href="https://github.com/tokio-rs/mio/commit/f6a20da1c81c2d56a78bc6f6832b9904b9215914"><code>f6a20da</code></a>
      Add Solaris operating system support (<a
      href="https://redirect.github.com/tokio-rs/mio/issues/1724">#1724</a>)</li>
      <li><a
      href="https://github.com/tokio-rs/mio/commit/e80c3b21b59b92238f4c8c331fcfc4a71508d1c5"><code>e80c3b2</code></a>
      Release v0.8.9</li>
      <li><a
      href="https://github.com/tokio-rs/mio/commit/862786bbbf719886be55631c0d150d4813a9a1b6"><code>862786b</code></a>
      Fix importing of IoSourceState</li>
      <li><a
      href="https://github.com/tokio-rs/mio/commit/40348728e4f06f5e150783d8f1559ee974e5e834"><code>4034872</code></a>
      Add support for vita target</li>
      <li><a
      href="https://github.com/tokio-rs/mio/commit/8eb4010a92bede550850e177d3dd7c4c76eb90ba"><code>8eb4010</code></a>
      Fix receiver and sender fd in pipe based waker</li>
      <li>Additional commits viewable in <a
      href="https://github.com/tokio-rs/mio/compare/v0.8.8...v0.8.11">compare
      view</a></li>
      </ul>
      </details>
      <br />
      
      
      [![Dependabot compatibility
      score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=mio&package-manager=cargo&previous-version=0.8.8&new-version=0.8.11)](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 this major version` will close this PR and stop
      Dependabot creating any more for this major version (unless you reopen
      the PR or upgrade to it yourself)
      - `@dependabot ignore this minor version` will close this PR and stop
      Dependabot creating any more for this minor version (unless you reopen
      the PR or upgrade to it yourself)
      - `@dependabot ignore this dependency` will close this PR and stop
      Dependabot creating any more for this dependency (unless you reopen the
      PR or upgrade to it yourself)
      You can disable automated security fix PRs for this repo from the
      [Security Alerts
      page](https://github.com/paritytech/polkadot-sdk/network/alerts).
      
      </details>
      
      Signed-off-by: default avatardependabot[bot] <[email protected]>
      Co-authored-by: default avatardependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
      ec30d2f5
    • Gavin Wood's avatar
      FRAME: Create `TransactionExtension` as a replacement for `SignedExtension` (#2280) · fd5f9292
      Gavin Wood authored
      
      
      Closes #2160
      
      First part of [Extrinsic
      Horizon](https://github.com/paritytech/polkadot-sdk/issues/2415)
      
      Introduces a new trait `TransactionExtension` to replace
      `SignedExtension`. Introduce the idea of transactions which obey the
      runtime's extensions and have according Extension data (né Extra data)
      yet do not have hard-coded signatures.
      
      Deprecate the terminology of "Unsigned" when used for
      transactions/extrinsics owing to there now being "proper" unsigned
      transactions which obey the extension framework and "old-style" unsigned
      which do not. Instead we have __*General*__ for the former and
      __*Bare*__ for the latter. (Ultimately, the latter will be phased out as
      a type of transaction, and Bare will only be used for Inherents.)
      
      Types of extrinsic are now therefore:
      - Bare (no hardcoded signature, no Extra data; used to be known as
      "Unsigned")
      - Bare transactions (deprecated): Gossiped, validated with
      `ValidateUnsigned` (deprecated) and the `_bare_compat` bits of
      `TransactionExtension` (deprecated).
        - Inherents: Not gossiped, validated with `ProvideInherent`.
      - Extended (Extra data): Gossiped, validated via `TransactionExtension`.
        - Signed transactions (with a hardcoded signature).
        - General transactions (without a hardcoded signature).
      
      `TransactionExtension` differs from `SignedExtension` because:
      - A signature on the underlying transaction may validly not be present.
      - It may alter the origin during validation.
      - `pre_dispatch` is renamed to `prepare` and need not contain the checks
      present in `validate`.
      - `validate` and `prepare` is passed an `Origin` rather than a
      `AccountId`.
      - `validate` may pass arbitrary information into `prepare` via a new
      user-specifiable type `Val`.
      - `AdditionalSigned`/`additional_signed` is renamed to
      `Implicit`/`implicit`. It is encoded *for the entire transaction* and
      passed in to each extension as a new argument to `validate`. This
      facilitates the ability of extensions to acts as underlying crypto.
      
      There is a new `DispatchTransaction` trait which contains only default
      function impls and is impl'ed for any `TransactionExtension` impler. It
      provides several utility functions which reduce some of the tedium from
      using `TransactionExtension` (indeed, none of its regular functions
      should now need to be called directly).
      
      Three transaction version discriminator ("versions") are now
      permissible:
      - 0b000000100: Bare (used to be called "Unsigned"): contains Signature
      or Extra (extension data). After bare transactions are no longer
      supported, this will strictly identify an Inherents only.
      - 0b100000100: Old-school "Signed" Transaction: contains Signature and
      Extra (extension data).
      - 0b010000100: New-school "General" Transaction: contains Extra
      (extension data), but no Signature.
      
      For the New-school General Transaction, it becomes trivial for authors
      to publish extensions to the mechanism for authorizing an Origin, e.g.
      through new kinds of key-signing schemes, ZK proofs, pallet state,
      mutations over pre-authenticated origins or any combination of the
      above.
      
      ## Code Migration
      
      ### NOW: Getting it to build
      
      Wrap your `SignedExtension`s in `AsTransactionExtension`. This should be
      accompanied by renaming your aggregate type in line with the new
      terminology. E.g. Before:
      
      ```rust
      /// The SignedExtension to the basic transaction logic.
      pub type SignedExtra = (
      	/* snip */
      	MySpecialSignedExtension,
      );
      /// Unchecked extrinsic type as expected by this runtime.
      pub type UncheckedExtrinsic =
      	generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, SignedExtra>;
      ```
      
      After:
      
      ```rust
      /// The extension to the basic transaction logic.
      pub type TxExtension = (
      	/* snip */
      	AsTransactionExtension<MySpecialSignedExtension>,
      );
      /// Unchecked extrinsic type as expected by this runtime.
      pub type UncheckedExtrinsic =
      	generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, TxExtension>;
      ```
      
      You'll also need to alter any transaction building logic to add a
      `.into()` to make the conversion happen. E.g. Before:
      
      ```rust
      fn construct_extrinsic(
      		/* snip */
      ) -> UncheckedExtrinsic {
      	let extra: SignedExtra = (
      		/* snip */
      		MySpecialSignedExtension::new(/* snip */),
      	);
      	let payload = SignedPayload::new(call.clone(), extra.clone()).unwrap();
      	let signature = payload.using_encoded(|e| sender.sign(e));
      	UncheckedExtrinsic::new_signed(
      		/* snip */
      		Signature::Sr25519(signature),
      		extra,
      	)
      }
      ```
      
      After:
      
      ```rust
      fn construct_extrinsic(
      		/* snip */
      ) -> UncheckedExtrinsic {
      	let tx_ext: TxExtension = (
      		/* snip */
      		MySpecialSignedExtension::new(/* snip */).into(),
      	);
      	let payload = SignedPayload::new(call.clone(), tx_ext.clone()).unwrap();
      	let signature = payload.using_encoded(|e| sender.sign(e));
      	UncheckedExtrinsic::new_signed(
      		/* snip */
      		Signature::Sr25519(signature),
      		tx_ext,
      	)
      }
      ```
      
      ### SOON: Migrating to `TransactionExtension`
      
      Most `SignedExtension`s can be trivially converted to become a
      `TransactionExtension`. There are a few things to know.
      
      - Instead of a single trait like `SignedExtension`, you should now
      implement two traits individually: `TransactionExtensionBase` and
      `TransactionExtension`.
      - Weights are now a thing and must be provided via the new function `fn
      weight`.
      
      #### `TransactionExtensionBase`
      
      This trait takes care of anything which is not dependent on types
      specific to your runtime, most notably `Call`.
      
      - `AdditionalSigned`/`additional_signed` is renamed to
      `Implicit`/`implicit`.
      - Weight must be returned by implementing the `weight` function. If your
      extension is associated with a pallet, you'll probably want to do this
      via the pallet's existing benchmarking infrastructure.
      
      #### `TransactionExtension`
      
      Generally:
      - `pre_dispatch` is now `prepare` and you *should not reexecute the
      `validate` functionality in there*!
      - You don't get an account ID any more; you get an origin instead. If
      you need to presume an account ID, then you can use the trait function
      `AsSystemOriginSigner::as_system_origin_signer`.
      - You get an additional ticket, similar to `Pre`, called `Val`. This
      defines data which is passed from `validate` into `prepare`. This is
      important since you should not be duplicating logic from `validate` to
      `prepare`, you need a way of passing your working from the former into
      the latter. This is it.
      - This trait takes two type parameters: `Call` and `Context`. `Call` is
      the runtime call type which used to be an associated type; you can just
      move it to become a type parameter for your trait impl. `Context` is not
      currently used and you can safely implement over it as an unbounded
      type.
      - There's no `AccountId` associated type any more. Just remove it.
      
      Regarding `validate`:
      - You get three new parameters in `validate`; all can be ignored when
      migrating from `SignedExtension`.
      - `validate` returns a tuple on success; the second item in the tuple is
      the new ticket type `Self::Val` which gets passed in to `prepare`. If
      you use any information extracted during `validate` (off-chain and
      on-chain, non-mutating) in `prepare` (on-chain, mutating) then you can
      pass it through with this. For the tuple's last item, just return the
      `origin` argument.
      
      Regarding `prepare`:
      - This is renamed from `pre_dispatch`, but there is one change:
      - FUNCTIONALITY TO VALIDATE THE TRANSACTION NEED NOT BE DUPLICATED FROM
      `validate`!!
      - (This is different to `SignedExtension` which was required to run the
      same checks in `pre_dispatch` as in `validate`.)
      
      Regarding `post_dispatch`:
      - Since there are no unsigned transactions handled by
      `TransactionExtension`, `Pre` is always defined, so the first parameter
      is `Self::Pre` rather than `Option<Self::Pre>`.
      
      If you make use of `SignedExtension::validate_unsigned` or
      `SignedExtension::pre_dispatch_unsigned`, then:
      - Just use the regular versions of these functions instead.
      - Have your logic execute in the case that the `origin` is `None`.
      - Ensure your transaction creation logic creates a General Transaction
      rather than a Bare Transaction; this means having to include all
      `TransactionExtension`s' data.
      - `ValidateUnsigned` can still be used (for now) if you need to be able
      to construct transactions which contain none of the extension data,
      however these will be phased out in stage 2 of the Transactions Horizon,
      so you should consider moving to an extension-centric design.
      
      ## TODO
      
      - [x] Introduce `CheckSignature` impl of `TransactionExtension` to
      ensure it's possible to have crypto be done wholly in a
      `TransactionExtension`.
      - [x] Deprecate `SignedExtension` and move all uses in codebase to
      `TransactionExtension`.
        - [x] `ChargeTransactionPayment`
        - [x] `DummyExtension`
        - [x] `ChargeAssetTxPayment` (asset-tx-payment)
        - [x] `ChargeAssetTxPayment` (asset-conversion-tx-payment)
        - [x] `CheckWeight`
        - [x] `CheckTxVersion`
        - [x] `CheckSpecVersion`
        - [x] `CheckNonce`
        - [x] `CheckNonZeroSender`
        - [x] `CheckMortality`
        - [x] `CheckGenesis`
        - [x] `CheckOnlySudoAccount`
        - [x] `WatchDummy`
        - [x] `PrevalidateAttests`
        - [x] `GenericSignedExtension`
        - [x] `SignedExtension` (chain-polkadot-bulletin)
        - [x] `RefundSignedExtensionAdapter`
      - [x] Implement `fn weight` across the board.
      - [ ] Go through all pre-existing extensions which assume an account
      signer and explicitly handle the possibility of another kind of origin.
      - [x] `CheckNonce` should probably succeed in the case of a non-account
      origin.
      - [x] `CheckNonZeroSender` should succeed in the case of a non-account
      origin.
      - [x] `ChargeTransactionPayment` and family should fail in the case of a
      non-account origin.
        - [ ] 
      - [x] Fix any broken tests.
      
      ---------
      
      Signed-off-by: default avatargeorgepisaltu <[email protected]>
      Signed-off-by: default avatarAlexandru Vasile <[email protected]>
      Signed-off-by: default avatardependabot[bot] <[email protected]>
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      Signed-off-by: default avatarAlexandru Gheorghe <[email protected]>
      Signed-off-by: default avatarAndrei Sandu <[email protected]>
      Co-authored-by: default avatarNikhil Gupta <[email protected]>
      Co-authored-by: default avatargeorgepisaltu <[email protected]>
      Co-authored-by: default avatarChevdor <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      Co-authored-by: default avatarMaciej <[email protected]>
      Co-authored-by: default avatarJavier Viola <[email protected]>
      Co-authored-by: default avatarMarcin S. <[email protected]>
      Co-authored-by: default avatarTsvetomir Dimitrov <[email protected]>
      Co-authored-by: default avatarJavier Bullrich <[email protected]>
      Co-authored-by: default avatarKoute <[email protected]>
      Co-authored-by: default avatarAdrian Catangiu <[email protected]>
      Co-authored-by: Vladimir Istyufeev's avatarVladimir Istyufeev <[email protected]>
      Co-authored-by: default avatarRoss Bulat <[email protected]>
      Co-authored-by: default avatarGonçalo Pestana <[email protected]>
      Co-authored-by: default avatarLiam Aharon <[email protected]>
      Co-authored-by: default avatarSvyatoslav Nikolsky <[email protected]>
      Co-authored-by: default avatarAndré Silva <[email protected]>
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      Co-authored-by: default avatars0me0ne-unkn0wn <[email protected]>
      Co-authored-by: default avatarordian <[email protected]>
      Co-authored-by: default avatarSebastian Kunert <[email protected]>
      Co-authored-by: default avatarAaro Altonen <[email protected]>
      Co-authored-by: default avatarDmitry Markin <[email protected]>
      Co-authored-by: default avatarAlexandru Vasile <[email protected]>
      Co-authored-by: default avatarAlexander Samusev <[email protected]>
      Co-authored-by: default avatarJulian Eager <[email protected]>
      Co-authored-by: default avatarMichal Kucharczyk <[email protected]>
      Co-authored-by: default avatarDavide Galassi <[email protected]>
      Co-authored-by: default avatarDónal Murray <[email protected]>
      Co-authored-by: default avataryjh <[email protected]>
      Co-authored-by: default avatarTom Mi <[email protected]>
      Co-authored-by: default avatardependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
      Co-authored-by: default avatarWill | Paradox | ParaNodes.io <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      Co-authored-by: default avatarJoshy Orndorff <[email protected]>
      Co-authored-by: default avatarJoshy Orndorff <[email protected]>
      Co-authored-by: default avatarPG Herveou <[email protected]>
      Co-authored-by: default avatarAlexander Theißen <[email protected]>
      Co-authored-by: default avatarKian Paimani <[email protected]>
      Co-authored-by: default avatarJuan Girini <[email protected]>
      Co-authored-by: default avatarbader y <[email protected]>
      Co-authored-by: default avatarJames Wilson <[email protected]>
      Co-authored-by: default avatarjoe petrowski <[email protected]>
      Co-authored-by: default avatarasynchronous rob <[email protected]>
      Co-authored-by: default avatarParth <[email protected]>
      Co-authored-by: default avatarAndrew Jones <[email protected]>
      Co-authored-by: default avatarJonathan Udd <[email protected]>
      Co-authored-by: default avatarSerban Iorga <[email protected]>
      Co-authored-by: default avatarEgor_P <[email protected]>
      Co-authored-by: default avatarBranislav Kontur <[email protected]>
      Co-authored-by: default avatarEvgeny Snitko <[email protected]>
      Co-authored-by: default avatarJust van Stam <[email protected]>
      Co-authored-by: default avatarFrancisco Aguirre <[email protected]>
      Co-authored-by: default avatargupnik <[email protected]>
      Co-authored-by: default avatardzmitry-lahoda <[email protected]>
      Co-authored-by: default avatarzhiqiangxu <[email protected]>
      Co-authored-by: default avatarNazar Mokrynskyi <[email protected]>
      Co-authored-by: default avatarAnwesh <[email protected]>
      Co-authored-by: default avatarcheme <[email protected]>
      Co-authored-by: default avatarSam Johnson <[email protected]>
      Co-authored-by: default avatarkianenigma <[email protected]>
      Co-authored-by: default avatarJegor Sidorenko <[email protected]>
      Co-authored-by: default avatarMuharem <[email protected]>
      Co-authored-by: default avatarjoepetrowski <[email protected]>
      Co-authored-by: default avatarAlexandru Gheorghe <[email protected]>
      Co-authored-by: default avatarGabriel Facco de Arruda <[email protected]>
      Co-authored-by: default avatarSquirrel <[email protected]>
      Co-authored-by: default avatarAndrei Sandu <[email protected]>
      Co-authored-by: default avatargeorgepisaltu <[email protected]>
      Co-authored-by: command-bot <>
      fd5f9292
  16. Mar 03, 2024
  17. Mar 01, 2024
    • Alin Dima's avatar
      provisioner: allow multiple cores assigned to the same para (#3233) · 62b78a16
      Alin Dima authored
      https://github.com/paritytech/polkadot-sdk/issues/3130
      
      builds on top of https://github.com/paritytech/polkadot-sdk/pull/3160
      
      Processes the availability cores and builds a record of how many
      candidates it should request from prospective-parachains and their
      predecessors.
      Tries to supply as many candidates as the runtime can back. Note that
      the runtime changes to back multiple candidates per para are not yet
      done, but this paves the way for it.
      
      The following backing/inclusion policy is assumed:
      1. the runtime will never back candidates of the same para which don't
      form a chain with the already backed candidates. Even if the others are
      still pending availability. We're optimistic that they won't time out
      and we don't want to back parachain forks (as the complexity would be
      huge).
      2. if a candidate is timed out of the core before being included, all of
      its successors occupying a core will be evicted.
      3. only the candidates which are made available and form a chain
      starting from the on-chain para head may be included/enacted and cleared
      from the cores. In other words, if para head is at A and the cores are
      occupied by B->C->D, and B and D are made available, only B will be
      included and its core cleared. C and D will remain on the cores awaiting
      for C to be made available or timed out. As point (2) above already
      says, if C is timed out, D will also be dropped.
      4. The runtime will deduplicate candidates which form a cycle. For
      example if the provisioner supplies candidates A->B->A, the runtime will
      only back A (as the state output will be the same)
      
      Note that if a candidate is timed out, we don't guarantee that in the
      next relay chain block the block author will be able to fill all of the
      timed out cores of the para. That increases complexity by a lot.
      Instead, the provisioner will supply N candidates where N is the number
      of candidates timed out, but doesn't include their successors which will
      be also deleted by the runtime. This'll be backfilled in the next relay
      chain block.
      
      Adjacent changes:
      - Also fixes: https://github.com/paritytech/polkadot-sdk/issues/3141
      - For non prospective-parachains, don't supply multiple candidates per
      para (we can't have elastic scaling without prospective parachains
      enabled). paras_inherent should already sanitise this input but it's
      more efficient this way.
      
      Note: all of these changes are backwards-compatible with the
      non-elastic-scaling scenario (one core per para).
      62b78a16
    • Andrei Eres's avatar
      subsystem-bench: add regression tests for availability read and write (#3311) · f0e589d7
      Andrei Eres authored
      
      
      ### What's been done
      - `subsystem-bench` has been split into two parts: a cli benchmark
      runner and a library.
      - The cli runner is quite simple. It just allows us to run `.yaml` based
      test sequences. Now it should only be used to run benchmarks during
      development.
      - The library is used in the cli runner and in regression tests. Some
      code is changed to make the library independent of the runner.
      - Added first regression tests for availability read and write that
      replicate existing test sequences.
      
      ### How we run regression tests
      - Regression tests are simply rust integration tests without the
      harnesses.
      - They should only be compiled under the `subsystem-benchmarks` feature
      to prevent them from running with other tests.
      - This doesn't work when running tests with `nextest` in CI, so
      additional filters have been added to the `nextest` runs.
      - Each benchmark run takes a different time in the beginning, so we
      "warm up" the tests until their CPU usage differs by only 1%.
      - After the warm-up, we run the benchmarks a few more times and compare
      the average with the exception using a precision.
      
      ### What is still wrong?
      - I haven't managed to set up approval voting tests. The spread of their
      results is too large and can't be narrowed down in a reasonable amount
      of time in the warm-up phase.
      - The tests start an unconfigurable prometheus endpoint inside, which
      causes errors because they use the same 9999 port. I disable it with a
      flag, but I think it's better to extract the endpoint launching outside
      the test, as we already do with `valgrind` and `pyroscope`. But we still
      use `prometheus` inside the tests.
      
      ### Future work
      * https://github.com/paritytech/polkadot-sdk/issues/3528
      * https://github.com/paritytech/polkadot-sdk/issues/3529
      * https://github.com/paritytech/polkadot-sdk/issues/3530
      * https://github.com/paritytech/polkadot-sdk/issues/3531
      
      ---------
      
      Co-authored-by: default avatarAlexander Samusev <[email protected]>
      f0e589d7
  18. Feb 29, 2024
  19. Feb 28, 2024
    • Oliver Tale-Yazdi's avatar
      Multi-Block-Migrations, `poll` hook and new System callbacks (#1781) · eefd5fe4
      Oliver Tale-Yazdi authored
      
      
      This MR is the merge of
      https://github.com/paritytech/substrate/pull/14414 and
      https://github.com/paritytech/substrate/pull/14275. It implements
      [RFC#13](https://github.com/polkadot-fellows/RFCs/pull/13), closes
      https://github.com/paritytech/polkadot-sdk/issues/198.
      
      ----- 
      
      This Merge request introduces three major topicals:
      
      1. Multi-Block-Migrations
      1. New pallet `poll` hook for periodic service work
      1. Replacement hooks for `on_initialize` and `on_finalize` in cases
      where `poll` cannot be used
      
      and some more general changes to FRAME.  
      The changes for each topical span over multiple crates. They are listed
      in topical order below.
      
      # 1.) Multi-Block-Migrations
      
      Multi-Block-Migrations are facilitated by creating `pallet_migrations`
      and configuring `System::Config::MultiBlockMigrator` to point to it.
      Executive picks this up and triggers one step of the migrations pallet
      per block.
      The chain is in lockdown mode for as long as an MBM is ongoing.
      Executive does this by polling `MultiBlockMigrator::ongoing` and not
      allowing any transaction in a block, if true.
      
      A MBM is defined through trait `SteppedMigration`. A condensed version
      looks like this:
      ```rust
      /// A migration that can proceed in multiple steps.
      pub trait SteppedMigration {
      	type Cursor: FullCodec + MaxEncodedLen;
      	type Identifier: FullCodec + MaxEncodedLen;
      
      	fn id() -> Self::Identifier;
      
      	fn max_steps() -> Option<u32>;
      
      	fn step(
      		cursor: Option<Self::Cursor>,
      		meter: &mut WeightMeter,
      	) -> Result<Option<Self::Cursor>, SteppedMigrationError>;
      }
      ```
      
      `pallet_migrations` can be configured with an aggregated tuple of these
      migrations. It then starts to migrate them one-by-one on the next
      runtime upgrade.
      Two things are important here:
      - 1. Doing another runtime upgrade while MBMs are ongoing is not a good
      idea and can lead to messed up state.
      - 2. **Pallet Migrations MUST BE CONFIGURED IN `System::Config`,
      otherwise it is not used.**
      
      The pallet supports an `UpgradeStatusHandler` that can be used to notify
      external logic of upgrade start/finish (for example to pause XCM
      dispatch).
      
      Error recovery is very limited in the case that a migration errors or
      times out (exceeds its `max_steps`). Currently the runtime dev can
      decide in `FailedMigrationHandler::failed` how to handle this. One
      follow-up would be to pair this with the `SafeMode` pallet and enact
      safe mode when an upgrade fails, to allow governance to rescue the
      chain. This is currently not possible, since governance is not
      `Mandatory`.
      
      ## Runtime API
      
      - `Core`: `initialize_block` now returns `ExtrinsicInclusionMode` to
      inform the Block Author whether they can push transactions.
      
      ### Integration
      
      Add it to your runtime implementation of `Core` and `BlockBuilder`:
      ```patch
      diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs
      @@ impl_runtime_apis! {
      	impl sp_block_builder::Core<Block> for Runtime {
      -		fn initialize_block(header: &<Block as BlockT>::Header) {
      +		fn initialize_block(header: &<Block as BlockT>::Header) -> RuntimeExecutiveMode {
      			Executive::initialize_block(header)
      		}
      
      		...
      	}
      ```
      
      # 2.) `poll` hook
      
      A new pallet hook is introduced: `poll`. `Poll` is intended to replace
      mostly all usage of `on_initialize`.
      The reason for this is that any code that can be called from
      `on_initialize` cannot be migrated through an MBM. Currently there is no
      way to statically check this; the implication is to use `on_initialize`
      as rarely as possible.
      Failing to do so can result in broken storage invariants.
      
      The implementation of the poll hook depends on the `Runtime API` changes
      that are explained above.
      
      # 3.) Hard-Deadline callbacks
      
      Three new callbacks are introduced and configured on `System::Config`:
      `PreInherents`, `PostInherents` and `PostTransactions`.
      These hooks are meant as replacement for `on_initialize` and
      `on_finalize` in cases where the code that runs cannot be moved to
      `poll`.
      The reason for this is to make the usage of HD-code (hard deadline) more
      explicit - again to prevent broken invariants by MBMs.
      
      # 4.) FRAME (general changes)
      
      ## `frame_system` pallet
      
      A new memorize storage item `InherentsApplied` is added. It is used by
      executive to track whether inherents have already been applied.
      Executive and can then execute the MBMs directly between inherents and
      transactions.
      
      The `Config` gets five new items:
      - `SingleBlockMigrations` this is the new way of configuring migrations
      that run in a single block. Previously they were defined as last generic
      argument of `Executive`. This shift is brings all central configuration
      about migrations closer into view of the developer (migrations that are
      configured in `Executive` will still work for now but is deprecated).
      - `MultiBlockMigrator` this can be configured to an engine that drives
      MBMs. One example would be the `pallet_migrations`. Note that this is
      only the engine; the exact MBMs are injected into the engine.
      - `PreInherents` a callback that executes after `on_initialize` but
      before inherents.
      - `PostInherents` a callback that executes after all inherents ran
      (including MBMs and `poll`).
      - `PostTransactions` in symmetry to `PreInherents`, this one is called
      before `on_finalize` but after all transactions.
      
      A sane default is to set all of these to `()`. Example diff suitable for
      any chain:
      ```patch
      @@ impl frame_system::Config for Test {
       	type MaxConsumers = ConstU32<16>;
      +	type SingleBlockMigrations = ();
      +	type MultiBlockMigrator = ();
      +	type PreInherents = ();
      +	type PostInherents = ();
      +	type PostTransactions = ();
       }
      ```
      
      An overview of how the block execution now looks like is here. The same
      graph is also in the rust doc.
      
      <details><summary>Block Execution Flow</summary>
      <p>
      
      ![Screenshot 2023-12-04 at 19 11
      29](https://github.com/paritytech/polkadot-sdk/assets/10380170/e88a80c4-ef11-4faa-8df5-8b33a724c054)
      
      </p>
      </details> 
      
      ## Inherent Order
      
      Moved to https://github.com/paritytech/polkadot-sdk/pull/2154
      
      ---------------
      
      
      ## TODO
      
      - [ ] Check that `try-runtime` still works
      - [ ] Ensure backwards compatibility with old Runtime APIs
      - [x] Consume weight correctly
      - [x] Cleanup
      
      ---------
      
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      Co-authored-by: default avatarLiam Aharon <[email protected]>
      Co-authored-by: default avatarJuan Girini <[email protected]>
      Co-authored-by: command-bot <>
      Co-authored-by: default avatarFrancisco Aguirre <[email protected]>
      Co-authored-by: default avatarGavin Wood <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      eefd5fe4
    • Clara van Staden's avatar
      Snowbridge - Extract Ethereum Chain ID (#3501) · 576681b8
      Clara van Staden authored
      While adding runtime tests to
      https://github.com/polkadot-fellows/runtimes/pull/130, I noticed the
      Ethereum chain ID was hardcoded. For Kusama + Polkadot, the Ethereum
      chain ID should 1 (Mainnet), whereas on Rococo it is 11155111 (Sepolia).
      
      This PR also updates the Snowbridge crates versions to the current
      versions on crates.io.
      
      ---------
      
      Co-authored-by: claravanstaden <Cats 4 life!>
      576681b8
    • Kian Paimani's avatar
      Add documentation around FRAME Offchain workers (#3463) · 14530269
      Kian Paimani authored
      
      
      - deprecation companion:
      https://github.com/substrate-developer-hub/substrate-docs/pull/2136
      - inspired by
      https://substrate.stackexchange.com/questions/11058/how-can-i-create-ocw-that-wont-activates-every-block-but-will-activates-only-w/11060#11060
      
      ---------
      
      Co-authored-by: default avatarSergej Sakac <[email protected]>
      14530269
    • Liam Aharon's avatar
      Runtime Upgrade ref docs and Single Block Migration example pallet (#1554) · 12ce4f7d
      Liam Aharon authored
      Closes https://github.com/paritytech/polkadot-sdk-docs/issues/55
      
      - Changes 'current storage version' terminology to less ambiguous
      'in-code storage version' (suggestion by @ggwpez
      
      )
      - Adds a new example pallet `pallet-example-single-block-migrations`
      - Adds a new reference doc to replace
      https://docs.substrate.io/maintain/runtime-upgrades/ (temporarily living
      in the pallet while we wait for developer hub PR to merge)
      - Adds documentation for the `storage_alias` macro
      - Improves `trait Hooks` docs 
      - Improves `trait GetStorageVersion` docs
      - Update the suggested patterns for using `VersionedMigration`, so that
      version unchecked migrations are never exported
      - Prevents accidental usage of version unchecked migrations in runtimes
      
      https://github.com/paritytech/substrate/pull/14421#discussion_r1255467895
      - Unversioned migration code is kept inside `mod version_unchecked`,
      versioned code is kept in `pub mod versioned`
      - It is necessary to use modules to limit visibility because the inner
      migration must be `pub`. See
      https://github.com/rust-lang/rust/issues/30905 and
      
      https://internals.rust-lang.org/t/lang-team-minutes-private-in-public-rules/4504/40
      for more.
      
      ### todo
      
      - [x] move to reference docs to proper place within sdk-docs (now that
      https://github.com/paritytech/polkadot-sdk/pull/2102 is merged)
      - [x] prdoc
      
      ---------
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      Co-authored-by: default avatarJuan <[email protected]>
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      Co-authored-by: command-bot <>
      Co-authored-by: default avatargupnik <[email protected]>
      12ce4f7d
    • maksimryndin's avatar
      Collator overseer builder unification (#3335) · 7ec0b874
      maksimryndin authored
      
      
      resolve https://github.com/paritytech/polkadot-sdk/issues/3116
      
      a follow-up on
      https://github.com/paritytech/polkadot-sdk/pull/3061#pullrequestreview-1847530265:
      
      - [x] reuse collator overseer builder for polkadot-node and collator
      - [x] run zombienet test (0001-parachains-smoke-test.toml)
      - [x] make wasm build errors more user-friendly for an easier problem
      detection when using different toolchains in Rust
      
      ---------
      
      Co-authored-by: default avatarordian <[email protected]>
      Co-authored-by: default avatars0me0ne-unkn0wn <[email protected]>
      7ec0b874
  20. Feb 27, 2024
    • Kian Paimani's avatar
      Add documentation around FRAME Origin (#3362) · 29369a4e
      Kian Paimani authored
      Does the following: 
      
      - Add a reference doc page named `frame_runtime_types`, which explains
      what types like `RuntimeOrigin`, `RuntimeCall` etc are.
      - On top of it, it adds a reference doc page called `frame_origin` which
      explains a few important patterns that we use around origins
      - And finally brushes up `#[frame::origin]` docs. 
      - Updates the theme, sidebar and favicon to look like: 
      
      <img width="1728" alt="Screenshot 2024-02-20 at 12 16 00"
      src="https://github.com/paritytech/polkadot-sdk/assets/5588131/6d60a16b-2081-411b-8869-43b91920cca9">
      
      
      All of this was inspired by
      https://substrate.stackexchange.com/questions/10992/how-do-you-find-the-public-key-for-the-medium-spender-track-origin/10993
      
      closes https://github.com/paritytech/polkadot-sdk-docs/issues/45
      closes https://github.com/paritytech/polkadot-sdk-docs/issues/43
      contributes / overlaps with
      https://github.com/paritytech/polkadot-sdk/pull/2638 cc @liamaharon
      
      
      deprecation companion:
      https://github.com/substrate-developer-hub/substrate-docs/pull/2131
      pba-content companion:
      https://github.com/Polkadot-Blockchain-Academy/pba-content/pull/977
      
      ---------
      
      Co-authored-by: default avatarRadha <[email protected]>
      Co-authored-by: default avatarSebastian Kunert <[email protected]>
      Co-authored-by: default avatarGonçalo Pestana <[email protected]>
      Co-authored-by: default avatarLiam Aharon <[email protected]>
      29369a4e
  21. Feb 26, 2024
    • Sebastian Kunert's avatar
      Introduce Notification block pinning limit (#2935) · 6c5a42a6
      Sebastian Kunert authored
      
      
      While investigating some pruning issues I found some room for
      improvement in the notification pin handling.
      
      **Problem:** It was not possible to define an upper limit on
      notification pins. The block pinning cache has a limit, but only handles
      bodies and justifications.
      
      After this PR, bookkeeping for notifications is managed in the pinning
      worker. A limit can be defined in the worker. If that limit is crossed,
      blocks that were pinned for that notification are unpinned, which now
      affects the state as well as bodies and justifications. The pinned
      blocks cache still has a limit, but should never be hit.
      
      closes #19
      
      ---------
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      Co-authored-by: default avatarAndré Silva <[email protected]>
      6c5a42a6
    • Branislav Kontur's avatar
      [pallet-xcm] Adjust benchmarks (teleport_assets/reserve_transfer_assets) not relying on ED (#3464) · 3d9439f6
      Branislav Kontur authored
      
      
      ## Problem
      During the bumping of the `polkadot-fellows` repository to
      `[email protected]`, I encountered a situation where the benchmarks
      `teleport_assets` and `reserve_transfer_assets` in AssetHubKusama
      started to fail. This issue arose due to a decreased ED balance for
      AssetHubs introduced
      [here](https://github.com/polkadot-fellows/runtimes/pull/158/files#diff-80668ff8e793b64f36a9a3ec512df5cbca4ad448c157a5d81abda1b15f35f1daR213),
      and also because of a [missing CI
      pipeline](https://github.com/polkadot-fellows/runtimes/issues/197) to
      check the benchmarks, which went unnoticed.
      
      These benchmarks expect the `caller` to have enough:
      1. balance to transfer (BTT)
      2. balance for paying delivery (BFPD).
       
      So the initial balance was calculated as `ED * 100`, which seems
      reasonable:
      ```
      const ED_MULTIPLIER: u32 = 100;
      let balance = existential_deposit.saturating_mul(ED_MULTIPLIER.into());`
      ```
      The problem arises when the price for delivery is 100 times higher than
      the existential deposit. In other words, when `ED * 100` does not cover
      `BTT` + `BFPD`.
      
      I check AHR/AHW/AHK/AHP and this problem has only AssetHubKusama
      ```
      ED: 3333333
      calculated price to parent delivery:  1031666634  (from xcm logs from the benchmark)
      ---
      
      3333333 * 100 - BTT(3333333) - BFPD(1031666634) = −701666667
      ```
      which results in the error;
      ```
      2024-02-23 09:19:42 Unable to charge fee with error Module(ModuleError { index: 31, error: [17, 0, 0, 0], message: Some("FeesNotMet") })
      Error: Input("Benchmark pallet_xcm::reserve_transfer_assets failed: FeesNotMet")
           
      ```
      
      ## Solution
      
      The benchmarks `teleport_assets` and `reserve_transfer_assets` were
      fixed by removing `ED * 100` and replacing it with `DeliveryHelper`
      logic, which calculates the (almost real) price for delivery and sets it
      along with the existential deposit as the initial balance for the
      account used in the benchmark.
      
      
      ## TODO
      
      - [ ] patch for 1.6 -
      https://github.com/paritytech/polkadot-sdk/pull/3466
      - [ ] patch for 1.7 -
      https://github.com/paritytech/polkadot-sdk/pull/3465
      - [ ] patch for 1.8 - TODO: PR
      
      ---------
      
      Co-authored-by: default avatarFrancisco Aguirre <[email protected]>
      3d9439f6
  22. Feb 23, 2024
    • Andrei Sandu's avatar
      Runtime: allow backing multiple candidates of same parachain on different cores (#3231) · 2431001e
      Andrei Sandu authored
      
      
      Fixes https://github.com/paritytech/polkadot-sdk/issues/3144
      
      Builds on top of https://github.com/paritytech/polkadot-sdk/pull/3229
      
      ### Summary
      Some preparations for Runtime to support elastic scaling, guarded by
      config node features bit `FeatureIndex::ElasticScalingMVP`. This PR
      introduces a per-candidate `CoreIndex` but does it in a hacky way to
      avoid changing `CandidateCommitments`, `CandidateReceipts` primitives
      and networking protocols.
      
      #### Including `CoreIndex` in `BackedCandidate`
      If the `ElasticScalingMVP` feature bit is enabled then
      `BackedCandidate::validator_indices` is extended by 8 bits.
      The value stored in these bits represents the assumed core index for the
      candidate.
      
      It is temporary solution which works by creating a mapping from
      `BackedCandidate` to `CoreIndex` by assuming the `CoreIndex` can be
      discovered by checking in which validator group the validator that
      signed the statement is.
      
      TODO:
      - [x] fix tests
      - [x] add new tests
      - [x] Bump runtime API for Kusama, so we have that node features thing!
      -> https://github.com/polkadot-fellows/runtimes/pull/194
      
      ---------
      
      Signed-off-by: default avatarAndrei Sandu <[email protected]>
      Signed-off-by: default avataralindima <[email protected]>
      Co-authored-by: default avataralindima <[email protected]>
      2431001e
    • Sebastian Kunert's avatar
      PoV Reclaim Runtime Side (#3002) · 3386377b
      Sebastian Kunert authored
      
      
      # Runtime side for PoV Reclaim
      
      ## Implementation Overview
      - Hostfunction to fetch the storage proof size has been added to the
      PVF. It uses the size tracking recorder that was introduced in my
      previous PR.
      - Mechanisms to use the reclaim HostFunction have been introduced.
      - 1. A SignedExtension that checks the node-reported proof size before
      and after application of an extrinsic. Then it reclaims the difference.
      - 2. A manual helper to make reclaiming easier when manual interaction
      is required, for example in `on_idle` or other hooks.
      - In order to utilize the manual reclaiming, I modified `WeightMeter` to
      support the reduction of consumed weight, at least for storage proof
      size.
      
      ## How to use
      To enable the general functionality for a parachain:
      1. Add the SignedExtension to your parachain runtime. 
      2. Provide the HostFunction to the node
      3. Enable proof recording during block import
      
      ## TODO
      - [x] PRDoc
      
      ---------
      
      Co-authored-by: default avatarDmitry Markin <[email protected]>
      Co-authored-by: default avatarDavide Galassi <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      3386377b
    • Ignacio Palacios's avatar
      Fix `DepositReserveAsset` fees payment (#3340) · 11b5354f
      Ignacio Palacios authored
      The `fee` should be calculated with the reanchored asset, otherwise it
      could lead to a failure where the set aside fee ends up not being
      enough.
      
      @acatangiu
      
      
      
      ---------
      
      Co-authored-by: default avatarAdrian Catangiu <[email protected]>
      11b5354f
  23. Feb 22, 2024
    • Andrei Sandu's avatar
      Elastic scaling: use an assumed `CoreIndex` in `candidate-backing` (#3229) · 60e537b9
      Andrei Sandu authored
      
      
      First step in implementing
      https://github.com/paritytech/polkadot-sdk/issues/3144
      
      ### Summary of changes
      - switch statement `Table` candidate mapping from `ParaId` to
      `CoreIndex`
      - introduce experimental `InjectCoreIndex`  node feature.
      - determine and assume a `CoreIndex` for a candidate based on statement
      validator index. If the signature is valid it means validator controls
      the validator that index and we can easily map it to a validator
      group/core.
      - introduce a temporary provisioner fix until we fully enable elastic
      scaling in the subystem. The fix ensures we don't fetch the same
      backable candidate when calling `get_backable_candidate` for each core.
      
      TODO:
      - [x] fix backing tests
      - [x] fix statement table tests
      - [x] add new test
      
      ---------
      
      Signed-off-by: default avatarAndrei Sandu <[email protected]>
      Signed-off-by: default avataralindima <[email protected]>
      Co-authored-by: default avataralindima <[email protected]>
      60e537b9