Commit Graph

15459 Commits

Author SHA1 Message Date
Juan Ignacio Rios 8b3bf39ab8 Add HRMP notification handlers to the xcm-executor (#3696)
Currently the xcm-executor returns an `Unimplemented` error if it
receives any HRMP-related instruction.
What I propose here, which is what we are currently doing in our forked
executor at polimec, is to introduce a trait implemented by the executor
which will handle those instructions.

This way, if parachains want to keep the default behavior, they just use
`()` and it will return unimplemented, but they can also implement their
own logic to establish HRMP channels with other chains in an automated
fashion, without requiring to go through governance.

Our implementation is mentioned in the [polkadot HRMP
docs](https://arc.net/l/quote/hduiivbu), and it was suggested to us to
submit a PR to add these changes to polkadot-sdk.

---------

Co-authored-by: Branislav Kontur <bkontur@gmail.com>
Co-authored-by: command-bot <>
2024-03-19 08:12:39 +00:00
dependabot[bot] e2ead88876 Bump the known_good_semver group with 2 updates (#3726)
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: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-19 03:34:17 +00:00
Matteo Muraca 610987a19d removed pallet::getter usage from cumulus pallets (#3471)
Part of #3326 

@ggwpez @kianenigma @shawntabrizi

polkadot address: 12poSUQPtcF1HUPQGY3zZu2P8emuW9YnsPduA4XG3oCEfJVp

---------

Signed-off-by: Matteo Muraca <mmuraca247@gmail.com>
2024-03-18 19:19:20 +00:00
Serban Iorga 0c6c837f68 Bridge zombienet tests: remove unneeded accounts (#3700)
Bridge zombienet tests: remove unneeded accounts
2024-03-18 12:37:24 +00:00
jokess123 1d60f9ca9a Fix typos (#3725) 2024-03-18 12:18:40 +00:00
Alexandru Gheorghe 8d0cd4ffc8 Fix kusama validators getting 0 backing rewards the first session they enter the active set (#3722)
There is a problem in the way we update `authorithy-discovery` next keys
and because of that nodes that enter the active set would be noticed at
the start of the session they become active, instead of the start of the
previous session as it was intended. This is problematic because:

1. The node itself advertises its addresses on the DHT only when it
notices it should become active on around ~10m loop, so in this case it
would notice after it becomes active.
2. The other nodes won't be able to detect the new nodes addresses at
the beginning of the session, so it won't added them to the reserved
set.

With 1 + 2, we end-up in a situation where the the new node won't be
able to properly connect to its peers because it won't be in its peers
reserved set. Now, the nodes accept by default`MIN_GOSSIP_PEERS: usize =
25` connections to nodes that are not in the reserved set, but given
Kusama size(> 1000 nodes) you could easily have more than`25` new nodes
entering the active set or simply the nodes don't have slots anymore
because, they already have connections to peers not in the active set.

In the end what the node would notice is 0 backing rewards because it
wasn't directly connected to the peers in its backing group.

## Root-cause

The flow is like this:
1. At BAD_SESSION - 1, in `rotate_session` new nodes are added to
QueuedKeys
https://github.com/paritytech/polkadot-sdk/blob/02e1a7f476d7d7c67153e975ab9a1bdc02ffea12/substrate/frame/session/src/lib.rs#L609
```
 <QueuedKeys<T>>::put(queued_amalgamated.clone());
<QueuedChanged<T>>::put(next_changed);
```
2. AuthorityDiscovery::on_new_session is called with `changed` being the
value of `<QueuedChanged<T>>:` at BAD_SESSION - **2** because it was
saved before being updated
https://github.com/paritytech/polkadot-sdk/blob/02e1a7f476d7d7c67153e975ab9a1bdc02ffea12/substrate/frame/session/src/lib.rs#L613
3. At BAD_SESSION - 1, `AuthorityDiscovery::on_new_session` doesn't
updated its next_keys because `changed` was false.
4. For the entire durations of `BAD_SESSION - 1` everyone calling
runtime api `authorities`(should return past, present and future
authorities) won't discover the nodes that should become active .
5. At the beginning of BAD_SESSION, all nodes discover the new nodes are
authorities, but it is already too late because reserved_nodes are
updated only at the beginning of the session by the `gossip-support`.
See above why this bad.

## Fix
Update next keys with the queued_validators at every session, not matter
the value of `changed` this is the same way babe pallet correctly does
it.
https://github.com/paritytech/polkadot-sdk/blob/02e1a7f476d7d7c67153e975ab9a1bdc02ffea12/substrate/frame/babe/src/lib.rs#L655

## Notes

- The issue doesn't reproduce with proof-authorities changes like
`versi` because `changed` would always be true and `AuthorityDiscovery`
correctly updates its next_keys every time.
- Confirmed at session `37651` on kusama that this is exactly what it
happens by looking at blocks with polkadot.js.

## TODO
- [ ] Move versi on proof of stake and properly test before and after
fix to confirm there is no other issue.

---------

Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>
Co-authored-by: Bastian Köcher <git@kchr.de>
2024-03-18 11:45:39 +00:00
K Gunjan 816c072abd Pallet AURA: remove pallet::getter macro and write the corresponding code (#3350)
Removed the `pallet::getter` macro call from storage type definitions
and added the corresponding implementations directly.
fixes #3330  

polkadot address: 14JzTPPUd8x8phKi8qLxHgNTnTMg6DUukCLXoWprejkaHXPz

---------

Co-authored-by: Bastian Köcher <git@kchr.de>
2024-03-18 10:27:48 +00:00
Squirrel 1b5f4243d1 sp-std removal from substrate/primitives (#3274)
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: Koute <koute@users.noreply.github.com>
2024-03-18 05:29:35 +00:00
jokess123 6b1179f13b Fix typo (#3691) 2024-03-17 22:50:54 +00:00
dependabot[bot] fe343cc71c Bump the known_good_semver group with 3 updates (#3717)
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: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-17 20:19:21 +00:00
s0me0ne-unkn0wn 1f9505c0d3 Eliminate experimental feature (#3654)
Totally removes the `experimental` feature. Closes #3648.

---------

Co-authored-by: Bastian Köcher <git@kchr.de>
2024-03-17 20:02:11 +00:00
Oliver Tale-Yazdi d2a7100e3b Crowdload burn remaining funds (#3707)
Crowdloan account should burn all funds after a crowd loan got dissolved
to ensure that the account is reaped correctly.

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
2024-03-17 13:21:29 +00:00
ordian 02e1a7f476 collator protocol changes for elastic scaling (validator side) (#3302)
Fixes #3128.

This introduces a new variant for the collation response from the
collator that includes the parent head data. For now, collators won't
send this new variant. We'll need to change the collator side of the
collator protocol to detect all the cores assigned to a para and send
the parent head data in the case when it's more than 1 core.

- [x] validate approach
- [x] check head data hash
2024-03-15 19:43:28 +00:00
PG Herveou e8b51f60cc Contracts use polkavm workspace deps (#3715) 2024-03-15 17:24:38 +00:00
Andrei Sandu 4987d79824 Add elastic scaling support in ParaInherent BenchBuilder (#3690)
Extracted Benchbuilder enhancements used in
https://github.com/paritytech/polkadot-sdk/pull/3644 . Might still
require some work to fully support all scenarios when disputing elastic
scaling parachains, but it should be useful in writing elastic scaling
runtime tests.

---------

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
2024-03-15 11:42:58 +00:00
gupnik 7099f6e1b1 Removes as [disambiguation_path] from derive_impl usage (#3652)
Step in https://github.com/paritytech/polkadot-sdk/issues/171

This PR removes `as [disambiguation_path]` syntax from `derive_impl`
usage across the polkadot-sdk as introduced in
https://github.com/paritytech/polkadot-sdk/pull/3505
2024-03-15 07:46:09 +00:00
Alejandro Martinez Andres 3c6ebd9e9b fix(paseo-spec): New Paseo Bootnodes (#3674)
This change includes new bootnodes for Paseo. 

_This is meant to be a silent PR_
2024-03-14 10:44:55 +00:00
Ignacio Palacios cfc4050d6b Improve Penpal runtime + emulated tests (#3543)
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 <>
2024-03-14 10:29:24 +00:00
Gonçalo Pestana 606664e1bd Staking ledger bonding fixes (#3639)
Currently, the staking logic does not prevent a controller from becoming
a stash of *another* ledger (introduced by [removing this
check](https://github.com/paritytech/polkadot-sdk/pull/1484/files#diff-3aa6ceab5aa4e0ab2ed73a7245e0f5b42e0832d8ca5b1ed85d7b2a52fb196524L850)).
Given that the remaining of the code expects that never happens, bonding
a ledger with a stash that is a controller of another ledger may lead to
data inconsistencies and data losses in bonded ledgers. For more
detailed explanation of this issue:
https://hackmd.io/@gpestana/HJoBm2tqo/%2FTPdi28H7Qc2mNUqLSMn15w

In a nutshell, when fetching a ledger with a given controller, we may be
end up getting the wrong ledger which can lead to unexpected ledger
states.

This PR also ensures that `set_controller` does not lead to data
inconsistencies in the staking ledger and bonded storage in the case
when a controller of a stash is a stash of *another* ledger. and
improves the staking `try-runtime` checks to catch potential issues with
the storage preemptively.

In summary, there are two important cases here:

1. **"Sane" double bonded ledger**

When a controller of a ledger is a stash of *another* ledger. In this
case, we have:

```
> Bonded(stash, controller)
(A, B)  // stash A with controller B
(B, C) // B is also a stash of another ledger
(C, D)

> Ledger(controller)
Ledger(B) = L_a (stash = A)
Ledger(C) = L_b (stash = B)
Ledger(D) = L_c (stash = C)
```

In this case, the ledgers can be mutated and all operations are OK.
However, we should not allow `set_controller` to be called if it means
it results in a "corrupt" double bonded ledger (see below).

3. **"Corrupt" double bonded ledger**

```
> Bonded(stash, controller)
(A, B)  // stash A with controller B
(B, B)
(C, D)
```
In this case, B is a stash and controller AND is corrupted, since B is
responsible for 2 ledgers which is not correct and will lead to
inconsistent states. Thus, in this case, in this PR we are preventing
these ledgers from mutating (i.e. operations like bonding extra etc)
until the ledger is brought back to a consistent state.

--- 

**Changes**:
- Checks if stash is already a controller when calling `Call::bond`
(fixes the regression introduced by [removing this
check](https://github.com/paritytech/polkadot-sdk/pull/1484/files#diff-3aa6ceab5aa4e0ab2ed73a7245e0f5b42e0832d8ca5b1ed85d7b2a52fb196524L850));
- Ensures that all fetching ledgers from storage are done through the
`StakingLedger` API;
- Ensures that -- when fetching a ledger from storage using the
`StakingLedger` API --, a `Error::BadState` is returned if the ledger
bonding is in a bad state. This prevents bad ledgers from mutating (e.g.
`bond_extra`, `set_controller`, etc) its state and avoid further data
inconsistencies.
- Prevents stashes which are controllers or another ledger from calling
`set_controller`, since that may lead to a bad state.
- Adds further try-state runtime checks that check if there are ledgers
in a bad state based on their bonded metadata.

Related to https://github.com/paritytech/polkadot-sdk/issues/3245

---------

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: kianenigma <kian@parity.io>
2024-03-14 09:49:46 +00:00
Dino Pačandi d55d4f64b5 DescribeAllTerminal for HashedDescription (#3349)
Make Rococo & Westend XCM's location converter `HashedDescription` more
in line with Polkadot/Kusama runtimes.

Co-authored-by: Muharem <ismailov.m.h@gmail.com>
2024-03-14 09:16:02 +00:00
Javier Viola c4c9257386 Increase timeout for assertions (#3680)
Prevents timeouts in ci like
https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/5516019
2024-03-14 07:41:44 +00:00
Andrei Eres 256546b7b9 Add subsystems regression tests to CI (#3527)
Fixes https://github.com/paritytech/polkadot-sdk/issues/3530
2024-03-13 16:54:41 +00:00
Alexandru Gheorghe 878b5dd010 Always print connectivity report (#3677)
This is printed every 10 minutes, I see no reason why it shouldn't be in
all the logs, it would give us valuable information about what is going
on with node connectivity when validators come-back to us to report
issues.

Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>
2024-03-13 14:28:14 +00:00
georgepisaltu bbd51ce867 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: georgepisaltu <george.pisaltu@parity.io>
2024-03-13 14:10:59 +00:00
Alexandru Vasile 60ac5a723c authority-discovery: Add log for debugging DHT authority records (#3668)
This PR adds a debug log for displaying all the public addresses that
will later be advertised in the DHT record of the authority. The
Authority DHT record will contain the address ++ `/p2p/peerID` (if not
already present).

This log enables us to check if different nodes will advertise in the
DHT record of the authority the same IP address, however with different
peer IDs.

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2024-03-13 11:33:27 +00:00
gupnik 82f3c3e2e8 Construct Runtime v2 (#1378)
Moved from https://github.com/paritytech/substrate/pull/14788

----

Fixes https://github.com/paritytech/polkadot-sdk/issues/232

This PR introduces outer-macro approach for `construct_runtime` as
discussed in the linked issue. It looks like the following:
```rust
#[frame_support::runtime]
mod runtime {
	#[runtime::runtime]
        #[runtime::derive(
		RuntimeCall,
		RuntimeEvent,
		RuntimeError,
		RuntimeOrigin,
		RuntimeFreezeReason,
		RuntimeHoldReason,
		RuntimeSlashReason,
		RuntimeLockId,
                RuntimeTask,
	)]
	pub struct Runtime;

	#[runtime::pallet_index(0)]
	pub type System = frame_system;

	#[runtime::pallet_index(1)]
	pub type Timestamp = pallet_timestamp;

	#[runtime::pallet_index(2)]
	pub type Aura = pallet_aura;

	#[runtime::pallet_index(3)]
	pub type Grandpa = pallet_grandpa;

	#[runtime::pallet_index(4)]
	pub type Balances = pallet_balances;

	#[runtime::pallet_index(5)]
	pub type TransactionPayment = pallet_transaction_payment;

	#[runtime::pallet_index(6)]
	pub type Sudo = pallet_sudo;

	// Include the custom logic from the pallet-template in the runtime.
	#[runtime::pallet_index(7)]
	pub type TemplateModule = pallet_template;
}
```

## Features
- `#[runtime::runtime]` attached to a struct defines the main runtime
- `#[runtime::derive]` attached to this struct defines the types
generated by runtime
- `#[runtime::pallet_index]` must be attached to a pallet to define its
index
- `#[runtime::disable_call]` can be optionally attached to a pallet to
disable its calls
- `#[runtime::disable_unsigned]` can be optionally attached to a pallet
to disable unsigned calls
- A pallet instance can be defined as `TemplateModule:
pallet_template<Instance>`
- An optional attribute can be defined as
`#[frame_support::runtime(legacy_ordering)]` to ensure that the order of
hooks is same as the order of pallets (and not based on the
pallet_index). This is to support legacy runtimes and should be avoided
for new ones.

## Todo
- [x] Update the latest syntax in kitchensink and tests
- [x] Update UI tests
- [x] Docs

## Extension
- Abstract away the Executive similar to
https://github.com/paritytech/substrate/pull/14742
- Optionally avoid the need to specify all runtime types (TBD)

---------

Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
Co-authored-by: Nikhil Gupta <>
2024-03-13 07:01:01 +00:00
Michal Kucharczyk a756baf3b2 Support for keyring in runtimes (#2044)
This functionality is required for #1984.

This PR enables
[`sp-keyring`](https://github.com/paritytech/polkadot-sdk/blob/21d36b7b4229c4d5225944f197918cde23fda4ea/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/21d36b7b4229c4d5225944f197918cde23fda4ea/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/d6f15306282e3de848a09c9aa9cba6f95a7811f0/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: Davide Galassi <davxy@datawok.net>
2024-03-12 11:43:31 +00:00
Alexandru Gheorghe 1ead59773e Add api-name in cannot query the runtime API version warning (#3653)
Sometimes we see nodes printing this warning:
```
cannot query the runtime API version: Api called for an unknown Block: State already discarded for
```

The log is harmless, but let's print the api we got this for, so that we
can track its call site and truly confirm it is harmless or fix it.

Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>
2024-03-12 08:33:54 +00:00
Koute b0f34e4b29 Add a PolkaVM-based executor (#3458)
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.
2024-03-12 05:23:06 +00:00
gupnik 7315a9b8fd Adds default config for assets pallet (#3637)
Step in https://github.com/paritytech/polkadot-sdk/issues/171
2024-03-12 04:42:58 +00:00
dependabot[bot] 7a644fa082 Bump handlebars from 4.3.7 to 5.1.0 (#3248)
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: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Bastian Köcher <git@kchr.de>
2024-03-11 22:20:48 +00:00
georgepisaltu 7839400f12 [Collator Selection] Fix weight refund for set_candidacy_bond (#3643)
Fixes #3642 

This PR implements the weight refund of
`pallet_collator_selection::set_candidacy_bond` to account for no
iterations when the bond is decreased.

---------

Signed-off-by: georgepisaltu <george.pisaltu@parity.io>
Co-authored-by: Bastian Köcher <git@kchr.de>
2024-03-11 22:12:58 +00:00
philoniare d3f81056ad [Deprecation] Remove the deprecated Store trait (#3532)
# Description

*Removes the deprecated `trait Store` feature from the code base*

Fixes #222

---------

Co-authored-by: Dónal Murray <donalm@seadanda.dev>
2024-03-11 20:39:21 +00:00
Andrei Eres 05381afcb2 subsystem-bench: adjust test config to Kusama (#3583)
Fixes https://github.com/paritytech/polkadot-sdk/issues/3528

```rust
latency:
    mean_latency_ms = 30 // common sense
    std_dev = 2.0 // common sense
n_validators = 300 // max number of validators, from chain config
n_cores = 60 // 300/5
max_validators_per_core = 5 // default
min_pov_size = 5120 // max
max_pov_size = 5120 // max
peer_bandwidth = 44040192 // from the Parity's kusama validators
bandwidth = 44040192 // from the Parity's kusama validators
connectivity = 90 // we need to be connected to 90-95% of peers
```
2024-03-11 16:17:45 +00:00
Tsvetomir Dimitrov 02f1f2c476 Small fixes in para-scheduler pallet (#3524)
Fixes some typos, outdated comments and test asserts. Also uses safe
math and `defensive` for arithmetic operations.
2024-03-11 16:00:52 +00:00
s0me0ne-unkn0wn 4249a3d6cb Remove getters from im-online pallet (#3589)
As I've been dancing around this pallet for quite some time anyway, I
decided to remove getters at once. There were only a few leftovers in
tests.

Related: #3326 
CC @muraca
2024-03-11 14:38:44 +00:00
Dónal Murray aa35328371 [pallet_broker] Fix adapt_price behaviour at zero (#3636)
This fixes the behaviour of `Linear` which is the default implementation
of the `AdaptPrice` trait in the broker pallet. Previously if cores were
offered but not sold in only one sale, the price would be set to zero
and due to the logic being purely multiplicative, the price would stay
at 0 indefinitely.

This could be further paired with a configurable minimum in the broker
pallet itself, which will be a future PR.

This affects the Rococo and Westend Coretime chains, but Kusama has a
different implementation so this isn't required for the Kusama launch. I
actually thought I opened this a while ago.

---------

Co-authored-by: Bastian Köcher <git@kchr.de>
2024-03-11 14:12:27 +00:00
eskimor 8dc6048d5e Remove unused FullCandidateReceipt (#3641)
Currently redesigning candidate data structures, noticed that this one
seems dead.

Co-authored-by: eskimor <eskimor@no-such-url.com>
2024-03-11 14:11:55 +00:00
Egor_P a6713c55fd Fix release docker image GHA (#3547)
This PR add extra checks for the input fields in the GHA which does the
docker image build and publishing.
2024-03-11 09:37:22 +00:00
Muharem bbaa5a3bb5 Asset Conversion: doc guide to address incorrect exchange rate for non-withdrawable pool (#3275)
This documentation guide to address an incorrect exchange rate for a
non-withdrawable pool.
2024-03-10 21:24:41 +00:00
Viki Val 1c435e91c1 🐛 Depositing PalletAttributeSet on incorrect nft (#2740)
## Context

Implementing `HolderOf(collection_id)` we have observed a fancy glitch
where pallet deposits event with incorrect values

### Test case 

[Observe following
extrinsic](https://assethub-polkadot.subscan.io/extrinsic/0xdc72321b7674aa209c2f194ed49bd6bd12708af103f98b5b9196e0132dcba777)

To mint in collection `51` user needs to be `HolderOf(50)`.
Therefore current user is owner of item `394` `witness_data {
owned_item: 394 }`

All checking is done correctly, storage is updated correctly

 
![photo_2023-12-18 16 07
11](https://github.com/paritytech/polkadot-sdk/assets/22471030/ca991272-156d-4db1-97b2-1a2873fc5d3f)

However the event which is emitted does not make semantic sense as we
updated storage for `50-394` not for `51-114`

![photo_2023-12-18 16 07
17](https://github.com/paritytech/polkadot-sdk/assets/22471030/c998a92c-e306-4433-aad8-103078140e23)

## The fix 

This PR fixes that depositing `PalletAttributeSet` emits correct values.

---------

Co-authored-by: Jegor Sidorenko <jegor@parity.io>
Co-authored-by: Jegor Sidorenko <5252494+jsidorenko@users.noreply.github.com>
2024-03-09 15:32:53 +00:00
Michal Kucharczyk 9f5d9fa96f core: replace secp256k with k256 in crypto::ecdsa (#3525)
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: Davide Galassi <davxy@datawok.net>
2024-03-09 10:14:06 +00:00
cuinix ea458d0b95 fix some typos (#3587)
Signed-off-by: cuinix <915115094@qq.com>
Co-authored-by: Bastian Köcher <git@kchr.de>
2024-03-08 21:28:04 +00:00
PG Herveou 1fe3c5f23b Contracts: Fix terminate benchmark (#3558)
Co-authored-by: Alexander Theißen <alex.theissen@me.com>
Co-authored-by: command-bot <>
2024-03-08 18:13:31 +00:00
PG Herveou a0c9a3d65a benchmark: allow range trailing comma in RangeArgs (#3598)
Rustfmt will add a trailing comma for longer expression, this change
will make sure that the Range parameters can still be parsed.

---------

Co-authored-by: command-bot <>
Co-authored-by: Alexander Theißen <alex.theissen@me.com>
2024-03-08 16:36:09 +00:00
Alexandru Gheorghe 6f3caac051 collator-protocol: Always stay connected to validators in backing group (#3544)
Looking at rococo-asset-hub
https://github.com/paritytech/polkadot-sdk/issues/3519 there seems to be
a lot of instances where collator did not advertise their collations,
while there are multiple problems there, one of it is that we are
connecting and disconnecting to our assigned validators every block,
because on reconnect_timeout every 4s we call connect_to_validators and
that will produce 0 validators when all went well, so set_reseverd_peers
called from validator discovery will disconnect all our peers.
More details here:
https://github.com/paritytech/polkadot-sdk/issues/3519#issuecomment-1972667343

Now, this shouldn't be a problem, but it stacks with an existing bug in
our network stack where if disconnect from a peer the peer might not
notice it, so it won't detect the reconnect either and it won't send us
the necessary view updates, so we won't advertise the collation to it
more details here:

https://github.com/paritytech/polkadot-sdk/issues/3519#issuecomment-1972958276

To avoid hitting this condition that often, let's keep the peers in the
reserved set for the entire duration we are allocated to a backing
group. Backing group sizes(1 rococo, 3 kusama, 5 polkadot) are really
small, so this shouldn't lead to that many connections. Additionally,
the validators would disconnect us any way if we don't advertise
anything for 4 blocks.

## TODO
- [x] More testing.
- [x] Confirm on rococo that this is improving the situation. (It
doesn't but just because other things are going wrong there).

---------

Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>
2024-03-08 12:10:47 +00:00
PG Herveou f977c21157 Contracts Bump ApiVersion and add test (#3619)
ApiVersion should have been bumped with
https://github.com/paritytech/polkadot-sdk/pull/3606
this does that and add a test so we don't forget to do that everytime
2024-03-08 09:48:55 +00:00
Sebastian Kunert 2aa006e094 Refactor polkadot-parachain service for more code reuse (#3511)
This is a refactoring, no changes to the logic are included (if you find
some, report :D).

## Change Overview
In https://github.com/paritytech/polkadot-sdk/issues/2455, dependency on
actual runtimes was removed for the system parachains. This means that
the trait bounds we have on various `start_node_xy` do not check
anything anymore, since they all point to the same runtime. Exception is
asset-hub-polkadot which uses a different key type.

This PR unifies the different nodes as much as possible.
`start_node_impl` is doing the heavy lifting and has been made a bit
more flexible to support the rpc extension instantiation that was there
before.

The generics for `Runtime` and `AuraId` have been removed where
possible. The fake runtime is imported as `FakeRuntime` to make it very
clear to readers that it is not the generic parameter.

Multiple nodes where using the same import queue/start_consensus
closure, they have been unified.

---------

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
Co-authored-by: Adrian Catangiu <adrian@parity.io>
Co-authored-by: Egor_P <egor@parity.io>
Co-authored-by: Dmitry Markin <dmitry@markin.tech>
Co-authored-by: Xiliang Chen <xlchen1291@gmail.com>
Co-authored-by: Andrei Eres <eresav@me.com>
Co-authored-by: Alexander Samusev <41779041+alvicsam@users.noreply.github.com>
Co-authored-by: Alin Dima <alin@parity.io>
Co-authored-by: gupnik <nikhilgupta.iitk@gmail.com>
Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>
Co-authored-by: Dónal Murray <donalm@seadanda.dev>
2024-03-07 23:31:59 +00:00
Pablo Andrés Dorado Suárez f4fbddec42 fix(pallet-benchmarking): split test functions in v2 (#3574)
Closes #376

---------

Co-authored-by: command-bot <>
2024-03-07 23:19:52 +00:00
Muharem 629506ce06 Deprecate xcm::body::TREASURER_INDEX constant, use standard Treasury varian instead (#3608)
Deprecate the `xcm::body::TREASURER_INDEX` constant and use the standard
Treasury variant from the `xcm::BodyId` type instead.

To align with the production runtimes:
https://github.com/polkadot-fellows/runtimes/pull/149
2024-03-07 15:13:17 +00:00