Commit Graph

16933 Commits

Author SHA1 Message Date
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
Ankan e504c41a5a Allow privileged virtual bond in Staking pallet (#3889)
This is the first PR in preparation for
https://github.com/paritytech/polkadot-sdk/issues/454.

## Follow ups:
- https://github.com/paritytech/polkadot-sdk/pull/3904.
- https://github.com/paritytech/polkadot-sdk/pull/3905.

Overall changes are documented here (lot more visual 😍):
https://hackmd.io/@ak0n/454-np-governance

[Maybe followup](https://github.com/paritytech/polkadot-sdk/issues/4217)
with migration of storage item `VirtualStakers` as a bool or enum in
`Ledger`.

## Context
We want to achieve a way for a user (`Delegator`) to delegate their
funds to another account (`Agent`). Delegate implies the funds are
locked in delegator account itself. Agent can act on behalf of delegator
to stake directly on Staking pallet.

The delegation feature is added to Staking via another pallet
`delegated-staking` worked on
[here](https://github.com/paritytech/polkadot-sdk/pull/3904).

## Introduces:
### StakingUnchecked Trait
As the name implies, this trait allows unchecked (non-locked) mutation
of staking ledger. These apis are only meant to be used by other pallets
in the runtime and should not be exposed directly to user code path.
Also related: https://github.com/paritytech/polkadot-sdk/issues/3888.

### Virtual Bond
Allows other pallets to stake via staking pallet while managing the
locks on these accounts themselves. Introduces another storage
`VirtualStakers` that whitelist these accounts.

We also restrict virtual stakers to set reward account as themselves.
Since the account has no locks, we cannot support compounding of
rewards. Conservatively, we require them to set a separate account
different from the staker. Since these are code managed, it should be
easy for another pallet to redistribute reward and rebond them.

### Slashes
Since there is no actual lock maintained by staking-pallet for virtual
stakers, this pallet does not apply any slashes. It is then important
for pallets managing virtual stakers to listen to slashing events and
apply necessary slashes.
2024-04-20 00:05:34 +00:00
maksimryndin 4eabe5e0dd Pvf refactor execute worker errors follow up (#4071)
follow up of https://github.com/paritytech/polkadot-sdk/pull/2604
closes https://github.com/paritytech/polkadot-sdk/pull/2604

- [x] take relevant changes from Marcin's PR 
- [x] extract common duplicate code for workers (low-hanging fruits)

~Some unpassed ci problems are more general and should be fixed in
master (see https://github.com/paritytech/polkadot-sdk/pull/4074)~

Proposed labels: **T0-node**, **R0-silent**, **I4-refactor**

-----

kusama address: FZXVQLqLbFV2otNXs6BMnNch54CFJ1idpWwjMb3Z8fTLQC6

---------

Co-authored-by: s0me0ne-unkn0wn <48632512+s0me0ne-unkn0wn@users.noreply.github.com>
2024-04-19 13:36:36 +00:00
Alexandru Vasile eba3deca3e txWatch: Stabilize txWatch to version 1 (#4171)
This PR stabilizes the txBroadcast API to version 1.

Needs from spec:
- https://github.com/paritytech/json-rpc-interface-spec/pull/153 
- https://github.com/paritytech/json-rpc-interface-spec/pull/154


cc @paritytech/subxt-team

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2024-04-19 09:48:44 +00:00
Alexandru Vasile 148d942ec0 txBroadcast: Stabilize to version 1 (#4169)
This PR stabilizes the txBroadcast API to version 1.

Ideally needs:
- https://github.com/paritytech/polkadot-sdk/pull/4050
- https://github.com/paritytech/polkadot-sdk/pull/3772

cc @paritytech/subxt-team

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2024-04-19 09:28:48 +00:00
Bulat Saifullin 69f4373178 Provide WSS bootnodes for Rococo and Westend parachains (#4161)
Some Rococo parachains lacked WS nodes. `ws/wss` endpoints are necessary
for using light clients on the testnet.

Changes:
1. Add `ws/wss` endpoints to all testnet parachains.
2. Remove decommissioned nodes (`people-collator-node-2`
`people-collator-node-3` ).
2024-04-19 09:04:03 +00:00
Svyatoslav Nikolsky 21308d893e Fixed GrandpaConsensusLogReader::find_scheduled_change (#4208) 2024-04-19 08:34:46 +00:00
Andrei Sandu 04a9071e2a Use higher priority for PVF preparation in dispute/approval context (#4172)
Related to https://github.com/paritytech/polkadot-sdk/issues/4126
discussion

Currently all preparations have same priority and this is not ideal in
all cases. This change should improve the finality time in the context
of on-demand parachains and when `ExecutorParams` are updated on-chain
and a rebuild of all artifacts is required. The desired effect is to
speed up approval and dispute PVF executions which require preparation
and delay backing executions which require preparation.

---------

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
2024-04-19 08:15:59 +00:00
Andrei Eres 4f125d1928 Update subsystem-benchmark params (#4201)
- Returned latency (with it, results are more stable)
- The threshold is weakened
- Increased number of runs
2024-04-19 07:35:56 +00:00
Alexandru Vasile 98a364fe6e rpc-v2: Limit transactionBroadcast calls to 16 (#3772)
This PR limits the number of active calls to the transactionBroadcast
APIs to 16.

cc @paritytech/subxt-team 

Closes: https://github.com/paritytech/polkadot-sdk/issues/3081

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: James Wilson <james@jsdw.me>
2024-04-19 04:34:26 +00:00
Alexandru Vasile 88a2f36023 chainHead: Stabilize chainHead to version 1 (#4168)
This PR stabilizes the chainHead API to version 1.

Needs:
- https://github.com/paritytech/polkadot-sdk/pull/3667

cc @paritytech/subxt-team

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2024-04-18 17:19:04 +00:00
Alexandru Vasile c891fdabf4 tx: Remove tx_broadcast transaction from the pool (#4050)
This PR ensures that broadcast future cleans-up the submitted extrinsic
from the pool, iff the `broadcast_stop` operation has been called.

This effectively cleans-up transactions from the pool when the
`broadcast_stop` is called.

cc @paritytech/subxt-team

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2024-04-18 15:57:44 +00:00
Alexandru Gheorghe 37e338f046 approval-voting: Make sure we always mark approved candidates approved in a different relay chain context (#4153)
... see for more detail why this is needed

https://github.com/paritytech/polkadot-sdk/issues/4149#issuecomment-2058472444

## TODO:
- [x] Unittests
- [x] Replicate scenario from
https://github.com/paritytech/polkadot-sdk/issues/4149 and confirm this
fixes it: https://github.com/paritytech/polkadot-sdk/issues/4149 [
Replicated on a zombienet with some hacked nodes, that we can end up in
this state where no-wake is schedule and the nodes are pending new
assignments]

---------

Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>
Co-authored-by: Andrei Sandu <54316454+sandreim@users.noreply.github.com>
2024-04-18 15:57:34 +00:00
Alexandru Gheorghe 0e552893d0 Fix next_retry busy waiting on first retry (#4192)
The `next_retry_time` gets populated when a request receives an error
timeout or any other error, after thatn next_retry would check all
requests in the queue returns the smallest one, which then gets used to
move the main loop by creating a Delay
```
futures_timer::Delay::new(instant.saturating_duration_since(Instant::now())).await,
```

However when we retry a task for the first time we still keep it in the
queue an mark it as in flight so its next_retry_time would be the oldest
and it would be small than `now`, so the Delay will always triggers, so
that would make the main loop essentially busy wait untill we received a
response for the retry request.

Fix this by excluding the tasks that are already in-flight.

---------

Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>
Co-authored-by: Andrei Sandu <54316454+sandreim@users.noreply.github.com>
2024-04-18 15:57:23 +00:00
Alexander Samusev 9f12d2196e [ci] Use native git cli in cargo (#4200)
More details can be found
[here](https://github.com/paritytech/ci_cd/issues/939#issuecomment-2064061845)
2024-04-18 15:57:22 +00:00
ordian 91d4a207af chain-selection: allow reverting current block (#4103)
Block reversion of the current block is technically possible as can be
seen from

https://github.com/paritytech/polkadot-sdk/blob/39b1f50f1c251def87c1625d68567ed252dc6272/polkadot/runtime/parachains/src/disputes.rs#L1215-L1223

- [x] Fix the test
2024-04-18 14:32:14 +00:00
Alexander Samusev 4ddeda1e41 [ci] Use ci-unified reference (#4196)
close https://github.com/paritytech/ci_cd/issues/974
2024-04-18 14:22:00 +00:00
Egor_P ff906127ab Improve changelog in the release notes (#4179)
This PR adds description to each of the sections of the Changelog part.
Changes are based on feedback that it wasn't that clear what exactly
`Node Dev`, `Runtime Dev` etc. means. Now, the description for each of
those parts is taken directly from the `prdoc` schema.
Closes https://github.com/paritytech/release-engineering/issues/197
2024-04-18 10:30:31 +00:00
Alexander Samusev 76719da221 [ci] Update ci image with rust 1.77 and 2024-04-10 (#4077)
cc https://github.com/paritytech/ci_cd/issues/974

---------

Co-authored-by: command-bot <>
Co-authored-by: Bastian Köcher <info@kchr.de>
2024-04-18 09:24:16 +00:00
Alexander Samusev b6fab8046e [ci] Run test-linux-stable-int on self-hosted GitHub Runners (#4178)
PR adds `test-linux-stable-int` and `quick-benchmarks` as github action
jobs. It's a copy of `test-linux-stable-int` and `quick-benchmarks` from
gitlab ci and now it's needed to make a stress test for self-hosted
github runners. `test-linux-stable-int` and `quick-benchmarks` in gitlab
are still `Required` whereas this workflow is allowed to fail.

cc https://github.com/paritytech/infrastructure/issues/46
2024-04-18 07:40:45 +00:00