Commit Graph

16952 Commits

Author SHA1 Message Date
Ankan 0031d49d1e [Staking] Not allow reap stash for virtual stakers (#4311)
Related to https://github.com/paritytech/polkadot-sdk/pull/3905.

Since virtual stakers does not have a real balance, they should not be
allowed to be reaped.

The proper reaping for agents slashed will be done in a separate PR.
2024-04-29 15:55:45 +00:00
Tin Chung f34d8e3cf0 Remove hard-coded indices from pallet-xcm tests (#4248)
# ISSUE
- Link to issue: https://github.com/paritytech/polkadot-sdk/issues/4237

# DESCRIPTION
Remove all ModuleError with hard-coded indices to pallet Error. For
example:
```rs
Err(DispatchError::Module(ModuleError {
	index: 4,
	error: [2, 0, 0, 0],
	message: Some("Filtered")
}))
```
To 
```rs
let expected_result = Err(crate::Error::<Test>::Filtered.into());
assert_eq!(result, expected_result);
```
# TEST OUTCOME
```
test result: ok. 74 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.02s
```

---------

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
2024-04-29 07:13:01 +00:00
dependabot[bot] 92a348f57d Bump snow from 0.9.3 to 0.9.6 (#4061)
Bumps [snow](https://github.com/mcginty/snow) from 0.9.3 to 0.9.6.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/mcginty/snow/releases">snow's
releases</a>.</em></p>
<blockquote>
<h2>v0.9.6</h2>
<ul>
<li>Validate invalid PSK positions when building a Noise protocol.</li>
<li>Raise errors in various typos/mistakes in Noise patterns when
parsing.</li>
<li>Deprecate the <code>sodiumoxide</code> backend, as that crate is no
longer maintained. We may eventually migrate it to a maintaned version
of the crate, but for now it's best to warn users.</li>
<li>Set a hard limit in <code>read_message()</code> in transport mode to
65535 to be fully compliant with the Noise specification.</li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/mcginty/snow/compare/v0.9.5...v0.9.6">https://github.com/mcginty/snow/compare/v0.9.5...v0.9.6</a></p>
<h2>v0.9.5</h2>
<p>This is a security release that fixes a logic flaw in decryption in
<code>TransportState</code> (i.e. the stateful one), where the nonce
could increase even when decryption failed, which can cause a desync
between the sender and receiver, opening this up as a denial of service
vector if the attacker has the ability to inject packets in the channel
Noise is talking over.</p>
<p>More details can be found in the advisory: <a
href="https://github.com/mcginty/snow/security/advisories/GHSA-7g9j-g5jg-3vv3">https://github.com/mcginty/snow/security/advisories/GHSA-7g9j-g5jg-3vv3</a></p>
<p>All users are encouraged to update.</p>
<h2>v0.9.4</h2>
<p>This is a dependency version bump release because a couple of
important dependencies released new versions that needed a
<code>Cargo.toml</code> bump:</p>
<ul>
<li><code>ring</code> 0.17</li>
<li><code>pqcrypto-kyber</code> 0.8</li>
<li><code>aes-gcm</code> 0.10</li>
<li><code>chacha20poly1305</code> 0.10</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/mcginty/snow/commit/a4be73faa042c5967f39662aa66919f774831a9a"><code>a4be73f</code></a>
meta: v0.9.6 release</li>
<li><a
href="https://github.com/mcginty/snow/commit/9e53dcf5bbea869b5e3e9ed26866d683906bc848"><code>9e53dcf</code></a>
TransportState: limit read_message size to 65535</li>
<li><a
href="https://github.com/mcginty/snow/commit/faf05609e19f4106cd47b78123415dfeb9330861"><code>faf0560</code></a>
Deprecate sodiumoxide resolver</li>
<li><a
href="https://github.com/mcginty/snow/commit/308a24d23da13cb01a173f0ec23f140898801fb9"><code>308a24d</code></a>
Add warnings about multiple calls to same method in Builder</li>
<li><a
href="https://github.com/mcginty/snow/commit/f280991ae408685d72e098545314f2be160e57f9"><code>f280991</code></a>
Error when extraneous parameters are included in string to parse</li>
<li><a
href="https://github.com/mcginty/snow/commit/dbdcc4803aae6e5d9910163a7d52e0df8def4310"><code>dbdcc48</code></a>
Error on duplicate modifiers in parameter string</li>
<li><a
href="https://github.com/mcginty/snow/commit/8b1a819c93ceae98f9ba0a1be192fa61fdec78c2"><code>8b1a819</code></a>
Validate PSK index in pattern to avoid panic</li>
<li><a
href="https://github.com/mcginty/snow/commit/74e30cf591d6d89c8a1670ee713ecc4e9607e38f"><code>74e30cf</code></a>
meta: v0.9.5 release</li>
<li><a
href="https://github.com/mcginty/snow/commit/12e8ae55547ae297d5f70599e5c884ea891303eb"><code>12e8ae5</code></a>
Stateful nonce desync fix</li>
<li><a
href="https://github.com/mcginty/snow/commit/02c26b7551cb7e221792a9d3d3a94730e6a34e8a"><code>02c26b7</code></a>
Remove clap from simple example</li>
<li>Additional commits viewable in <a
href="https://github.com/mcginty/snow/compare/v0.9.3...v0.9.6">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=snow&package-manager=cargo&previous-version=0.9.3&new-version=0.9.6)](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: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-28 16:36:25 +00:00
Squirrel 954150f3b5 remove unnessisary use statements due to 2021 core prelude (#4183)
Some traits are already included in the 2021 prelude and so shouldn't be
needed to use explicitly:

use `convert::TryFrom`, `convert::TryInto`, and `iter::FromIterator` are
removed.

( https://doc.rust-lang.org/core/prelude/rust_2021/ )

No breaking changes or change of functionality, so I think no PR doc is
needed in this case.

(Motivation: Removes some references to `sp-std`)
2024-04-28 15:29:21 +00:00
Ankan 73b9a8391f [Staking] Runtime api if era rewards are pending to be claimed (#4301)
closes https://github.com/paritytech/polkadot-sdk/issues/426.
related to https://github.com/paritytech/polkadot-sdk/pull/1189.

Would help offchain programs to query if there are unclaimed pages of
rewards for a given era.

The logic could look like below

```js
// loop as long as all era pages are claimed.
while (api.call.stakingApi.pendingRewards(era, validator_stash)) {
  api.tx.staking.payout_stakers(validator_stash, era)
}
```
2024-04-28 12:35:51 +00:00
antiyro 2a497d2975 fix(seal): shameless fix on sealing typo (#4304) 2024-04-26 16:23:58 +00:00
Ron d893cde2cf Snowbridge: deposit extra fee to beneficiary on Asset Hub (#4175)
Just the upper-stream for
https://github.com/Snowfork/polkadot-sdk/pull/137 and more context
there.

---------

Co-authored-by: Clara van Staden <claravanstaden64@gmail.com>
Co-authored-by: Adrian Catangiu <adrian@parity.io>
2024-04-26 15:51:58 +00:00
Tsvetomir Dimitrov 988e30f102 Implementation of the new validator disabling strategy (#2226)
Closes https://github.com/paritytech/polkadot-sdk/issues/1966,
https://github.com/paritytech/polkadot-sdk/issues/1963 and
https://github.com/paritytech/polkadot-sdk/issues/1962.

Disabling strategy specification
[here](https://github.com/paritytech/polkadot-sdk/pull/2955). (Updated
13/02/2024)

Implements:
* validator disabling for a whole era instead of just a session
* no more than 1/3 of the validators in the active set are disabled
Removes:
* `DisableStrategy` enum - now each validator committing an offence is
disabled.
* New era is not forced if too many validators are disabled.

Before this PR not all offenders were disabled. A decision was made
based on [`enum
DisableStrategy`](https://github.com/paritytech/polkadot-sdk/blob/bbb6631641f9adba30c0ee6f4d11023a424dd362/substrate/primitives/staking/src/offence.rs#L54).
Some offenders were disabled for a whole era, some just for a session,
some were not disabled at all.

This PR changes the disabling behaviour. Now a validator committing an
offense is disabled immediately till the end of the current era.

Some implementation notes:
* `OffendingValidators` in pallet session keeps all offenders (this is
not changed). However its type is changed from `Vec<(u32, bool)>` to
`Vec<u32>`. The reason is simple - each offender is getting disabled so
the bool doesn't make sense anymore.
* When a validator is disabled it is first added to
`OffendingValidators` and then to `DisabledValidators`. This is done in
[`add_offending_validator`](https://github.com/paritytech/polkadot-sdk/blob/bbb6631641f9adba30c0ee6f4d11023a424dd362/substrate/frame/staking/src/slashing.rs#L325)
from staking pallet.
* In
[`rotate_session`](https://github.com/paritytech/polkadot-sdk/blob/bdbe98297032e21a553bf191c530690b1d591405/substrate/frame/session/src/lib.rs#L623)
the `end_session` also calls
[`end_era`](https://github.com/paritytech/polkadot-sdk/blob/bbb6631641f9adba30c0ee6f4d11023a424dd362/substrate/frame/staking/src/pallet/impls.rs#L490)
when an era ends. In this case `OffendingValidators` are cleared
**(1)**.
* Then in
[`rotate_session`](https://github.com/paritytech/polkadot-sdk/blob/bdbe98297032e21a553bf191c530690b1d591405/substrate/frame/session/src/lib.rs#L623)
`DisabledValidators` are cleared **(2)**
* And finally (still in `rotate_session`) a call to
[`start_session`](https://github.com/paritytech/polkadot-sdk/blob/bbb6631641f9adba30c0ee6f4d11023a424dd362/substrate/frame/staking/src/pallet/impls.rs#L430)
repopulates the disabled validators **(3)**.
* The reason for this complication is that session pallet knows nothing
abut eras. To overcome this on each new session the disabled list is
repopulated (points 2 and 3). Staking pallet knows when a new era starts
so with point 1 it ensures that the offenders list is cleared.

---------

Co-authored-by: ordian <noreply@reusable.software>
Co-authored-by: ordian <write@reusable.software>
Co-authored-by: Maciej <maciej.zyszkiewicz@parity.io>
Co-authored-by: Gonçalo Pestana <g6pestana@gmail.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: command-bot <>
Co-authored-by: Ankan <10196091+Ank4n@users.noreply.github.com>
2024-04-26 13:28:08 +00:00
gui 97f7425338 Try state: log errors instead of loggin the number of error and discarding them (#4265)
Currently we discard errors content
We should at least log it.

Code now is more similar to what is written in try_on_runtime_upgrade.

label should be R0

---------

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>
Co-authored-by: Javier Bullrich <javier@bullrich.dev>
2024-04-26 12:27:14 +00:00
Svyatoslav Nikolsky 9a48cd707e Bridges: added helper function to relay single GRANDPA proof + header (#4307)
related to
https://github.com/paritytech/parity-bridges-common/issues/2962
silent, because the actual code for subcommand is added in the
`parity-bridges-common` repo, where binary lives

---------

Co-authored-by: Adrian Catangiu <adrian@parity.io>
2024-04-26 11:26:05 +00:00
Javier Bullrich d212fc7a41 review-bot: reverted #4271 and added workflow_dispatch (#4293)
This PR includes two changes:
- added `workflow_dispatch` to review bot
- reverted #4271

### Added `workflow_dispatch` to review bot
This allows us, in the case that review-bot fails for some fork reasons,
to trigger it manually ensuring that we can overcame the problem with
the multiple actions while we look for a solution.

<img width="342" alt="image"
src="https://github.com/paritytech/polkadot-sdk/assets/8524599/f432f91b-829a-4da4-b4ca-54cc4fe280c8">

### Reverted #4271
Unfortunately, the changes added in #4271 do not work in forks.

Here is a lengthy discussion of many individuals facing the same problem
as me:
- [GitHub Action `pull_request` attribute empty in `workflow_run` event
object for PR from forked repo
#25220](https://github.com/orgs/community/discussions/25220)

So I had to revert it (but I updated the dependencies to latest).

#### Miscellaneous changes

I added a debug log at the end of review bot in case it fails so we can
easily debug it without having to make a lot of boilerplate and forks to
duplicate the environment.
2024-04-26 11:24:03 +00:00
Svyatoslav Nikolsky c66d8a8468 Bump bridges relay version + uncomment bridges zombeinet tests (#4289)
TODOs:
- [x] wait and see if test `1` works;
- [x] ~think of whether we need remaining tests.~ I think we should keep
it - will try to revive and update it
2024-04-26 09:24:42 +00:00
Oliver Tale-Yazdi e8f7c81db6 [balances] Safeguard against consumer ref underflow (#3865)
There are some accounts that do not have a consumer ref while having a
reserve.
This adds a fail-safe mechanism to trigger in the case that
`does_consume` is true, but the assumption of `consumer>0` is not.

This should prevent those accounts from loosing balance and the TI from
getting messed up even more, but is not an "ideal" fix. TBH an ideal fix
is not possible, since on-chain data is in an invalid state.

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
2024-04-26 08:16:03 +00:00
Noah Jelich 8f8c49deff Fix bad links (#4231)
The solochain template links to parachain template instead of solochain.
2024-04-26 09:03:53 +02:00
Andrei Eres dd5b06e622 [subsystem-benchmarks] Log standart deviation for subsystem-benchmarks (#4285)
Should help us to understand more what's happening between individual
runs and possibly adjust the number of runs
2024-04-25 15:06:37 +00:00
Andrei Eres 8f5c8f735a Update approval-voting banchmarks base values (#4283) 2024-04-25 15:04:20 +00:00
Alin Dima c9923cd7fe rename fragment_tree folder to fragment_chain (#4294)
Makes https://github.com/paritytech/polkadot-sdk/pull/4035 easier to
review
2024-04-25 13:52:24 +00:00
Liam Aharon ff2b178206 remote-externalities: retry get child keys query (#4280) 2024-04-25 12:01:05 +00:00
s0me0ne-unkn0wn c26cf3f6f2 Do not re-prepare PVFs if not needed (#4211)
Currently, PVFs are re-prepared if any execution environment parameter
changes. As we've recently seen on Kusama and Polkadot, that may lead to
a severe finality lag because every validator has to re-prepare every
PVF. That cannot be avoided altogether; however, we could cease
re-preparing PVFs when a change in the execution environment can't lead
to a change in the artifact itself. For example, it's clear that
changing the execution timeout cannot affect the artifact.

In this PR, I'm introducing a separate hash for the subset of execution
environment parameters that changes only if a preparation-related
parameter changes. It introduces some minor code duplication, but
without that, the scope of changes would be much bigger.

TODO:
- [x] Add a test to ensure the artifact is not re-prepared if
non-preparation-related parameter is changed
- [x] Add a test to ensure the artifact is re-prepared if a
preparation-related parameter is changed
- [x] Add comments, warnings, and, possibly, a test to ensure a new
parameter ever added to the executor environment parameters will be
evaluated by the author of changes with respect to its artifact
preparation impact and added to the new hash preimage if needed.

Closes #4132
2024-04-25 10:16:12 +00:00
Alexandru Gheorghe 239a23d9cc Fix polkadot parachains not producing blocks until next session (#4269)
... a few sessions too late :(, this already happened on polkadot, so as
of now there are no known relay-chains without async backing enabled in
runtime, but let's fix it in case someone else wants to repeat our
steps.

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

---------

Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>
2024-04-25 10:11:07 +00:00
Oliver Tale-Yazdi 0770417880 [XCM] Treat recursion limit error as transient in the MQ (#4202)
Changes:
- Add new error variant `ProcessMessageError::StackLimitReached` and
treat XCM error `ExceedsStackLimit` as such.

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Branislav Kontur <bkontur@gmail.com>
2024-04-25 09:01:21 +00:00
PG Herveou b801d001e8 Contracts: Stabilize XCM host fns (#4213)
See 
https://github.com/paritytech/ink/pull/1912
https://github.com/paritytech/ink-docs/pull/338
2024-04-25 08:47:46 +00:00
Svyatoslav Nikolsky 7e68b2b8da Bridge: added free headers submission support to the substrate-relay (#4157)
Original PR:
https://github.com/paritytech/parity-bridges-common/pull/2884. Since
chain-specific code lives in the `parity-bridges-common` repo, some
parts of original PR will require another PR

---------

Co-authored-by: Adrian Catangiu <adrian@parity.io>
2024-04-25 07:20:17 +00:00
Svyatoslav Nikolsky a633e954f3 Bridge: make some headers submissions free (#4102)
supersedes https://github.com/paritytech/parity-bridges-common/pull/2873

Draft because of couple of TODOs:
- [x] fix remaining TODOs;
- [x] double check that all changes from
https://github.com/paritytech/parity-bridges-common/pull/2873 are
correctly ported;
- [x] create a separate PR (on top of that one or a follow up?) for
https://github.com/paritytech/polkadot-sdk/tree/sv-try-new-bridge-fees;
- [x] fix compilation issues (haven't checked, but there should be
many).

---------

Co-authored-by: Adrian Catangiu <adrian@parity.io>
2024-04-25 05:26:16 +00:00
Francisco Aguirre 4f3d43a0c4 Revert execute_blob and send_blob (#4266)
Revert "pallet-xcm: Deprecate `execute` and `send` in favor of
`execute_blob` and `send_blob` (#3749)"

This reverts commit feee773d15.

---------

Co-authored-by: Adrian Catangiu <adrian@parity.io>
Co-authored-by: Javier Bullrich <javier@bullrich.dev>
2024-04-24 15:49:33 +00:00
Javier Bullrich d29c3636fa Updated review-bot to obtain number from event (#4271)
It seems that `review-trigger` is not uploading the artifact that is
used by `review-bot`, so I changed the PR-Number to be obtained by the
previous event that triggered this action.

I also took the liberty to replace `tibdex/github-app-token` for
`actions/create-github-app-token` which is GitHub's official app.
2024-04-24 14:54:07 +00:00
Branislav Kontur ac473cfa7b AllowHrmpNotificationsFromRelayChain barrier for HRMP notifications from the relaychain (#4156)
This PR:
- introduces `AllowHrmpNotificationsFromRelayChain` barrier for allowing
HRMP notifications just from the relay chain (to fulfill safety
assumptions -
[see](https://github.com/paritytech/polkadot-sdk/blob/master/polkadot/xcm/src/v4/mod.rs#L532))
- sets it up for all testnet SP parachains

Continuation of: https://github.com/paritytech/polkadot-sdk/pull/3696
2024-04-24 14:23:23 +00:00
Serban Iorga 8dc0b33788 [BEEFY] Return valid signatures when verifying commitment (#4259)
Trying to split parts of the
https://github.com/paritytech/polkadot-sdk/pull/1903 into smaller PRs

For https://github.com/paritytech/polkadot-sdk/pull/1903 it would help
if `verify_with_validator_set()` returned the list of valid
authority-signatures pairs, since after the verification we need to send
them in the equivocation proof.
2024-04-24 13:26:25 +00:00
Alexander Kalankhodzhaev c594b10a80 Remove unnecessary cloning (#4263)
Seems like Externalities already [return a
vector](https://github.com/paritytech/polkadot-sdk/blob/ffbce2a817ec2e7c8b7ce49f7ed6794584f19667/substrate/primitives/externalities/src/lib.rs#L86),
so calling `to_vec` on a vector just results in an unneeded copying.

Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>
2024-04-24 09:30:47 +00:00
Adrian Catangiu e0584a153d pallet-xcm::transfer_assets_using_type() supports custom actions on destination (#4260)
Change `transfer_assets_using_type()` to not assume `DepositAssets` as
the intended use of the assets on the destination.

Instead provides the caller with the ability to specify custom XCM that
be executed on `dest` chain as the last step of the transfer, thus
allowing custom usecases for the transferred assets. E.g. some are
used/swapped/etc there, while some are sent further to yet another
chain.

Note: this is a follow-up on
https://github.com/paritytech/polkadot-sdk/pull/3695, bringing in an API
change for `transfer_assets_using_type()`. This is ok as the previous
version has not been yet released. Thus, its first release will include
the new API proposed by this PR.

This allows usecases such as:
https://forum.polkadot.network/t/managing-sas-on-multiple-reserve-chains-for-same-asset/7538/4

BTW: all this pallet-xcm asset transfers code will be massively reduced
once we have https://github.com/paritytech/xcm-format/pull/54

---------

Signed-off-by: Adrian Catangiu <adrian@parity.io>
2024-04-24 08:44:42 +00:00
Alexandru Gheorghe 9a0049d0da Plumbing to increase pvf workers configuration based on chain id (#4252)
Part of https://github.com/paritytech/polkadot-sdk/issues/4126 we want
to safely increase the execute_workers_max_num gradually from chain to
chain and assess if there are any negative impacts.

This PR performs the necessary plumbing to be able to increase it based
on the chain id, it increase the number of execution workers from 2 to 4
on test network but lives kusama and polkadot unchanged until we gather
more data.

---------

Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>
2024-04-24 06:15:39 +00:00
gupnik 0a56d071c7 Adds ability to trigger tasks via unsigned transactions (#4075)
This PR updates the `validate_unsigned` hook for `frame_system` to allow
valid tasks to be submitted as unsigned transactions. It also updates
the task example to be able to submit such transactions via an off-chain
worker.

---------

Co-authored-by: Bastian Köcher <git@kchr.de>
2024-04-24 05:55:54 +00:00
Bastian Köcher ffbce2a817 pallet_broker: Let start_sales calculate and request the correct core count (#4221) 2024-04-23 15:37:24 +00:00
joe petrowski eda5e5c31f Fix Stuck Collator Funds (#4229)
Fixes https://github.com/paritytech/polkadot-sdk/issues/4206

In #1340 one of the storage types was changed from `Candidates` to
`CandidateList`. Since the actual key includes the hash of this value,
all of the candidates stored here are (a) "missing" and (b) unable to
unreserve their candidacy bond.

This migration kills the storage values and refunds the deposit held for
each candidate.

---------

Signed-off-by: georgepisaltu <george.pisaltu@parity.io>
Co-authored-by: georgepisaltu <52418509+georgepisaltu@users.noreply.github.com>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: georgepisaltu <george.pisaltu@parity.io>
2024-04-23 12:53:20 +00:00
Branislav Kontur 118cd6f922 Ensure outbound XCMs are decodable with limits + add EnsureDecodableXcm router (for testing purposes) (#4186)
This PR:
- adds `EnsureDecodableXcm` (testing) router that attempts to *encode*
and *decode* passed XCM `message` to ensure that the receiving side will
be able to decode, at least with the same XCM version.
- fixes `pallet_xcm` / `pallet_xcm_benchmarks` assets data generation

Relates to investigation of
https://substrate.stackexchange.com/questions/11288 and missing fix
https://github.com/paritytech/polkadot-sdk/pull/2129 which did not get
into the fellows 1.1.X release.

## Questions/TODOs

- [x] fix XCM benchmarks, which produces undecodable data - new router
catched at least two cases
  - `BoundedVec exceeds its limit`
  - `Fungible asset of zero amount is not allowed`  
- [x] do we need to add `sort` to the `prepend_with` as we did for
reanchor [here](https://github.com/paritytech/polkadot-sdk/pull/2129)?
@serban300 (**created separate/follow-up PR**:
https://github.com/paritytech/polkadot-sdk/pull/4235)
- [x] We added decoding check to `XcmpQueue` -> `validate_xcm_nesting`,
why not to added to the `ParentAsUmp` or `ChildParachainRouter`?
@franciscoaguirre (**created separate/follow-up PR**:
https://github.com/paritytech/polkadot-sdk/pull/4236)
- [ ] `SendController::send_blob` replace `VersionedXcm::<()>::decode(`
with `VersionedXcm::<()>::decode_with_depth_limit(MAX_XCM_DECODE_DEPTH,
data)` ?

---------

Co-authored-by: Adrian Catangiu <adrian@parity.io>
2024-04-23 11:40:05 +00:00
sfuhfds 5f2e66f5d0 chore: fix some typos (#4253) 2024-04-23 10:53:50 +00:00
AlexWang f7c1e0cf10 Add OnFinality polkadot bootnode (#4247)
This is for adding onfinality polkadot bootnode. Please correct me if
this is not the right place for adding a new bootnode
2024-04-23 10:49:39 +00:00
Bastian Köcher ac4f421f0b parachains_coretime: Expose MaxXCMTransactWeight (#4189)
This should be configured on the runtime level and not somewhere inside
the pallet.

---------

Co-authored-by: Adrian Catangiu <adrian@parity.io>
Co-authored-by: Branislav Kontur <bkontur@gmail.com>
2024-04-23 09:51:11 +00:00
Branislav Kontur 7f1646eb38 Add validate_xcm_nesting to the ParentAsUmp and ChildParachainRouter (#4236)
This PR:
- moves `validate_xcm_nesting` from `XcmpQueue` into the `VersionedXcm`
- adds `validate_xcm_nesting` to the `ParentAsUmp`
- adds `validate_xcm_nesting` to the `ChildParachainRouter`


Based on discussion
[here](https://github.com/paritytech/polkadot-sdk/pull/4186#discussion_r1571344270)
and/or
[here](https://github.com/paritytech/polkadot-sdk/pull/4186#discussion_r1572076666)
and/or [here]()

## Question/TODO

- [x] To the
[comment](https://github.com/paritytech/polkadot-sdk/pull/4186#discussion_r1572072295)
- Why was `validate_xcm_nesting` added just to the `XcmpQueue` router
and nowhere else? What kind of problem `MAX_XCM_DECODE_DEPTH` is
solving? (see
[comment](https://github.com/paritytech/polkadot-sdk/pull/4236#discussion_r1574605191))
2024-04-23 08:38:20 +00:00
Alexandru Gheorghe 157294b0d3 Add metric for time spent waiting in the execution queue (#4250)
Add a metric to be able to understand the time jobs are waiting in the
execution queue waiting for an available worker.
https://github.com/paritytech/polkadot-sdk/issues/4126

Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>
2024-04-23 08:17:06 +00:00
Adrian Catangiu 84c294c382 [testnets] remove XCM SafeCallFilter for chains using Weights::v3 (#4199)
Weights::v3 also accounts for PoV weight so we no longer need the
SafeCallFilter. All calls are allowed as long as they "fit in the
block".
2024-04-22 22:10:07 +00:00
Bastian Köcher bd9287f766 wasm-builder: Make it easier to build a WASM binary (#4177)
Basically combines all the recommended calls into one
`build_using_defaults()` call or `init_with_defaults()` when there are
some custom changes required.
2024-04-22 19:28:27 +00:00
Przemek Rzad 3380e21cd9 Use default branch of psvm when synchronizing templates (#4240)
We cannot lock to a specific version of `psvm`, because we will need to
keep it up-to-date - each release currently requires a change in `psvm`
such as [this one](https://github.com/paritytech/psvm/pull/2/files).

There is no `stable` branch in `psvm` repo or anything so using the
default branch.
2024-04-22 16:34:29 +00:00
Andrei Eres fb8b64e32b [subsystem-benchmark] Fix results filename for approval-voting benches (#4243) 2024-04-22 16:16:42 +00:00
Andrei Eres a2a049db2b [subsystem-benchmark] Add approval-voting benchmark to CI (#4216)
Co-authored-by: alvicsam <alvicsam@gmail.com>
2024-04-22 12:45:54 +00:00
Svyatoslav Nikolsky 921265ca78 Added prdoc for 4208 (#4239) 2024-04-22 12:06:16 +00:00
Branislav Kontur ff7e2c88a4 Sanitize UniversalLocation witth GlobalConsensus + XCM small nits and improvements (#4238)
This PR:
- sanitizes all `UniversalLocation`s with `GlobalConsensus` (when
possible) - addressing
[comment](https://github.com/paritytech/polkadot-sdk/pull/4025#discussion_r1557361473)
- adds `DefaultConfig` for `pallet-xcm-benchmarks` for `system`
2024-04-22 11:34:04 +00:00
Branislav Kontur e0202ece63 [xcm] Assets: sort after prepend_with (#4235)
Adds sorting to the XCM Assets' `prepend_with`, which could modify the
order of `AssetId` locations.

Relates to: https://github.com/paritytech/polkadot-sdk/pull/4186 (the
same fix for `reanchored`)
Part of: https://github.com/paritytech/polkadot-sdk/pull/2129
2024-04-22 11:26:32 +00:00
Liam Aharon 253778c94d ci: disallow westend migration failure (#4205)
Co-authored-by: Bastian Köcher <git@kchr.de>
2024-04-22 05:08:38 +00:00
gui f3c3ebb6a9 Fix case in type in macro generation (#4223)
Generated type is not camel case this generate some warnings from IDE

label should be R0
2024-04-20 08:20:35 +00:00