Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pallet-xcm: enhance reserve_transfer_assets to support remote reserves #1672

Merged

Conversation

acatangiu
Copy link
Contributor

@acatangiu acatangiu commented Sep 22, 2023

Description

Motivation

pallet-xcm is the main user-facing interface for XCM functionality, including assets manipulation functions like teleportAssets() and reserve_transfer_assets() calls.

While teleportAsset() works both ways, reserve_transfer_assets() works only for sending reserve-based assets to a remote destination and beneficiary when the reserve is the local chain.

Solution

This PR enhances pallet_xcm::(limited_)reserve_withdraw_assets to support transfers when reserves are other chains.
This will allow complete, bi-directional reserve-based asset transfers user stories using pallet-xcm.

Enables following scenarios:

  • transferring assets with local reserve (was previously supported iff asset used as fee also had local reserve - now it works in all cases),
  • transferring assets with reserve on destination,
  • transferring assets with reserve on remote/third-party chain (iff assets and fees have same remote reserve),
  • transferring assets with reserve different than the reserve of the asset to be used as fees - meaning can be used to transfer random asset with local/dest reserve while using DOT for fees on all involved chains, even if DOT local/dest reserve doesn't match asset reserve,
  • transferring assets with any type of local/dest reserve while using fees which can be teleported between involved chains.

All of the above is done by pallet inner logic without the user having to specify which scenario/reserves/teleports/etc. The correct scenario and corresponding XCM programs are identified, and respectively, built automatically based on runtime configuration of trusted teleporters and trusted reserves.

Current limitations:

  • while fees and "non-fee" assets CAN have different reserves (or fees CAN be teleported), the remaining "non-fee" assets CANNOT, among themselves, have different reserve locations (this is also implicitly enforced by MAX_ASSETS_FOR_TRANSFER=2, but this can be safely increased in the future).
  • fees and "non-fee" assets CANNOT have different remote reserves (this could also be supported in the future, but adds even more complexity while possibly not being worth it - we'll see what the future holds).

Fixes #1584
Fixes #2055

@acatangiu acatangiu added T6-XCM This PR/Issue is related to XCM. T2-pallets This PR/Issue is related to a particular pallet. labels Sep 22, 2023
@acatangiu acatangiu self-assigned this Sep 22, 2023
@acatangiu acatangiu force-pushed the pallet-xcm-fully-support-reserve-transfers branch 3 times, most recently from 4741535 to ae6290a Compare September 25, 2023 10:55
@acatangiu acatangiu force-pushed the pallet-xcm-fully-support-reserve-transfers branch 4 times, most recently from 697fa50 to 7f805db Compare September 27, 2023 11:17
@acatangiu acatangiu force-pushed the pallet-xcm-fully-support-reserve-transfers branch from 55fe546 to 7cc79e7 Compare September 28, 2023 13:00
@acatangiu acatangiu force-pushed the pallet-xcm-fully-support-reserve-transfers branch from bbe5905 to 052f026 Compare September 29, 2023 14:16
Add AssetTransferFilter trait for configuring transfer types.
Implement it for XcmExecutor based on existing executor teleports and
reserves configuration.
Filter assets on pallet-xcm::limited_teleport_assets() based on above.
…erves

'reserve_transfer_assets()' assumed all provided `assets` (fees included)
have same, local reserve.

This commit enhances the extrinsic to support various scenarios:
- transferring assets with reserve on destination,
- transferring assets with reserve on remote/third-party chain,
- transferring assets with reserve different than the reserve of the
  asset to be used as fees - meaning can use to transfer random asset with
  random reserve while using DOT for fees on all involved chains, even
  if local chain is NOT a reserve location of DOT (aka most chains),
- transferring assets with any type of local/dest/remote reserve while
  using fees which can be teleported between involved chains.

All of the above is done by pallet inner logic without the user having to
specify which scenario/reserves/teleports/etc. The correct scenario and
corresponding XCM programs are identified, and respectively, built automatically
based on runtime configuration of trusted teleporters and trusted reserves.

Current limitations:
- while `fees` and "non-fee" `assets` CAN have different reserves (or fees CAN
  be teleported), the remaining "non-fee" `assets` CANNOT have different
  reserve locations (this is also implicitly enforced by
  `MAX_ASSETS_FOR_TRANSFER=2`, but this can be safely increased in the future).
- `fees` and "non-fee" `assets` CANNOT have **different remote** reserves (this
  can also be supported in the future, but adds even more complexity while
  possibly not being worth it - we'll see what the future holds).
github-merge-queue bot pushed a commit to paritytech-stg/polkadot-sdk that referenced this pull request Nov 20, 2023
* [ci] Prepare for MQ vol.2

* [ci] Enable zombienet jobs in PRs (paritytech#2361)

Since preparation for the merge queues needs more time I'm enabling
zombienet jobs in PRs CI back.

* westend: remove SessionKeys migration already applied on-chain (paritytech#2363)

Westend now successfully updated to `spec: 103000`, we **have to
remove** the session keys migration before the next release as it
doesn't gracefully handle reapplying it.

* implementers-guide: update github link (paritytech#2368)

cc @joepetrowski

* Fix Typo: `PalletXcmExtrinsicsBenchmark` (paritytech#2354)

Missed in paritytech#1672

* add pallet nomination-pools versioned migration to kitchensink (paritytech#2167)

The versioned migrations are already there in pallet nomination-pools:

https://github.com/paritytech/polkadot-sdk/blob/f6ee4781f633f0f89598f7b230595afe401da8dc/substrate/frame/nomination-pools/src/migration.rs#L27-L48

Just updating the kitchensink runtime to point to them.

This is also nice because it points the dev to an example of how to use
`VersionedMigration`.

* fix typo (paritytech#2377)

* bump zombienet version `v1.3.80` (paritytech#2376)

New release includes logic to move all jobs to `spot instances`.
Thx!

---------

Co-authored-by: Adrian Catangiu <adrian@parity.io>
Co-authored-by: ordian <write@reusable.software>
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
Co-authored-by: Bruno Galvao <brunopgalvao@gmail.com>
Co-authored-by: cuteolaf <OliverLim818@gmail.com>
Co-authored-by: Javier Bullrich <javier@bullrich.dev>
Co-authored-by: Javier Viola <javier@parity.io>
Co-authored-by: Maksym H <1177472+mordamax@users.noreply.github.com>
github-merge-queue bot pushed a commit to paritytech-stg/polkadot-sdk that referenced this pull request Nov 20, 2023
* [ci] Prepare for MQ vol.2

* [ci] Enable zombienet jobs in PRs (paritytech#2361)

Since preparation for the merge queues needs more time I'm enabling
zombienet jobs in PRs CI back.

* westend: remove SessionKeys migration already applied on-chain (paritytech#2363)

Westend now successfully updated to `spec: 103000`, we **have to
remove** the session keys migration before the next release as it
doesn't gracefully handle reapplying it.

* implementers-guide: update github link (paritytech#2368)

cc @joepetrowski

* Fix Typo: `PalletXcmExtrinsicsBenchmark` (paritytech#2354)

Missed in paritytech#1672

* add pallet nomination-pools versioned migration to kitchensink (paritytech#2167)

The versioned migrations are already there in pallet nomination-pools:

https://github.com/paritytech/polkadot-sdk/blob/f6ee4781f633f0f89598f7b230595afe401da8dc/substrate/frame/nomination-pools/src/migration.rs#L27-L48

Just updating the kitchensink runtime to point to them.

This is also nice because it points the dev to an example of how to use
`VersionedMigration`.

* fix typo (paritytech#2377)

* bump zombienet version `v1.3.80` (paritytech#2376)

New release includes logic to move all jobs to `spot instances`.
Thx!

---------

Co-authored-by: Adrian Catangiu <adrian@parity.io>
Co-authored-by: ordian <write@reusable.software>
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
Co-authored-by: Bruno Galvao <brunopgalvao@gmail.com>
Co-authored-by: cuteolaf <OliverLim818@gmail.com>
Co-authored-by: Javier Bullrich <javier@bullrich.dev>
Co-authored-by: Javier Viola <javier@parity.io>
Co-authored-by: Maksym H <1177472+mordamax@users.noreply.github.com>
github-merge-queue bot pushed a commit to paritytech-stg/polkadot-sdk that referenced this pull request Nov 20, 2023
* [ci] Prepare for MQ vol.2

* [ci] Enable zombienet jobs in PRs (paritytech#2361)

Since preparation for the merge queues needs more time I'm enabling
zombienet jobs in PRs CI back.

* westend: remove SessionKeys migration already applied on-chain (paritytech#2363)

Westend now successfully updated to `spec: 103000`, we **have to
remove** the session keys migration before the next release as it
doesn't gracefully handle reapplying it.

* implementers-guide: update github link (paritytech#2368)

cc @joepetrowski

* Fix Typo: `PalletXcmExtrinsicsBenchmark` (paritytech#2354)

Missed in paritytech#1672

* add pallet nomination-pools versioned migration to kitchensink (paritytech#2167)

The versioned migrations are already there in pallet nomination-pools:

https://github.com/paritytech/polkadot-sdk/blob/f6ee4781f633f0f89598f7b230595afe401da8dc/substrate/frame/nomination-pools/src/migration.rs#L27-L48

Just updating the kitchensink runtime to point to them.

This is also nice because it points the dev to an example of how to use
`VersionedMigration`.

* fix typo (paritytech#2377)

* bump zombienet version `v1.3.80` (paritytech#2376)

New release includes logic to move all jobs to `spot instances`.
Thx!

---------

Co-authored-by: Adrian Catangiu <adrian@parity.io>
Co-authored-by: ordian <write@reusable.software>
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
Co-authored-by: Bruno Galvao <brunopgalvao@gmail.com>
Co-authored-by: cuteolaf <OliverLim818@gmail.com>
Co-authored-by: Javier Bullrich <javier@bullrich.dev>
Co-authored-by: Javier Viola <javier@parity.io>
Co-authored-by: Maksym H <1177472+mordamax@users.noreply.github.com>
claravanstaden added a commit to Snowfork/polkadot-sdk that referenced this pull request Nov 24, 2023
* fix substrate-node-template generation (#2050)

# Description

This PR updates the node-template-release generation binary as well as
the `node-template-release.sh` file so that we can automatically push
updates to the [substrate-node-template
repository](https://github.com/substrate-developer-hub/substrate-node-template).
I assume this part was not updated after the substrate project has been
moved into the polkadot-sdk mono repo.

# Adjustments
- extend the `node-template-release.sh` to support the substrate
child-folder
- update the `SUBSTRATE_GIT_URL`
- fix the Cargo.toml filter (so that it does not include any
non-relevant .toml files)
- set the workspace-edition to 2021

# Note
In order to auto-generate the artifacts [this
line](https://github.com/paritytech/polkadot-sdk/blob/master/.gitlab/pipeline/build.yml#L320C15-L320C15)
needs to be included in the build.yml script again. Since I do not have
access to the (probably) internal gitlab environment I hope that someone
with actual access can introduce that change.
I also do not know how the auto-publish feature works so that would be
another thing to add later on.

---------

Co-authored-by: Bastian Köcher <git@kchr.de>

* Build workers for testing on demand (#2018)

* [FRAME] Short-circuit fungible self transfer (#2118)

Changes:
- Change the fungible(s) logic to treat a self-transfer as No-OP (as
long as all pre-checks pass).

Note that the self-transfer case will not emit an event since no state
was changed.

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* [testnet] Add `AssetHubRococo` <-> `AssetHubWestend` asset bridging support (#1967)

## Summary

Asset bridging support for AssetHub**Rococo** <-> AssetHub**Wococo** was
added [here](https://github.com/paritytech/polkadot-sdk/pull/1215), so
now we aim to bridge AssetHub**Rococo** and AssetHub**Westend**. (And
perhaps retire AssetHubWococo and the Wococo chains).

## Solution

**bridge-hub-westend-runtime**
- added new runtime as a copy of `bridge-hub-rococo-runtime`
- added support for bridging to `BridgeHubRococo`
- added tests and benchmarks

**bridge-hub-rococo-runtime**
- added support for bridging to `BridgeHubWestend`
- added tests and benchmarks
- internal refactoring by splitting bridge configuration per network,
e.g., `bridge_to_whatevernetwork_config.rs`.

**asset-hub-rococo-runtime**
- added support for asset bridging to `AssetHubWestend` (allows to
receive only WNDs)
- added new xcm router for `Westend`
- added tests and benchmarks

**asset-hub-westend-runtime**
- added support for asset bridging to `AssetHubRococo` (allows to
receive only ROCs)
- added new xcm router for `Rococo`
- added tests and benchmarks

## Deployment

All changes will be deployed as a part of
https://github.com/paritytech/polkadot-sdk/issues/1988.

## TODO

- [x] benchmarks for all pallet instances
- [x] integration tests
- [x] local run scripts


Relates to:
https://github.com/paritytech/parity-bridges-common/issues/2602
Relates to: https://github.com/paritytech/polkadot-sdk/issues/1988

---------

Co-authored-by: command-bot <>
Co-authored-by: Adrian Catangiu <adrian@parity.io>
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Fix for failed pipeline `test-doc` (#2127)

Fix for failed pipeline `test-doc`:
https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/4174859
I just wonder how could have other PR been merged after this was merged:
https://github.com/paritytech/polkadot-sdk/pull/1714/files#diff-1bde7bb2be0165cbe6db391e10a4a0b2f333348681373a86a0f8502d14d20d32R56

* Bandersnatch dependency update (#2114)

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

* Added `bridge-hub-westend-runtime` to the `short-benchmarks` pipeline (#2128)

* Make `ExecResult` encodable (#1809)

# Description
We derive few useful traits on `ErrorOrigin` and `ExecError`, including
`codec::Encode` and `codec::Decode`, so that `ExecResult` is
en/decodable as well. This is required for a contract mocking feature
(already prepared in drink:
https://github.com/Cardinal-Cryptography/drink/pull/61). In more detail:
`ExecResult` must be passed from runtime extension, through runtime
interface, back to the pallet, which requires that it is serializable to
bytes in some form (or implements some rare, auxiliary traits).

**Impact on runtime size**: Since most of these traits is used directly
in the pallet now, compiler should be able to throw it out (and thus we
bring no new overhead). However, they are very useful in secondary tools
like drink or other testing libraries.

# Checklist

- [x] My PR includes a detailed description as outlined in the
"Description" section above
- [ ] My PR follows the [labeling requirements](CONTRIBUTING.md#Process)
of this project (at minimum one label for `T`
  required)
- [x] I have made corresponding changes to the documentation (if
applicable)
- [x] I have added tests that prove my fix is effective or that my
feature works (if applicable)

* impl Clone for `MemoryKeystore` (#2131)

* XCM MultiAssets: sort after reanchoring (#2129)

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

* Use `Message Queue` as DMP and XCMP dispatch queue (#1246)

(imported from https://github.com/paritytech/cumulus/pull/2157)

## Changes

This MR refactores the XCMP, Parachains System and DMP pallets to use
the [MessageQueue](https://github.com/paritytech/substrate/pull/12485)
for delayed execution of incoming messages. The DMP pallet is entirely
replaced by the MQ and thereby removed. This allows for PoV-bounded
execution and resolves a number of issues that stem from the current
work-around.

All System Parachains adopt this change.  
The most important changes are in `primitives/core/src/lib.rs`,
`parachains/common/src/process_xcm_message.rs`,
`pallets/parachain-system/src/lib.rs`, `pallets/xcmp-queue/src/lib.rs`
and the runtime configs.

### DMP Queue Pallet

The pallet got removed and its logic refactored into parachain-system.
Overweight message management can be done directly through the MQ
pallet.

Final undeployment migrations are provided by
`cumulus_pallet_dmp_queue::UndeployDmpQueue` and `DeleteDmpQueue` that
can be configured with an aux config trait like:

```rust
parameter_types! {
	pub const DmpQueuePalletName: &'static str = \"DmpQueue\" < CHANGE ME;
	pub const RelayOrigin: AggregateMessageOrigin = AggregateMessageOrigin::Parent;
}

impl cumulus_pallet_dmp_queue::MigrationConfig for Runtime {
	type PalletName = DmpQueuePalletName;
	type DmpHandler = frame_support::traits::EnqueueWithOrigin<MessageQueue, RelayOrigin>;
	type DbWeight = <Runtime as frame_system::Config>::DbWeight;
}

// And adding them to your Migrations tuple:
pub type Migrations = (
	...
	cumulus_pallet_dmp_queue::UndeployDmpQueue<Runtime>,
	cumulus_pallet_dmp_queue::DeleteDmpQueue<Runtime>,
);
```

### XCMP Queue pallet

Removed all dispatch queue functionality. Incoming XCMP messages are now
either: Immediately handled if they are Signals, enqueued into the MQ
pallet otherwise.

New config items for the XCMP queue pallet:
```rust
/// The actual queue implementation that retains the messages for later processing.
type XcmpQueue: EnqueueMessage<ParaId>;

/// How a XCM over HRMP from a sibling parachain should be processed.
type XcmpProcessor: ProcessMessage<Origin = ParaId>;

/// The maximal number of suspended XCMP channels at the same time.
#[pallet::constant]
type MaxInboundSuspended: Get<u32>;
```

How to configure those:

```rust
// Use the MessageQueue pallet to store messages for later processing. The `TransformOrigin` is needed since
// the MQ pallet itself operators on `AggregateMessageOrigin` but we want to enqueue `ParaId`s.
type XcmpQueue = TransformOrigin<MessageQueue, AggregateMessageOrigin, ParaId, ParaIdToSibling>;

// Process XCMP messages from siblings. This is type-safe to only accept `ParaId`s. They will be dispatched
// with origin `Junction::Sibling(…)`.
type XcmpProcessor = ProcessFromSibling<
	ProcessXcmMessage<
		AggregateMessageOrigin,
		xcm_executor::XcmExecutor<xcm_config::XcmConfig>,
		RuntimeCall,
	>,
>;

// Not really important what to choose here. Just something larger than the maximal number of channels.
type MaxInboundSuspended = sp_core::ConstU32<1_000>;
```

The `InboundXcmpStatus` storage item was replaced by
`InboundXcmpSuspended` since it now only tracks inbound queue suspension
and no message indices anymore.

Now only sends the most recent channel `Signals`, as all prio ones are
out-dated anyway.

### Parachain System pallet

For `DMP` messages instead of forwarding them to the `DMP` pallet, it
now pushes them to the configured `DmpQueue`. The message processing
which was triggered in `set_validation_data` is now being done by the MQ
pallet `on_initialize`.

XCMP messages are still handed off to the `XcmpMessageHandler`
(XCMP-Queue pallet) - no change here.

New config items for the parachain system pallet:
```rust
/// Queues inbound downward messages for delayed processing. 
///
/// Analogous to the `XcmpQueue` of the XCMP queue pallet.
type DmpQueue: EnqueueMessage<AggregateMessageOrigin>;
``` 

How to configure:
```rust
/// Use the MQ pallet to store DMP messages for delayed processing.
type DmpQueue = MessageQueue;
``` 

## Message Flow

The flow of messages on the parachain side. Messages come in from the
left via the `Validation Data` and finally end up at the `Xcm Executor`
on the right.

![Untitled
(1)](https://github.com/paritytech/cumulus/assets/10380170/6cf8b377-88c9-4aed-96df-baace266e04d)

## Further changes

- Bumped the default suspension, drop and resume thresholds in
`QueueConfigData::default()`.
- `XcmpQueue::{suspend_xcm_execution, resume_xcm_execution}` errors when
they would be a noop.
- Properly validate the `QueueConfigData` before setting it.
- Marked weight files as auto-generated so they wont auto-expand in the
MR files view.
- Move the `hypothetical` asserts to `frame_support` under the name
`experimental_hypothetically`

Questions:
- [ ] What about the ugly `#[cfg(feature = \"runtime-benchmarks\")]` in
the runtimes? Not sure how to best fix. Just having them like this makes
tests fail that rely on the real message processor when the feature is
enabled.
- [ ] Need a good weight for `MessageQueueServiceWeight`. The scheduler
already takes 80% so I put it to 10% but that is quite low.

TODO:
- [x] Remove c&p code after
https://github.com/paritytech/polkadot/pull/6271
- [x] Use `HandleMessage` once it is public in Substrate
- [x] fix `runtime-benchmarks` feature
https://github.com/paritytech/polkadot/pull/6966
- [x] Benchmarks
- [x] Tests
- [ ] Migrate `InboundXcmpStatus` to `InboundXcmpSuspended`
- [x] Possibly cleanup Migrations (DMP+XCMP)
- [x] optional: create `TransformProcessMessageOrigin` in Substrate and
replace `ProcessFromSibling`
- [ ] Rerun weights on ref HW

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: command-bot <>

* Create new trait for non-dedup storage decode (#1932)

- This adds the new trait `StorageDecodeNonDedupLength` and implements
them for `BTreeSet` and its bounded types.
- New unit test has been added to cover the case.  
- See linked
[issue](https://github.com/paritytech/polkadot-sdk/issues/126) which
outlines the original issue.

Note that the added trait here doesn't add new logic but improves
semantics.

---------

Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: command-bot <>

* [testnet] Allow governance to control fees for Rococo <> Westend bridge (#2139)

Right now governance could only control byte-fee component of Rococo <>
Westend message fees (paid at Asset Hubs). This PR changes it a bit:
1) governance now allowed to control both fee components - byte fee and
base fee;
2) base fee now includes cost of "default" delivery and confirmation
transactions, in addition to `ExportMessage` instruction cost.

* skip trigger for review bot on draft PRs (#2145)

Added if condition on review-bot's trigger so it does not trigger in
`draft` PRs.

* substrate: sysinfo: Expose failed hardware requirements (#2144)

The check_hardware functions does not give us too much information as to
what is failing, so let's return the list of failed metrics, so that callers can print 
it.

This would make debugging easier, rather than try to guess which
dimension is actually failing.

Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>

* Update Kusama Parachains Bootnode  (#2148)

# Description

Update the bootnode of kusama parachains before decommissioning the
nodes. This will avoid connecting to non-existing bootnodes.

* Do not request blocks below the common number when syncing (#2045)

This changes `BlockCollection` logic so we don't download block ranges
from peers with which we have these ranges already in sync.

Improves situation with
https://github.com/paritytech/polkadot-sdk/issues/1915.

* Convert `SyncingEngine::run` to use `tokio::select!` instead of polling (#2132)

* Add deprecation checklist document for Substrate (#1583)

fixes https://github.com/paritytech/polkadot-sdk/issues/182

This PR adds a document with recommendations of how deprecations should
be handled. Initiated within FRAME, this checklist could be extended to
the rest of the repo.

I want to quote here a comment from @kianenigma that summarizes the
spirit of this new document:
> I would see it as a guideline of "what an extensive deprecation
process looks like". As the author of a PR, you should match this
against your "common sense" and see if it is needed or not. Someone else
can nudge you to "hey, this is an important PR, you should go through
the deprecation process".
> 
> For some trivial things, all the steps might be an overkill.

---------

Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>

* Tracking/limiting memory allocator (#1192)

* `sc-block-builder`: Remove `BlockBuilderProvider` (#2099)

The `BlockBuilderProvider` was a trait that was defined in
`sc-block-builder`. The trait was implemented for `Client`. This
basically meant that you needed to import `sc-block-builder` any way to
have access to the block builder. So, this trait was not providing any
real value. This pull request is removing the said trait. Instead of the
trait it introduces a builder for creating a `BlockBuilder`. The builder
currently has the quite fabulous name `BlockBuilderBuilder` (I'm open to
any better name :sweat_smile:). The rest of the pull request is about
replacing the old trait with the new builder.

# Downstream code changes

If you used `new_block` or `new_block_at` before you now need to switch
it over to the new `BlockBuilderBuilder` pattern:

```rust
// `new` requires a type that implements `CallApiAt`. 
let mut block_builder = BlockBuilderBuilder::new(client)
                // Then you need to specify the hash of the parent block the block will be build on top of
		.on_parent_block(at)
                // The block builder also needs the block number of the parent block. 
                // Here it is fetched from the given `client` using the `HeaderBackend`
                // However, there also exists `with_parent_block_number` for directly passing the number
		.fetch_parent_block_number(client)
		.unwrap()
                // Enable proof recording if required. This call is optional.
		.enable_proof_recording()
                // Pass the digests. This call is optional.
                .with_inherent_digests(digests)
		.build()
		.expect("Creates new block builder");
```

---------

Co-authored-by: Sebastian Kunert <skunert49@gmail.com>
Co-authored-by: command-bot <>

* Identity pallet improvements (#2048)

This PR is a follow up to #1661 

- [x] rename the `simple` module to `legacy`
- [x] fix benchmarks to disregard the number of additional fields
- [x] change the storage deposits to charge per encoded byte of the
identity information instance, removing the need for `fn
additional(&self) -> usize` in `IdentityInformationProvider`
- [x] ~add an extrinsic to rejig deposits to account for the change
above~
- [ ] ~ensure through proper configuration that the new byte-based
deposit is always lower than whatever is reserved now~
- [x] remove `IdentityFields` from the `set_fields` extrinsic signature,
as per [this
discussion](https://github.com/paritytech/polkadot-sdk/pull/1661#discussion_r1371703403)

> ensure through proper configuration that the new byte-based deposit is
always lower than whatever is reserved now

Not sure this is needed anymore. If the new deposits are higher than
what is currently on chain and users don't have enough funds to reserve
what is needed, the extrinisc fails and they're basically grandfathered
and frozen until they add more funds and/or make a change to their
identity. This behavior seems fine to me. Original idea
[here](https://github.com/paritytech/polkadot-sdk/pull/1661#issuecomment-1779606319).

> add an extrinsic to rejig deposits to account for the change above

This was initially implemented but now removed from this PR in favor of
the implementation detailed
[here](https://github.com/paritytech/polkadot-sdk/pull/2088).

---------

Signed-off-by: georgepisaltu <george.pisaltu@parity.io>
Co-authored-by: joepetrowski <joe@parity.io>

* cumulus test runtime: remove `GenesisExt` (#2147)

This PR removes the `GenesisExt` wrapper over the `GenesisRuntimeConfig`
in `cumulus-test-service`. Initialization of values that were performed
by `GenesisExt::BuildStorage` was moved into `test_pallet` genesis.

---------

Co-authored-by: command-bot <>
Co-authored-by: Bastian Köcher <git@kchr.de>

* Speed up try runtime checks for pallet-bags-list (#2151)

closes https://github.com/paritytech/polkadot-sdk/issues/2020.

This improves running time for pallet-bags-list try runtime checks on
westend from ~90 minutes to 6 seconds on M2 pro.

* Speed up nominator state checks in staking pallet (#2153)

Should help https://github.com/paritytech/polkadot-sdk/issues/234.
Related to https://github.com/paritytech/polkadot-sdk/issues/2020 and
https://github.com/paritytech/polkadot-sdk/issues/2108.

Refactors and improves running time for try runtime checks for staking
pallet.

Tested on westend on my M2 pro: running time drops from 90 seconds to 7
seconds.

* Update bootnode lists (#2150)

# Description

Update the bootnode of kusama parachains before decommissioning the
nodes. This will avoid connecting to non-existing bootnodes.

* Tracking allocator: mark `Spinlock::unlock()` as unsafe and provide a safety contract (#2156)

* `chain-spec`: getting ready for native-runtime-free world (#1256)

This PR prepares chains specs for _native-runtime-free_  world.

This PR has following changes:
- `substrate`:
  - adds support for:
- JSON based `GenesisConfig` to `ChainSpec` allowing interaction with
runtime `GenesisBuilder` API.
- interacting with arbitrary runtime wasm blob to[
`chain-spec-builder`](https://github.com/paritytech/substrate/blob/3ef576eaeb3f42610e85daecc464961cf1295570/bin/utils/chain-spec-builder/src/lib.rs#L46)
command line util,
- removes
[`code`](https://github.com/paritytech/substrate/blob/3ef576eaeb3f42610e85daecc464961cf1295570/frame/system/src/lib.rs#L660)
from `system_pallet`
  - adds `code` to the `ChainSpec`
- deprecates
[`ChainSpec::from_genesis`](https://github.com/paritytech/substrate/blob/3ef576eaeb3f42610e85daecc464961cf1295570/client/chain-spec/src/chain_spec.rs#L263),
but also changes the signature of this method extending it with `code`
argument.
[`ChainSpec::builder()`](https://github.com/paritytech/substrate/blob/20bee680ed098be7239cf7a6b804cd4de267983e/client/chain-spec/src/chain_spec.rs#L507)
should be used instead.
- `polkadot`:
- all references to `RuntimeGenesisConfig` in `node/service` are
removed,
- all
`(kusama|polkadot|versi|rococo|wococo)_(staging|dev)_genesis_config`
functions now return the JSON patch for default runtime `GenesisConfig`,
  - `ChainSpecBuilder` is used, `ChainSpec::from_genesis` is removed,

- `cumulus`:
  - `ChainSpecBuilder` is used, `ChainSpec::from_genesis` is removed,
- _JSON_ patch configuration used instead of `RuntimeGenesisConfig
struct` in all chain specs.
  
---------

Co-authored-by: command-bot <>
Co-authored-by: Javier Viola <javier@parity.io>
Co-authored-by: Davide Galassi <davxy@datawok.net>
Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
Co-authored-by: Kevin Krone <kevin@parity.io>
Co-authored-by: Bastian Köcher <git@kchr.de>

* Fix update-ui-tests.sh (#2161)

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

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* [CI] Update deps (#2159)

Otherwise the return code is not correctly propagated (ref
https://github.com/ggwpez/zepter/pull/48).

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Get rid of `NetworkService` in `ChainSync` (#2143)

Move peer banning from `ChainSync` to `SyncingEngine`.

* `serde_json`: bumped to 1.0.108 (#2168)

This PR updates the version of `serde_json` to `1.0.108` throughout the
codebase.

* Add warning when peer_id is not available when building topology (#2140)

... see https://github.com/paritytech/polkadot-sdk/issues/2138 for why
is not good, until we fix it let's add a warning to understand if this
is happening in the wild.

---------

Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>
Co-authored-by: Bastian Köcher <git@kchr.de>

* Add force remove vesting (#1982)

This PR exposes a `force_remove_vesting` through a ROOT call. 
See linked
[issue](https://github.com/paritytech/polkadot-sdk/issues/269)

---------

Co-authored-by: georgepisaltu <52418509+georgepisaltu@users.noreply.github.com>
Co-authored-by: command-bot <>
Co-authored-by: Dónal Murray <donal.murray@parity.io>

* rename benchmark (#2173)

A quick fix where a benchmark test was wrongly renamed in this PR
https://github.com/paritytech/polkadot-sdk/pull/1868

* approval-voting improvement: include all tranche0 assignments in one certificate  (#1178)

**_PR migrated from https://github.com/paritytech/polkadot/pull/6782_** 

This PR will upgrade the network protocol to version 3 -> VStaging which
will later be renamed to V3. This version introduces a new kind of
assignment certificate that will be used for tranche0 assignments.
Instead of issuing/importing one tranche0 assignment per candidate,
there will be just one certificate per relay chain block per validator.
However, we will not be sending out the new assignment certificates,
yet. So everything should work exactly as before. Once the majority of
the validators have been upgraded to the new protocol version we will
enable the new certificates (starting at a specific relay chain block)
with a new client update.

There are still a few things that need to be done:

- [x] Use bitfield instead of Vec<CandidateIndex>:
https://github.com/paritytech/polkadot/pull/6802
  - [x] Fix existing approval-distribution and approval-voting tests
  - [x] Fix bitfield-distribution and statement-distribution tests
  - [x] Fix network bridge tests
  - [x] Implement todos in the code
  - [x] Add tests to cover new code
  - [x] Update metrics
  - [x] Remove the approval distribution aggression levels: TBD PR
  - [x] Parachains DB migration 
  - [x] Test network protocol upgrade on Versi
  - [x] Versi Load test
  - [x] Add Zombienet test
  - [x] Documentation updates
- [x] Fix for sending DistributeAssignment for each candidate claimed by
a v2 assignment (warning: Importing locally an already known assignment)
 - [x]  Fix AcceptedDuplicate
 - [x] Fix DB migration so that we can still keep old data.
 - [x] Final Versi burn in

---------

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>
Co-authored-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>

* minor: overseer availability-distribution message declaration update (#2179)

availability-distribution subsystem is not sending availability-recovery
messages. Update the overseer declaration to reflect this

* TryDecodeEntireState check for storage types and pallets (#1805)

### This PR is a port of this [PR for
substrate](https://github.com/paritytech/substrate/pull/13013) by
@kianenigma

Add infrastructure needed to have a Pallet::decode_entire_state(), which
makes sure all "typed" storage items defined in the pallet are
decode-able.

This is not enforced in any way at the moment. Teams who wish to
integrate/use this in the try-runtime feature flag should add
frame_support::storage::migration::EnsureStateDecodes as the LAST ITEM
of the runtime's custom migrations, and pass it to frame-executive. This
will make it usable in try-runtime on-runtime-upgrade.

This now catches cases like
https://github.com/paritytech/polkadot-sdk/pull/1969:
```pre
ERROR runtime::executive] failed to decode the value at key: Failed to decode value at key: 0x94eadf0156a8ad5156507773d0471e4ab8ebad86f546c7e0b135a4212aace339. Storage info StorageInfo { pallet_name: Ok("ParaScheduler"), storage_name: Ok("AvailabilityCores"), prefix: Err(Utf8Error { valid_up_to: 0, error_len: Some(1) }), max_values: Some(1), max_size: None }. Raw value: Some("0x0c010101010101")
```

... or:

![image](https://github.com/paritytech/polkadot-sdk/assets/10380170/73052d4f-4da5-4b21-a8dd-b17004e5965e)

Closes #241

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>

* Initialise on-chain `StorageVersion` for pallets added after genesis (#1297)

Original PR https://github.com/paritytech/substrate/pull/14641

---

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

### Problem
Quoting from the above issue:

> When adding a pallet to chain after genesis we currently don't set the
StorageVersion. So, when calling on_chain_storage_version it returns 0
while the pallet is maybe already at storage version 9 when it was added
to the chain. This could lead to issues when running migrations.

### Solution

- Create a new trait `BeforeAllRuntimeMigrations` with a single method
`fn before_all_runtime_migrations() -> Weight` trait with a noop default
implementation
- Modify `Executive` to call
`BeforeAllRuntimeMigrations::before_all_runtime_migrations` for all
pallets before running any other hooks
- Implement `BeforeAllRuntimeMigrations` in the pallet proc macro to
initialize the on-chain version to the current pallet version if the
pallet has no storage set (indicating it has been recently added to the
runtime and needs to have its version initialised).

### Other changes in this PR

- Abstracted repeated boilerplate to access the `pallet_name` in the
pallet expand proc macro.

### FAQ

#### Why create a new hook instead of adding this logic to the pallet
`pre_upgrade`?

`Executive` currently runs `COnRuntimeUpgrade` (custom migrations)
before `AllPalletsWithSystem` migrations. We need versions to be
initialized before the `COnRuntimeUpgrade` migrations are run, because
`COnRuntimeUpgrade` migrations may use the on-chain version for critical
logic. e.g. `VersionedRuntimeUpgrade` uses it to decide whether or not
to execute.

We cannot reorder `COnRuntimeUpgrade` and `AllPalletsWithSystem` so
`AllPalletsWithSystem` runs first, because `AllPalletsWithSystem` have
some logic in their `post_upgrade` hooks to verify that the on-chain
version and current pallet version match. A common use case of
`COnRuntimeUpgrade` migrations is to perform a migration which will
result in the versions matching, so if they were reordered these
`post_upgrade` checks would fail.

#### Why init the on-chain version for pallets without a current storage
version?

We must init the on-chain version for pallets even if they don't have a
defined storage version so if there is a future version bump, the
on-chain version is not automatically set to that new version without a
proper migration.

e.g. bad scenario:

1. A pallet with no 'current version' is added to the runtime
2. Later, the pallet is upgraded with the 'current version' getting set
to 1 and a migration is added to Executive Migrations to migrate the
storage from 0 to 1
    a. Runtime upgrade occurs
    b. `before_all` hook initializes the on-chain version to 1
c. `on_runtime_upgrade` of the migration executes, and sees the on-chain
version is already 1 therefore think storage is already migrated and
does not execute the storage migration
Now, on-chain version is 1 but storage is still at version 0.

By always initializing the on-chain version when the pallet is added to
the runtime we avoid that scenario.

---------

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Bastian Köcher <git@kchr.de>

* zombienet_tests: Fix genesis error in 0006-parachains-max-tranche0.toml (#2191)

There was a race in merging between
https://github.com/paritytech/polkadot-sdk/pull/1256 and
https://github.com/paritytech/polkadot-sdk/pull/1178, so this newly
added tests wasn't updated with the new path for the configuration, so
fix that.

Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>

* mark pallet-asset-rate optional in polkadot-runtime-common (#2187)

Part of #2186

The only usage of pallet-asset-rate is guarded by `runtime-benchmarks`
feature. I don't want ORML to be forced to include this pallet in deps
for no good reason.

* docs: fix typos (#2193)

* Fix "slashaed" typo (#2205)

# Description

This merely fixes a typo in the documentation, replacing the typo
"slashaed" with "slashed". Since external entities use the comments for
explanations of events, this will then be shown externally. I noticed
this when reviewing [this
event](https://polkadot.subscan.io/extrinsic/0xb6bc1e3abde0c2ed9c500c74cfc64cdb8179e5d9af97f4bf53242ce4cdd15a1d?event=18064194-6)
on Subscan.

This is not related to any other issues or PRs.

* Disable incoming light-client connections for minimal relay node (#2202)

When running with `--relay-chain-rpc-url` we received multiple reports
of high traffic that disappears when `--in-peers-light 0` is set. Indeed
it does not make much sense for light clients to connect to the minimal
node since it is not running the block announce protocol and the
request/response protocol for light clients.

This is intended to alleviate the traffic issues for now.

closes #1896
probably related https://github.com/paritytech/cumulus/issues/2563

* XCM builder pattern (#2107)

Added a proc macro to be able to write XCMs using the builder pattern.
This means we go from having to do this:

```rust
let message: Xcm<()> = Xcm(vec![
  WithdrawAsset(assets),
  BuyExecution { fees: asset, weight_limit: Unlimited },
  DepositAsset { assets, beneficiary },
]);
```

to this:

```rust
let message: Xcm<()> = Xcm::builder()
  .withdraw_asset(assets)
  .buy_execution(asset, Unlimited),
  .deposit_asset(assets, beneficiary)
  .build();
```

---------

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
Co-authored-by: command-bot <>

* [testnets][xcm-emulator] add bridge-hub-westend and hook it up to emulator (#2204)

`bridge-hub-westend-runtime` was added to cumulus/parachains, but wasn't
hooked up to xcm-emulator to run tests against it.

This commit addresses that ^.

Signed-off-by: Adrian Catangiu <adrian@parity.io>

* feat(frame-support-procedural): add `automaticaly_derived` attr to `NoBound` derives (#2197)

fixes #2196

* Add `sudo::remove_key` (#2165)

Changes:
- Adds a new call `remove_key` to the sudo pallet to permanently remove
the sudo key.
- Remove some clones and general maintenance

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: command-bot <>

* Adding gitspiegel-trigger workflow (#2135)

GitHub has a setting that requires manual click for executing GHA on the
branch, for the first-time contributors:
https://docs.github.com/en/actions/managing-workflow-runs/approving-workflow-runs-from-public-forks.

After this PR, gitspiegel will respect that setting. So, for PRs from
first-time contributors, gitspiegel won't do mirroring until the button
in PR is clicked. More info:
https://github.com/paritytech/gitspiegel/issues/169

* validate-block: Fix `TrieCache` implementation (#2214)

The trie cache implementation was ignoring the `storage_root` when
setting up the value cache. The problem with this is that the value
cache works using `storage_keys` and these keys are not unique across
different tries. A block can actually have different tries (main trie
and multiple child tries). This pull request fixes the issue by not
ignoring the `storage_root` and returning an unique `value_cache` per
`storage_root`. It also adds a test for the seen bug and improves
documentation that this doesn't happen again.

* Refactor candidate validation messages (#2219)

* [xcm-emulator] Chains generic over Network & Integration tests restructure (#2092)

Closes:
- #1383 
- Declared chains can be now be imported and reused in a different
crate.
- Chain declaration are now generic over a generic type `N` (the
Network)
- #1389
- Solved #1383, chains and networks declarations can be restructure to
avoid having to compile all chains when running integrations tests where
are not needed.
- Chains are now declared on its own crate (removed from
`integration-tests-common`)
- Networks are now declared on its own crate (removed from
`integration-tests-common`)
    - Integration tests will import only the relevant Network crate
- `integration-tests-common` is renamed to
`emulated-integration-tests-common`

All this is necessary to be able to implement what is described here:
https://github.com/paritytech/roadmap/issues/56#issuecomment-1777010553

---------

Co-authored-by: command-bot <>

* `sc-chain-spec`: add support for custom host functions (#2190)

Genesis building in runtime may involve calling some custom host
functions. This PR allows to pass `HostFunctions` into the `ChainSpec`
struct, which in turn are passed to `WasmExecutor`. The `ChainSpec` now
has extended host functions type parameter:
```
pub struct ChainSpec<G, E = NoExtension, EHF = ()>
```
which will be combined with the default set
(`sp_io::SubstrateHostFunctions`) in an instance of `WasmExecutor` used
to build the genesis config.

Fix for #2188

---------

Co-authored-by: Davide Galassi <davxy@datawok.net>
Co-authored-by: Bastian Köcher <git@kchr.de>

* integrations-test: `build_genesis_storage` name fix (#2232)

Some legacy tests were mistakenly merged in #1256 for `emulated-integration-tests-common` crate.
This PR fixes the function name `build_genesis_storage` (no need to use `legacy` suffix, even though the genesis is built from `RuntimeGenesisConfig`).

* Add prospective-parachain subsystem to minimal-relay-node + QoL improvements (#2223)

This PR contains some fixes and cleanups for parachain nodes:

1. When using async backing, node no longer complains about being unable
to reach the prospective-parachain subsystem.
2. Parachain warp sync now informs users that the finalized para block
has been retrieved.
```
2023-11-08 13:24:42 [Parachain] 🎉 Received finalized parachain header #5747719 (0xa0aa…674b) from the relay chain.
```
3. When a user supplied an invalid `--relay-chain-rpc-url`, we were
crashing with a very verbose message. Removed the `expect` and improved
the error message.
```
2023-11-08 13:57:56 [Parachain] No valid RPC url found. Stopping RPC worker.
2023-11-08 13:57:56 [Parachain] Essential task `relay-chain-rpc-worker` failed. Shutting down service.
Error: Service(Application(WorkerCommunicationError("RPC worker channel closed. This can hint and connectivity issues with the supplied RPC endpoints. Message: oneshot canceled")))
```

* Make PalletInfo fields public (#2231)

PalletInfo fields were private, preventing a user from actually using
the QueryPallet instruction in a meaningful way since they couldn't read
the received data.

* BridgeHub Runtimes: Change registration order of `MessageQueue` pallet (#2230)

This PR changes the registration order of the `MessageQueue` pallet so
that it is registered last.

This is necessary so that the
[on_initialize](https://github.com/Snowfork/snowbridge/blob/df8d5da82e517a65fb0858a4f2ead533290336b5/parachain/pallets/outbound-queue/src/lib.rs#L267)
hooks for Snowbridge can run before `MessageQueue` delivers messages
using its own `on_initialize`.

Generally, I think this is preferable regardless of Snowbridge's
particular requirements. Other pallets may want to do housekeeping
before MessageQueue starts delivering messages.

I'm hoping this PR, if accepted, can be included in the same release as
https://github.com/paritytech/polkadot-sdk/pull/1246. As otherwise,
changing the order of pallet registration is an ABI-breaking change.

* Rococo: Build two versions of the wasm binary (#2229)

One for local networks with `fast-runtime` feature activated (1 minute
sessions) and one without the feature activated that will be the default
that runs with 1 hour long sessions.

* Add RadiumBlock Bootnodes for parachains (#2224)

# Description

We would like to add our bootnodes to the following parachains:

Westend: Westmint, Bridgehub

Kusama: Statemine, Bridgehub

Polkadot: Statemint, Bridgehub, Collectives

Thank you.

---------

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Remove unnecessary map_error (#2239)

This was discovered during a debugging session, and it only served to
mask the underlying error, which was not great.

* Add descriptions to all published crates (#2029)

Missing descriptions (47):  

- [x] `cumulus/client/collator/Cargo.toml`
- [x] `cumulus/client/relay-chain-inprocess-interface/Cargo.toml`
- [x] `cumulus/client/cli/Cargo.toml`
- [x] `cumulus/client/service/Cargo.toml`
- [x] `cumulus/client/relay-chain-rpc-interface/Cargo.toml`
- [x] `cumulus/client/relay-chain-interface/Cargo.toml`
- [x] `cumulus/client/relay-chain-minimal-node/Cargo.toml`
- [x] `cumulus/parachains/pallets/parachain-info/Cargo.toml`
- [x] `cumulus/parachains/pallets/ping/Cargo.toml`
- [x] `cumulus/primitives/utility/Cargo.toml`
- [x] `cumulus/primitives/aura/Cargo.toml`
- [x] `cumulus/primitives/core/Cargo.toml`
- [x] `cumulus/primitives/parachain-inherent/Cargo.toml`
- [x] `cumulus/test/relay-sproof-builder/Cargo.toml`
- [x] `cumulus/pallets/xcmp-queue/Cargo.toml`
- [x] `cumulus/pallets/dmp-queue/Cargo.toml`
- [x] `cumulus/pallets/xcm/Cargo.toml`
- [x] `polkadot/erasure-coding/Cargo.toml`
- [x] `polkadot/statement-table/Cargo.toml`
- [x] `polkadot/primitives/Cargo.toml`
- [x] `polkadot/rpc/Cargo.toml`
- [x] `polkadot/node/service/Cargo.toml`
- [x] `polkadot/node/core/parachains-inherent/Cargo.toml`
- [x] `polkadot/node/core/approval-voting/Cargo.toml`
- [x] `polkadot/node/core/dispute-coordinator/Cargo.toml`
- [x] `polkadot/node/core/av-store/Cargo.toml`
- [x] `polkadot/node/core/chain-api/Cargo.toml`
- [x] `polkadot/node/core/prospective-parachains/Cargo.toml`
- [x] `polkadot/node/core/backing/Cargo.toml`
- [x] `polkadot/node/core/provisioner/Cargo.toml`
- [x] `polkadot/node/core/runtime-api/Cargo.toml`
- [x] `polkadot/node/core/bitfield-signing/Cargo.toml`
- [x] `polkadot/node/network/dispute-distribution/Cargo.toml`
- [x] `polkadot/node/network/bridge/Cargo.toml`
- [x] `polkadot/node/network/collator-protocol/Cargo.toml`
- [x] `polkadot/node/network/approval-distribution/Cargo.toml`
- [x] `polkadot/node/network/availability-distribution/Cargo.toml`
- [x] `polkadot/node/network/bitfield-distribution/Cargo.toml`
- [x] `polkadot/node/network/gossip-support/Cargo.toml`
- [x] `polkadot/node/network/availability-recovery/Cargo.toml`
- [x] `polkadot/node/collation-generation/Cargo.toml`
- [x] `polkadot/node/overseer/Cargo.toml`
- [x] `polkadot/runtime/parachains/Cargo.toml`
- [x] `polkadot/runtime/common/slot_range_helper/Cargo.toml`
- [x] `polkadot/runtime/metrics/Cargo.toml`
- [x] `polkadot/xcm/pallet-xcm-benchmarks/Cargo.toml`
- [x] `polkadot/utils/generate-bags/Cargo.toml`
- [x]  `substrate/bin/minimal/runtime/Cargo.toml`

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: alindima <alin@parity.io>
Co-authored-by: ordian <noreply@reusable.software>
Co-authored-by: Tsvetomir Dimitrov <tsvetomir@parity.io>
Co-authored-by: Marcin S <marcin@realemail.net>
Co-authored-by: alindima <alin@parity.io>
Co-authored-by: Sebastian Kunert <skunert49@gmail.com>
Co-authored-by: Dmitry Markin <dmitry@markin.tech>
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>

* Add license to tracking-allocator and add staging-prefix (#2259)

* Don't publish frame and deps (#2260)

* sc-state-db: Keep track of `LAST_PRUNED` after warp syncing (#2228)

When warp syncing we import the target block with all its state.
However, we didn't store the `LAST_PRUNED` block which would then lead
to `pruning` to forget about the imported block after a restart of the
node. We just set `LAST_PRUNED` to the parent block of the warp sync
target block to fix this issue.

* Add license to tracking-allocator and add staging-prefix (#2261)

The staging- rename commit was missing from the last PR for some reason.

* Contracts move fixtures to new crate (#2246)

Small PR that introduce a new crate that will host RISC-V & wasm
fixtures for testing pallet-contracts

* [pallet-message-queue] Implement impl_trait_for_tuples for QueuePausedQuery (#2227)

These changes are required so that the bridgehub system runtimes can
more easily be configured with multiple message processors

Example usage:

```rust
use frame_support::traits::QueuePausedQuery;

impl pallet_message_queue::Config for Runtime {
    type QueuePausedQuery = (A, B, C)
}

* Improve `VersionedMigration` naming conventions (#2264)

As suggested by @ggwpez
(https://github.com/paritytech/polkadot-sdk/pull/2142#discussion_r1388145872),
remove the `VersionChecked` prefix from version checked migrations (but
leave `VersionUnchecked` prefixes)

---------

Co-authored-by: command-bot <>

* Contracts: Add XCM traits to interface with contracts (#2086)

We are introducing a new set of `XcmController` traits (final name yet
to be determined).
These traits are implemented by `pallet-xcm` and allows other pallets,
such as `pallet_contracts`, to rely on these traits instead of tight
coupling them to `pallet-xcm`.

Using only the existing Xcm traits would mean duplicating the logic from
`pallet-xcm` in these other pallets, which we aim to avoid. Our
objective is to ensure that when these APIs are called from
`pallet-contracts`, they produce the exact same outcomes as if called
directly from `pallet-xcm`.

The other benefits is that we can also expose return values to
`pallet-contracts` instead of just calling `pallet-xcm` dispatchable and
getting a `DispatchResult` back.

See traits integration in this PR
https://github.com/paritytech/polkadot-sdk/pull/1248, where the traits
are used as follow to define and implement `pallet-contracts` Config.
```rs
// Contracts config:
pub trait Config: frame_system::Config {
  // ...

  /// A type that exposes XCM APIs, allowing contracts to interact with other parachains, and
  /// execute XCM programs.
  type Xcm: xcm_executor::traits::Controller<
	  OriginFor<Self>,
	  <Self as frame_system::Config>::RuntimeCall,
	  BlockNumberFor<Self>,
  >;
}

// implementation
impl pallet_contracts::Config for Runtime {
        // ...

	type Xcm = pallet_xcm::Pallet<Self>;
}
```

---------

Co-authored-by: Alexander Theißen <alex.theissen@me.com>
Co-authored-by: command-bot <>

* Add `s` utility function to frame support (#2275)

A utility function I consider quite useful to declare string literals
that are backed by an array.

---------

Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: Davide Galassi <davxy@datawok.net>

* Unify `ChainSync` actions under one enum (#2180)

All `ChainSync` actions that `SyncingEngine` should perform are unified
under one `ChainSyncAction`. Processing of these actions put into a
single place after `select!` in `SyncingEngine::run` instead of multiple
places where calling `ChainSync` methods.

* PVF host: Make unavailable security features print a warning (#2244)

Co-authored-by: Bastian Köcher <git@kchr.de>

* wasm-builder: Optimize `rerun-if-changed` logic (#2282)

Optimizes the `rerun-if-changed` logic by ignoring `dev-dependencies`
and also not outputting paths. Because outputting paths could lead to
include unwanted crates in the rerun checks.

* pallet-grandpa: Remove `GRANDPA_AUTHORITIES_KEY` (#2181)

Remove the `GRANDPA_AUTHORITIES_KEY` key and its usage. Apparently this
was used in the early days to communicate the grandpa authorities to the
node. However, we have now a runtime api that does this for us. So, this
pull request is moving from the custom managed storage item to a FRAME
managed storage item.

This pr also includes a migration for doing the switch on a running
chain.

---------

Co-authored-by: Davide Galassi <davxy@datawok.net>

* Adds syntax for marking calls feeless (#1926)

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

This PR adds the following changes:
1. An attribute `pallet::feeless_if` that can be optionally attached to
a call like so:
```rust
#[pallet::feeless_if(|_origin: &OriginFor<T>, something: &u32| -> bool {
	*something == 0
})]
pub fn do_something(origin: OriginFor<T>, something: u32) -> DispatchResult {
     ....
}
```
The closure passed accepts references to arguments as specified in the
call fn. It returns a boolean that denotes the conditions required for
this call to be "feeless".

2. A signed extension `SkipCheckIfFeeless<T: SignedExtension>` that
wraps a transaction payment processor such as
`pallet_transaction_payment::ChargeTransactionPayment`. It checks for
all calls annotated with `pallet::feeless_if` to see if the conditions
are met. If so, the wrapped signed extension is not called, essentially
making the call feeless.

In order to use this, you can simply replace your existing signed
extension that manages transaction payment like so:
```diff
- pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
+ pallet_skip_feeless_payment::SkipCheckIfFeeless<
+	Runtime,
+	pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
+ >,
```

### Todo
- [x] Tests
- [x] Docs
- [x] Prdoc

---------

Co-authored-by: Nikhil Gupta <>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>

* Skip zombienet CI job until PolkadotJS includes `SkipCheckIfFeeless` extension (#2294)

* pallet-xcm: enhance `reserve_transfer_assets` to support remote reserves (#1672)

## Motivation

`pallet-xcm` is the main user-facing interface for XCM functionality,
including assets manipulation functions like `teleportAssets()` and
`reserve_transfer_assets()` calls.

While `teleportAsset()` works both ways, `reserve_transfer_assets()`
works only for sending reserve-based assets to a remote destination and
beneficiary when the reserve is the _local chain_.

## Solution

This PR enhances `pallet_xcm::(limited_)reserve_withdraw_assets` to
support transfers when reserves are other chains.
This will allow complete, **bi-directional** reserve-based asset
transfers user stories using `pallet-xcm`.

Enables following scenarios:
- transferring assets with local reserve (was previously supported iff
asset used as fee also had local reserve - now it works in all cases),
- transferring assets with reserve on destination,
- transferring assets with reserve on remote/third-party chain (iff
assets and fees have same remote reserve),
- transferring assets with reserve different than the reserve of the
asset to be used as fees - meaning can be used to transfer random asset
with local/dest reserve while using DOT for fees on all involved chains,
even if DOT local/dest reserve doesn't match asset reserve,
- transferring assets with any type of local/dest reserve while using
fees which can be teleported between involved chains.

All of the above is done by pallet inner logic without the user having
to specify which scenario/reserves/teleports/etc. The correct scenario
and corresponding XCM programs are identified, and respectively, built
automatically based on runtime configuration of trusted teleporters and
trusted reserves.

#### Current limitations:
- while `fees` and "non-fee" `assets` CAN have different reserves (or
fees CAN be teleported), the remaining "non-fee" `assets` CANNOT, among
themselves, have different reserve locations (this is also implicitly
enforced by `MAX_ASSETS_FOR_TRANSFER=2`, but this can be safely
increased in the future).
- `fees` and "non-fee" `assets` CANNOT have **different remote**
reserves (this could also be supported in the future, but adds even more
complexity while possibly not being worth it - we'll see what the future
holds).

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

---------

Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
Co-authored-by: Branislav Kontur <bkontur@gmail.com>

* Add CI to claim crates (#2299)

* doc(client/cli/src/arg_enums.rs): fix typo ✍️ (#2298)

* review-bot: trigger only on review approvals (#2289)

Moved the review event of review-bot to only be triggered in approvals.

Because we only update the required reviews when someone approves, this
will stop the bot from immediately requesting a new review when someone
comments or request changes as they should have been already notified in
the first batch.

* cumulus-pov-recovery: check pov_hash instead of reencoding data (#2287)

Collators were previously reencoding the available data and checking the
erasure root.
Replace that with just checking the PoV hash, which consumes much less
CPU and takes less time.

We also don't need to check the `PersistedValidationData` hash, as
collators don't use it.

Reason:
https://github.com/paritytech/polkadot-sdk/issues/575#issuecomment-1806572230

After systematic chunks recovery is merged, collators will no longer do
any reed-solomon encoding/decoding, which has proven to be a great CPU
consumer.

Signed-off-by: alindima <alin@parity.io>

* Fix `ecdsa_bls` verify in BEEFY primitives (#2066)

BEEFY ECDSA signatures are on keccak has of the messages. As such we can
not simply call

`EcdsaBlsPair::verify(signature.as_inner_ref(), msg,
self.as_inner_ref())`

because that invokes ecdsa default verification which perfoms blake2
hash which we don't want.

This bring up the second issue makes: This makes `sign` and `verify`
function in `pair_crypto` useless, at least for BEEFY use case.
Moreover, there is no obvious clean way to generate the signature given
that pair_crypto does not exposes `sign_prehashed`. You could in theory
query the keystore for the pair (could you?), invoke `to_raw` and
re-generate each sub-pair and sign using each. But that sounds extremely
anticlimactic and will be frow upon by auditors . So I appreciate any
alternative suggestion.

---------

Co-authored-by: Davide Galassi <davxy@datawok.net>
Co-authored-by: Robert Hambrock <roberthambrock@gmail.com>

* Fix `expect_pallet` benchmarks not relaying on hard-coded `frame_system` dependency version (#2288)

## Problem/Motivation
The benchmark for the `ExpectPallet` XCM instruction uses a hard-coded
version `4.0.0` for the `frame_system` pallet. Unfortunately, this
doesn't work for the `polkadot-fellows/runtimes` repository, where we
use dependencies from `crates.io`, e.g.,
[frame-system::23.0.0.0](https://github.com/polkadot-fellows/runtimes/blob/dd7f86f0d50064481ed0b7c0218494a5cfad997e/relay/kusama/Cargo.toml#L83).

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

## Solution
This PR fixes the benchmarks that require pallet information and enables
the runtime to provide the correct/custom pallet information. The
default implementation provides `frame_system::Pallet` with index `0`,
where the version is not hard-coded but read from the runtime.


## Local testing

Added log for `T::valid_pallet` to the benchmarks like:
```
let valid_pallet = T::valid_pallet();
log::info!(
	target: "frame::benchmark::pallet",
	"valid_pallet: {}::{}::{}::{}::{}",
	valid_pallet.index,
	valid_pallet.module_name,
	valid_pallet.crate_version.major,
	valid_pallet.crate_version.minor,
	valid_pallet.crate_version.patch,
);
```

Run benchmarks for `westend`:
```
cargo run --bin=polkadot --features=runtime-benchmarks -- benchmark pallet --steps=2 --repeat=1 --extrinsic=* --heap-pages=4096 --json-file=./bench.json --chain=westend-dev --template=./polkadot/xcm/pallet-xcm-benchmarks/template.hbs --pallet=pallet_xcm_benchmarks::generic --output=./polkadot/runtime/westend/src/weights/xcm
```

---

For actual `frame_system` version:
```
[package]
name = "frame-system"
version = "4.0.0-dev"
```

Log dump:
```
2023-11-13 12:56:45 Starting benchmark: pallet_xcm_benchmarks::generic::query_pallet    
2023-11-13 12:56:45 valid_pallet: 0::frame_system::4::0::0    
2023-11-13 12:56:45 valid_pallet: 0::frame_system::4::0::0    
2023-11-13 12:56:45 valid_pallet: 0::frame_system::4::0::0    
2023-11-13 12:56:45 Starting benchmark: pallet_xcm_benchmarks::generic::expect_pallet    
2023-11-13 12:56:45 valid_pallet: 0::frame_system::4::0::0    
2023-11-13 12:56:45 valid_pallet: 0::frame_system::4::0::0    
2023-11-13 12:56:45 valid_pallet: 0::frame_system::4::0::0 
```


For changed `frame_system` version:
```
[package]
name = "frame-system"
version = "5.1.3-dev"
```

Log dump:
```
2023-11-13 12:51:51 Starting benchmark: pallet_xcm_benchmarks::generic::query_pallet    
2023-11-13 12:51:51 valid_pallet: 0::frame_system::5::1::3    
2023-11-13 12:51:51 valid_pallet: 0::frame_system::5::1::3    
2023-11-13 12:51:51 valid_pallet: 0::frame_system::5::1::3    
2023-11-13 12:51:51 Starting benchmark: pallet_xcm_benchmarks::generic::expect_pallet    
2023-11-13 12:51:51 valid_pallet: 0::frame_system::5::1::3    
2023-11-13 12:51:51 valid_pallet: 0::frame_system::5::1::3    
2023-11-13 12:51:51 valid_pallet: 0::frame_system::5::1::3
```

## References

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

* Delete undecodable Westend Asset Hub `Balances::Hold` and `Nfts::ItemMetadataOf` (#2309)

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

See issue comments for more details about this storage.

* Add details in `--dev` cli flag documentation (#2305)

add details in `--dev` flag to tell that it disables local peer
discovery

### Context

When adding automated end-to-end tests, we replaced `--dev` by 

```
`--chain=dev`, `--force-authoring`, `--rpc-cors=all`, `--alice`, and `--tmp` flags
```

as stated in the command line documentation. But the tests started
failing due to the nodes connecting to each other.

### Fix

This PR includes additional command line documentation to explain more
in detail what `--dev` flag inludes.

* xcm-emulator: add Rococo<>Westend bridge and add tests for assets transfers over the bridge (#2251)

- switch from Rococo<>Wococo to Rococo<>Westend bridge
- add bidirectional simple tests
- remove Wococo chains from xcm-emulator
- added tests for assets transfers over Rococo<>Westend bridge 

fixes https://github.com/paritytech/parity-bridges-common/issues/2405

* PVF: fix detection of unshare-and-change-root security capability (#2304)

* Add environment to claim workflow (#2318)

Turns out to access environment secrets the workflow must explicitly opt
in to the environment.

* chainHead: Support multiple hashes for `chainHead_unpin` method (#2295)

This PR adds support for multiple hashes being passed to the
`chainHeda_unpin` parameters.

The `hash` parameter is renamed to `hash_or_hashes` per
https://github.com/paritytech/json-rpc-interface-spec/pull/111.

While at it, a new integration test is added to check the unpinning of
multiple hashes. The API is checked against a hash or a vector of
hashes.

cc @paritytech/subxt-team

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* chainHead: Remove `chainHead_genesis` method (#2296)

The method has been removed from the spec
(https://github.com/paritytech/json-rpc-interface-spec/tree/main/src),
this PR keeps the `chainHead` in sync with that change.

@paritytech/subxt-team

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Add simple collator election mechanism (#1340)

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

Port of cumulus PR https://github.com/paritytech/cumulus/pull/2960

This PR adds the ability to bid for collator slots even after the max
number of collators have already registered. This eliminates the first
come, first served mechanism that was in place before.

Key changes:
- added `update_bond` extrinsic to allow registered candidates to adjust
their bonds in order to dynamically control their bids
- added `take_candidate_slot` extrinsic to try to replace an already
existing candidate by bidding more than them
- candidates are now kept in a sorted list in the pallet storage, where
the top `DesiredCandidates` out of `MaxCandidates` candidates in the
list will be selected by the session pallet as collators
- if the candidacy bond is increased through a `set_candidacy_bond`
call, candidates which don't meet the new bond requirements are kicked


# Checklist

- [ ] My PR includes a detailed description as outlined in the
"Description" section above
- [ ] My PR follows the [labeling
requirements](https://github.com/paritytech/polkadot-sdk/blob/master/docs/CONTRIBUTING.md#process)
of this project (at minimum one label for `T` required)
- [ ] I have made corresponding changes to the documentation (if
applicable)
- [ ] I have added tests that prove my fix is effective or that my
feature works (if applicable)
- [ ] If this PR alters any external APIs or interfaces used by
Polkadot, the corresponding Polkadot PR is ready as well as the
corresponding Cumulus PR (optional)

---------

Signed-off-by: georgepisaltu <george.pisaltu@parity.io>

* Contracts: Bump contracts rococo (#2286)

* chainHead/tests: Fix clippy (#2325)

Remove the genesis hash from tests:
- Clippy was passing on the PR:
https://github.com/paritytech/polkadot-sdk/pull/2296
- Clippy fails on master:
https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/4328487

This was a race with merging:
https://github.com/paritytech/polkadot-sdk/pull/2295, which introduced
another test that used the `CHAIN_GENESIS`

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* change prepare worker to use fork instead of threads (#1685)

Co-authored-by: Marcin S <marcin@realemail.net>

* statement-distribution: support inactive local validator in grid (#1571)

Fixes #1437

Co-authored-by: Sophia Gold <sophia@parity.io>

* add NodeFeatures field to HostConfiguration and runtime API (#2177)

Adds a `NodeFeatures` bitfield value to the runtime `HostConfiguration`,
with the purpose of coordinating the enabling of node-side features,
such as: https://github.com/paritytech/polkadot-sdk/issues/628 and
https://github.com/paritytech/polkadot-sdk/issues/598.
These are features that require all validators enable them at the same
time, assuming all/most nodes have upgraded their node versions.

This PR doesn't add any feature yet. These are coming in future PRs.

Also adds a runtime API for querying the state of the client features
and an extrinsic for setting/unsetting a feature by its index in the bitfield.

Note: originally part of:
https://github.com/paritytech/polkadot-sdk/pull/1644, but posted as
standalone to be reused by other PRs until the initial PR is merged

* Contracts expose pallet-xcm (#1248)

This PR introduces:
- XCM  host functions `xcm_send`, `xcm_execute`
- An Xcm trait into the config. that proxy these functions to to
`pallet_xcm`, or disable their usage by using `()`.
- A mock_network and xcm_test files to test the newly added xcm-related
functions.

---------

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com>
Co-authored-by: command-bot <>
Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
Co-authored-by: Alexander Theißen <alex.theissen@me.com>

* pallet-xcm: use XcmTeleportFilter for teleported fees in reserve transfers (#2322)

Disallow reserve transfers that use teleportable fees if `(origin,
fees)` matches `XcmTeleportFilter`.

Add regression tests for filtering based on `XcmTeleportFilter` for both
`(limited_)reserve_transfer_assets()` and `(limited_)teleport_assets`
extrinsics.

* Unify `ChainSync` actions under one enum (follow-up) (#2317)

Get rid of public `ChainSync::..._requests()` functions and return all
requests as actions.

---------

Co-authored-by: Sebastian Kunert <skunert49@gmail.com>

* [CI] Prepare CI for Merge Queues (#2308)

PR prepares CI to the GitHub Merge Queues. All github actions that were
running in PR adjusted so they can run in the merge queues. Zombienet
jobs will do nothing during PRs but they will run during merge queues.

Jobs that will be skipped during PR:
 - all zombienet jobs
 - all publish docker jobs

Jobs that will be skipped during merge queue:
 - check-labels
 - check-prdoc
 - pr-custom-review
 - review trigger

cc https://github.com/paritytech/ci_cd/issues/862

* Identity Deposits Relay to Parachain Migration (#1814)

The goal of this PR is to migrate Identity deposits from the Relay Chain
to a system parachain.

The problem I want to solve is that `IdentityOf` and `SubsOf` both store
an amount that's held in reserve as a storage deposit. When migrating to
a parachain, we can take a snapshot of the actual `IdentityInfo` and
sub-account mappings, but should migrate (off chain) the `deposit`s to
zero, since the chain (and by extension, accounts) won't have any funds
at genesis.

The good news is that we expect parachain deposits to be significantly
lower (possibly 100x) on the parachain. That is, a deposit of 21 DOT on
the Relay Chain would need 0.21 DOT on a parachain. This PR proposes to
migrate the deposits in the following way:

1. Introduces a new pallet with two extrinsics: 
- `reap_identity`: Has a configurable `ReapOrigin`, which would be set
to `EnsureSigned` on the Relay Chain (i.e. callable by anyone) and
`EnsureRoot` on the parachain (we don't want identities reaped from
there).
- `poke_deposit`: Checks what deposit the pallet holds (at genesis,
zero) and attempts to update the amount based on the calculated deposit
for storage data.
2. `reap_identity` clears all storage data for a `target` account and
unreserves their deposit.
3. A `ReapIdentityHandler` teleports the necessary DOT to the parachain
and calls `poke_deposit`. Since the parachain deposit is much lower, and
was just unreserved, we know we have enough.

One awkwardness I ran into was that the XCMv3 instruction set does not
provide a way for the system to teleport assets without a fee being
deducted on reception. Users shouldn't have to pay a fee for the system
to migrate their info to a more efficient location. So I wrote my own
program and did…
@Polkadot-Forum
Copy link

This pull request has been mentioned on Polkadot Forum. There might be relevant details there:

https://forum.polkadot.network/t/polkadot-kusama-bridge/2971/7

claravanstaden added a commit to Snowfork/polkadot-sdk that referenced this pull request Dec 6, 2023
* [ci] Enable zombienet jobs in PRs (#2361)

Since preparation for the merge queues needs more time I'm enabling
zombienet jobs in PRs CI back.

* westend: remove SessionKeys migration already applied on-chain (#2363)

Westend now successfully updated to `spec: 103000`, we **have to
remove** the session keys migration before the next release as it
doesn't gracefully handle reapplying it.

* implementers-guide: update github link (#2368)

cc @joepetrowski

* Fix Typo: `PalletXcmExtrinsicsBenchmark` (#2354)

Missed in https://github.com/paritytech/polkadot-sdk/pull/1672

* add pallet nomination-pools versioned migration to kitchensink (#2167)

The versioned migrations are already there in pallet nomination-pools:

https://github.com/paritytech/polkadot-sdk/blob/f6ee4781f633f0f89598f7b230595afe401da8dc/substrate/frame/nomination-pools/src/migration.rs#L27-L48

Just updating the kitchensink runtime to point to them.

This is also nice because it points the dev to an example of how to use
`VersionedMigration`.

* fix typo (#2377)

* bump zombienet version `v1.3.80` (#2376)

New release includes logic to move all jobs to `spot instances`.
Thx!

* [NPoS] Check if staker is exposed in paged exposure storage entries (#2369)

Addresses a bug caused by
https://github.com/paritytech/polkadot-sdk/pull/1189. The changes are
still not released yet, so would like to push the fix soon so it can go
together with the release of the above PR.

`fast_unstake` checks if a staker is exposed in an era. However, this fn
is still returning whether the staker is exposed based on the old
storage item. This PR fixes that by looking in both old and new exposure
storages.

Also adds some integrity tests for paged exposures.

* Beefy: small fixes (#2378)

Related to #2285

- save the state of the BEEFY gadget after processing a finality proof.
We need this in order to avoid skipping blocks.
- avoid reprocessing the old state when not necessary

* crypto: `lazy_static` removed, light parser for address URI added (#2250)

The `lazy_static` package does not work well in `no-std`: it requires
`spin_no_std` feature, which also will propagate into `std` if enabled.
This is not what we want.

This PR provides simple address uri parser which allows to get rid of
_regex_ which was used to parse the address uri, what in turns allows to
remove lazy_static.

Three regular expressions
(`SS58_REGEX`,`SECRET_PHRASE_REGEX`,`JUNCTION_REGEX`) were replaced with
the parser which unifies all of them.

The new parser does not support Unicode, it is ASCII only.

Related to: #2044

---------

Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: Koute <koute@users.noreply.github.com>
Co-authored-by: command-bot <>

* [trivial] asset-hubs runtimes: fix incorrect doc-comments (#2384)

Fix some incorrect doc-comments

* Do not panic if the `fdlimit` call to increase the file descriptor limit fails (#2155)

# Description

Sometimes changing file descriptor limits is not allowed, but there is
no need to crash the node if/when this happens. Since `fdlimit`'s author
decided to use panics instead of returning `Result`, we need to catch
it.

# Checklist

- [x] My PR includes a detailed description as outlined in the
"Description" section above
- [ ] My PR follows the [labeling requirements](CONTRIBUTING.md#Process)
of this project (at minimum one label for `T`
  required)
- [ ] I have made corresponding changes to the documentation (if
applicable)
- [ ] I have added tests that prove my fix is effective or that my
feature works (if applicable)

---------

Co-authored-by: Koute <koute@users.noreply.github.com>

* Relax `force_default_xcm_version` for testnet system parachains (#2385)

This PR fixes two things:
- relax `force_default_xcm_version` for testnet system parachains (e.g.
BridgeHubWestend has now 2 and there is no way to change it to 3, so we
need to call `force_xcm_version(3)` for every parachain that it is
connected to, because we send XCMv3 messages)
- add `Storage` item to `PolkadotXcm` pallet definition (now we cannot
see storage items for `pallet_xcm` in PJS)


## TODO

- [ ] when merged open PR to `polkadot-fellows/runtimes` repo

* Make collator RPC mode non-experimental (#2381)

The `--relay-chain-rpc-urls` CLI flag has been available for a while
now. We have collators with this running and parachain teams are also
using it. It should be fine now to remove the experimental status.

* Fix migrations and add CI check for new system chains (#2336)

Westend Collectives migration CI check can be fixed once we have
https://github.com/paritytech/try-runtime-cli/pull/58, will open another
PR once it is available.

- [x] Remove deprecated `DmpQueue` pallet from Rococo Contracts, the
migration is complete
- [x] Fix Asset Hub Rococo storage versions
- [x] Add migration check CI for Asset Hub Rococo and Westend Bridge Hub

* Bump bandersnatch VRF revision (#2389)

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

cc @burdges

* Bump secp256k1 from 0.24.3 to 0.28.0 (#2357)

Bumps [secp256k1](https://github.com/rust-bitcoin/rust-secp256k1) from
0.24.3 to 0.28.0.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/rust-bitcoin/rust-secp256k1/blob/master/CHANGELOG.md">secp256k1's
changelog</a>.</em></p>
<blockquote>
<h1>0.28.0 - 2023-10-23</h1>
<ul>
<li>Add bindings to the ElligatorSwift implementation <a
href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/627">#627</a></li>
<li>Depend on recent release of <code>bitcoin_hashes</code> v0.13.0 <a
href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/621">#621</a></li>
<li>Add a verify function to <code>PublicKey</code> <a
href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/618">#618</a></li>
<li>Add serialize function for schnorr::Signature <a
href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/607">#607</a></li>
<li>Bump MSRV to 1.48 <a
href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/595">#595</a></li>
<li>Remove implementations of <code>PartialEq</code>, <code>Eq</code>,
<code>PartialOrd</code>, <code>Ord</code>, and <code>Hash</code> from
the
<code>impl_array_newtype</code> macro. Users will now need to derive
these traits if they are wanted.</li>
</ul>
<h1>0.27.0 - 2023-03-15</h1>
<ul>
<li><a
href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/588">Depend
on newly release <code>bitcoin_hashes</code> v0.12</a>.</li>
<li><a
href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/578">Implement
<code>Debug</code> trait for <code>Scalar</code> type</a>.</li>
<li><a
href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/582">Implement
<code>insecure-erase</code></a>.</li>
</ul>
<h1>0.26.0 - 2202-12-19</h1>
<ul>
<li>Update libsecp25k1 to v0.2.0</li>
</ul>
<h1>0.25.0 - 2022-12-07</h1>
<ul>
<li><a
href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/548">Fix
soundness issue with <code>preallocated_gen_new</code></a></li>
<li>Update to <code>secp256k1-sys</code> <a
href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/549">v0.7.0</a></li>
<li>Use type system to <a
href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/483">improve
safety</a>.</li>
<li><a
href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/490">Change
secp256k1-sys symbol names to 0_6_1</a>.</li>
<li><a
href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/499">Introduce
<code>rustfmt</code></a> to the codebase.</li>
<li><a
href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/507">Make
all raw pointer methods go through the CPtr trait</a>.</li>
<li><a
href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/518">Make
comparison functions stable</a>.</li>
<li><a
href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/512">Remove</a>
public constant <code>ONE_KEY</code> (consider using
<code>FromStr</code> as a replacement).</li>
</ul>
<h1>0.24.1 - 2022-10-25</h1>
<ul>
<li><a
href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/issues/491">Fix
broken deserialization logic of <code>KeyPair</code></a> that previously
always panicked. After the patch deserialization only panics if neither
the <code>global-context</code> nor the <code>alloc</code> (default)
feature is active.</li>
</ul>
<h1>0.24.0 - 2022-07-20</h1>
<ul>
<li>Upgrade to new release of <a
href="https://github.com/rust-bitcoin/bitcoin_hashes/releases/tag/0.11.0">bitcoin_hashes</a>.</li>
</ul>
<h1>0.23.4 - 2022-07-14</h1>
<ul>
<li><a
href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/474">Disable
automatic rerandomization of contexts under WASM</a></li>
</ul>
<h1>0.23.3 - 2022-06-29</h1>
<ul>
<li><a
href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/465">Add
must_use for mut self key manipulation methods</a></li>
<li><a
href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/466">Fix
fuzzing feature guard</a></li>
</ul>
<h1>0.23.2 - 2022-06-27</h1>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/rust-bitcoin/rust-secp256k1/commit/7de09c8050da12a13ef9ee3850597f69c887952d"><code>7de09c8</code></a>
Merge <a
href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/issues/256">rust-bitcoin/rust-secp256k1256</a>:
Tracking PR for release: `secp256k1 v0...</li>
<li><a
href="https://github.com/rust-bitcoin/rust-secp256k1/commit/3dc5b165401f249c01a88cec54061301cffd97a0"><code>3dc5b16</code></a>
Bump version to v0.28.0</li>
<li><a
href="https://github.com/rust-bitcoin/rust-secp256k1/commit/3aada83180beec2b9f5ab8e7b9280a5517d3bcde"><code>3aada83</code></a>
Merge <a
href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/issues/256">rust-bitcoin/rust-secp256k1256</a>:
Add bindings to the ElligatorSwift imp...</li>
<li><a
href="https://github.com/rust-bitcoin/rust-secp256k1/commit/39febcb866ce285d53052a3636602f04483aa710"><code>39febcb</code></a>
Create rust-bidings</li>
<li><a
href="https://github.com/rust-bitcoin/rust-secp256k1/commit/da4f67b274c3061717723a568cfb182e4e2e7cce"><code>da4f67b</code></a>
Merge <a
href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/issues/256">rust-bitcoin/rust-secp256k1256</a>:
Update vendored lib secp256k1 to v0.4.0</li>
<li><a
href="https://github.com/rust-bitcoin/rust-secp256k1/commit/80b2a8d4aa6ffa72041d569eab2278cd8c1ace2a"><code>80b2a8d</code></a>
Update vendored libsecp to v0.4.0</li>
<li><a
href="https://github.com/rust-bitcoin/rust-secp256k1/commit/d2285c929a086276ce6d1670d795c49191e30c65"><code>d2285c9</code></a>
ci: Remove MIPS* from CI</li>
<li><a
href="https://github.com/rust-bitcoin/rust-secp256k1/commit/0d58f50d523b40a78de0b87146208e3ad338c8ba"><code>0d58f50</code></a>
ci: generalize grp in &quot;illegal callback&quot; test</li>
<li><a
href="https://github.com/rust-bitcoin/rust-secp256k1/commit/acf9ac13e9f8df84dd52d2f012cda7211a6af10c"><code>acf9ac1</code></a>
delete <code>test_manual_create_destroy</code> test</li>
<li><a
href="https://github.com/rust-bitcoin/rust-secp256k1/commit/04ce50891bb0d49be5355f5c0d82db70d7dda65a"><code>04ce508</code></a>
lib: fix bad unit test</li>
<li>Additional commits viewable in <a
href="https://github.com/rust-bitcoin/rust-secp256k1/compare/secp256k1-0.24.3...secp256k1-0.28.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=secp256k1&package-manager=cargo&previous-version=0.24.3&new-version=0.28.0)](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 <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>
Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>

* Preserve artifact cache unless stale (#1918)

Co-authored-by: Marcin S <marcin@realemail.net>

* Pools: Add `MaxUnbonding` to metadata (#2397)

* Bump docker/build-push-action from 5.0.0 to 5.1.0 (#2404)

Bumps
[docker/build-push-action](https://github.com/docker/build-push-action)
from 5.0.0 to 5.1.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/docker/build-push-action/releases">docker/build-push-action's
releases</a>.</em></p>
<blockquote>
<h2>v5.1.0</h2>
<ul>
<li>Add <code>annotations</code> input by <a
href="https://github.com/crazy-max"><code>@​crazy-max</code></a> in <a
href="https://redirect.github.com/docker/build-push-action/pull/992">docker/build-push-action#992</a></li>
<li>Add <code>secret-envs</code> input by <a
href="https://github.com/elias-lundgren"><code>@​elias-lundgren</code></a>
in <a
href="https://redirect.github.com/docker/build-push-action/pull/980">docker/build-push-action#980</a></li>
<li>Bump <code>@​babel/traverse</code> from 7.17.3 to 7.23.2 in <a
href="https://redirect.github.com/docker/build-push-action/pull/991">docker/build-push-action#991</a></li>
<li>Bump <code>@​docker/actions-toolkit</code> from 0.13.0-rc.1 to
0.14.0 in <a
href="https://redirect.github.com/docker/build-push-action/pull/990">docker/build-push-action#990</a>
<a
href="https://redirect.github.com/docker/build-push-action/pull/1006">docker/build-push-action#1006</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/docker/build-push-action/compare/v5.0.0...v5.1.0">https://github.com/docker/build-push-action/compare/v5.0.0...v5.1.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/docker/build-push-action/commit/4a13e500e55cf31b7a5d59a38ab2040ab0f42f56"><code>4a13e50</code></a>
Merge pull request <a
href="https://redirect.github.com/docker/build-push-action/issues/1006">#1006</a>
from docker/dependabot/npm_and_yarn/docker/actions-t...</li>
<li><a
href="https://github.com/docker/build-push-action/commit/74166686865cdc289a02f214871fb53447b73447"><code>7416668</code></a>
chore: update generated content</li>
<li><a
href="https://github.com/docker/build-push-action/commit/b4f76a5dc6a67282180eddc6d460f23bc97bfcbc"><code>b4f76a5</code></a>
chore(deps): Bump <code>@​docker/actions-toolkit</code> from 0.13.0 to
0.14.0</li>
<li><a
href="https://github.com/docker/build-push-action/commit/b7feb766fae338d85274c87a9d0f24c09690dbe2"><code>b7feb76</code></a>
Merge pull request <a
href="https://redirect.github.com/docker/build-push-action/issues/1005">#1005</a>
from crazy-max/ci-inspect</li>
<li><a
href="https://github.com/docker/build-push-action/commit/fae8018297c67066fff64a6e9c319c86f89b8982"><code>fae8018</code></a>
ci: inspect sbom and provenance</li>
<li><a
href="https://github.com/docker/build-push-action/commit/b625868b13c3feb675cabbf9bfeb52ae94166606"><code>b625868</code></a>
Merge pull request <a
href="https://redirect.github.com/docker/build-push-action/issues/1004">#1004</a>
from crazy-max/ci-update-buildx</li>
<li><a
href="https://github.com/docker/build-push-action/commit/5193ef1da6ea0d66de97d22817c258b203ade96a"><code>5193ef1</code></a>
ci: update buildx to latest</li>
<li><a
href="https://github.com/docker/build-push-action/commit/d3afd779e409ac26db5374fb27fe4aae9f6adb42"><code>d3afd77</code></a>
Merge pull request <a
href="https://redirect.github.com/docker/build-push-action/issues/991">#991</a>
from docker/dependabot/npm_and_yarn/babel/traverse-7....</li>
<li><a
href="https://github.com/docker/build-push-action/commit/7a786bb2b9408f7f997564f677248fabd4b886d5"><code>7a786bb</code></a>
Merge pull request <a
href="https://redirect.github.com/docker/build-push-action/issues/992">#992</a>
from crazy-max/annotations</li>
<li><a
href="https://github.com/docker/build-push-action/commit/c66ae3adcfbf698ecd851c6bb782654a0c6ffcae"><code>c66ae3a</code></a>
chore: update generated content</li>
<li>Additional commits viewable in <a
href="https://github.com/docker/build-push-action/compare/0565240e2d4ab88bba5387d719585280857ece09...4a13e500e55cf31b7a5d59a38ab2040ab0f42f56">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=docker/build-push-action&package-manager=github_actions&previous-version=5.0.0&new-version=5.1.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* remove retry from backers on failed candidate validation (#2182)

Hey guys, as discussed I've changed the name to a more general one
`PvfExecKind`, is this good or too general?
Creating this as a draft, I still have to fix the tests.

Closes #1585

Kusama address: FkB6QEo8VnV3oifugNj5NeVG3Mvq1zFbrUu4P5YwRoe5mQN

---------

Co-authored-by: command-bot <>
Co-authored-by: Marcin S <marcin@realemail.net>

* bump zombienet version `v1.3.82` (#2396)

Includes:
 - bump `pjs` modules versions
- re-enable test disable in
https://github.com/paritytech/polkadot-sdk/pull/2294

---------

Co-authored-by: Bastian Köcher <info@kchr.de>

* `chain-spec-builder`: cleanup (#2174)

This PR removes:
-  `New`, `Generate`, `Edit` commands,
- `kitchensink` dependency
from the `chain-spec-builder` util.

New `convert-to-raw`, `update-code` commands were added.

Additionally renames the `runtime` command (which was added in #1256) to
`create`.

---------

Co-authored-by: Sebastian Kunert <skunert49@gmail.com>
Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: command-bot <>

* Refactor `ValidationError` (#2406)

* Add output positional arg to undying-collator cli (#2375)

Follow up from https://github.com/paritytech/polkadot-sdk/pull/2370 to
add `output` positional argument to undying-collator.

cc @JoshOrndorff

---------

Co-authored-by: Bastian Köcher <git@kchr.de>

* PVF worker: switch on seccomp networking restrictions (#2221)

* cumulus-consensus-common: block import: `delayed_best_block` flag added (#2001)

This PR adds the `delayed_best_block` flag to `ParachainBlockImport`. If
not set, the `params.fork_choice` is not updated (to
`ForkChoiceStrategy::Custom`) during the block import.

When `delayed_best_block` is set to `false` all parachain blocks on the
[longest
fork](https://github.com/paritytech/polkadot-sdk/blob/552be4800d9e4b480f79a300fc531783e04be099/substrate/client/service/src/client/client.rs#L708-L709)
will be notified as the best block, allowing transaction pool to be
updated with every imported block.

Otherwise imported blocks will not be notified as best blocks
(`fork_choice=ForkChoiceStrategy::Custom(false)`), and transaction pool
would be updated only with best block received from relay-chain.

Improvement for: #1202

---------

Co-authored-by: Bastian Köcher <git@kchr.de>

* Different XCM builders, default one requires fee payment (#2253)

Adding on top of the new builder pattern for creating XCM programs, I'm
adding some more APIs:

```rust
let paying_fees: Xcm<()> = Xcm::builder() // Only allow paying for fees
  .withdraw_asset() // First instruction has to load the holding register
  .buy_execution() // Second instruction has to be `buy_execution`
  .build();

let paying_fees_invalid: Xcm<()> = Xcm::builder()
  .withdraw_asset()
  .build(); // Invalid, need to pay for fees

let not_paying_fees: Xcm<()> = Xcm::builder_unpaid()
  .unpaid_execution() // Needed
  .withdraw_asset()
  .deposit_asset()
  .build();

let all_goes: Xcm<()> = Xcm::builder_unsafe() // You can do anything
  .withdraw_asset()
  .deposit_asset()
  .build();
```

The invalid bits are because the methods don't even exist on the types
that you'd want to call them on.

---------

Co-authored-by: command-bot <>

* added action to pass review bot on merge queue (#2414)

This action will trigger when a merge queue is created and will add a
positive status check under the `review-bot` account, allowing the PR to
pass the required check for the merge.

---------

Co-authored-by: Chevdor <chevdor@users.noreply.github.com>

* Update tick collator for async backing (#1497)

This updates the tick runtime and polkadot-parachain collator to use
async backing.

* cumulus-test-service: block import fix (#2430)

This is follow-up for:
https://github.com/paritytech/polkadot-sdk/pull/2001

Block import queue for `test-parachain` (`cumulus-test-service`) shall
use delayed best block feature.

This should fixed broken zombienet tests.

* Deprecate `RewardDestination::Controller` (#2380)

Deprecates `RewardDestination::Controller` variant.

- [x] `RewardDestination::Controller` annotated with `#[deprecated]`.
- [x] `Controller` variant is now handled the same way as `Stash` in
`payout_stakers`.
- [x] `set_payee` errors if `RewardDestination::Controller` is provided.
- [x] Added `update_payee` call to lazily migrate
`RewardDestination::Controller` `Payee` storage entries to
`RewardDestination::Account(controller)` .
- [x] `payout_stakers_dead_controller` has been removed from benches &
weights - was not used.
- [x] Tests no longer use `RewardDestination::Controller`.

---------

Co-authored-by: command-bot <>
Co-authored-by: Gonçalo Pestana <g6pestana@gmail.com>
Co-authored-by: georgepisaltu <52418509+georgepisaltu@users.noreply.github.com>

* Revert docker images tag naming to <prnum-shortsha> (#2434)

Docker images from paritypr are also used in testnets. PR reverts docker
tags naming to a more convenient.

cc @PierreBesson

* Fixes import path in benchmark macro (#2437)

Fully-qualified path was not being used in benchmark macro for one of
the cases. This PR fixes this and removes the unnecessary import in a
couple of files, which I believe was done to fix this issue.

* PVF: Fix unshare "no such file or directory" error (#2426)

* Make TypeInfo for SkipCheckIfFeeless transparent, too (#2449)

The `SkipCheckifFeeless::IDENTIFIER` became transparent (ie was whatever
the inner signed ext was). This PR just makes the `TypeInfo` transparent
too, so that libraries that use said info to decode the data (ie subxt)
can behave identically whether or not the `SkipCheckifFeeless` wrapper
is used or not.

---------

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* work with additional key values (#1757)

Add the possibility to inject additional key-values in the
sproof-builder that generates the relay root that gets stored in
parachain-system.

Rationale: pallets that verify additional storage items (not those
verified by parachain-system) from the relay should be able to proof
against the relay root that gets stored in parachain-system. This PR
allows to create provide additional nibles that can later be used for
verifiability in other pallets

* polkadot-node-subsystems: `ChainApiBackend` added + `polkadot-debug` image version fixed (#2411)

The out-dated version (bad tag) of [polkadot
image](https://github.com/paritytech/polkadot-sdk/blob/ede4a362622dfa69eb167eaa876246b1289f4b41/.gitlab/pipeline/zombienet/cumulus.yml#L31)
([docker
info](https://hub.docker.com/layers/paritypr/polkadot-debug/master/images/sha256:adb1658052cf671b50c90d5cece5c7a131efa1a95978249bd5cb85a5ad654f7a?context=explore))
was used. This PR fixes this.

See also:
https://github.com/paritytech/polkadot-sdk/pull/2411#issuecomment-1822632724

Also adds an abstraction that allows asynchronous backends to be passed to `ChainApiSubsystem`
---------

Co-authored-by: Sebastian Kunert <skunert49@gmail.com>

* Remove `#[macro_use]` annotation from `mod service` in all nodes. (#2456)

This PR removes `#[macro_use]` from the service module in each of the
Substrate nodes in the repo.

* Parachain Template
* Polkadot Parachain
* Minimal Node
* Node Template
* Kitchen Sink Node

IDK why this annotation was present, maybe from when we had the
`new_partial!` macro?

---------

Co-authored-by: Joshy Orndorff <git-user-email.h0ly5@simplelogin.com>

* Add `on-chain-release-build` feature for Collectives Westend (#2463)

Collectives Westend is missing an `on-chain-release-build` feature flag.

* CI: Disable runtime upgrade spec name check on Westend Asset Hub and fix Staking pallet migration (#2447)

Westend Asset Hub currently failing because the spec name is being
changed next runtime upgrade
(https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/4413125).

This also fixes an idempotency issue with a staking pallet migration.
Similar issues will be caught automatically now that we've also updated
to try-runtime-cli v0.5.0 which checks for idempotency issues.

This also enables try-state checks running in the CI.

* sp-api: Move macro related re-exports to `__private` (#2446)

This moves the macro related re-exports to `__private` to make it more
obvious for downstream users that they are using an internal api.

---------

Co-authored-by: command-bot <>

* Fix trait imports from sp-api (#2472)

Broken after #2446.

* Amend staking docs to account for state of controller deprecation (#2451)

Amends some staking pallet docs, and deprecation comment, to adjust to
the latest controller deprecation state.

Note, do we need the `README.md` file, which is a duplicate of the
pallet docs? Docs would be easier to maintain, and less ambiguity for
devs to refer to, if we had one source of truth in the generated pallet
docs.

* Make publish CI consistant and bump to v0.3.0 (#2453)

* pallet-xcm: ensure xcm outcome is always complete, revert effects otherwise (#2405)

On extrinsics/call, ensure local XCM execution is complete/successful.
Otherwise, fail the extrinsic so that state changes don't get committed
to the db.

Added regression tests that fail without the fix.

fixes #2237

---------

Co-authored-by: Adrian Catangiu <adrian@parity.io>

* pallet-staking: Converts all math operations to safe (#2435)

This PR converts unsafe math operations to safe in the staking pallet.
 
Closes https://github.com/paritytech/polkadot-sdk/issues/2431

---------

Co-authored-by: Ankan <10196091+Ank4n@users.noreply.github.com>

* Adapt test worker to profile flag (#2450)

closes #2194 

cc @mrcnski

---------

Co-authored-by: Bastian Köcher <git@kchr.de>

* Disable any peer connections for parachain nodes in pov-recovery zombienet test (#2475)

I noticed that this test broke at some point. The parachain nodes should
only acquire their blocks from the relay chain. But they were connecting
to their peers and started fetching blocks from there.

In this test I now take additional measures so we check that each nodes
really uses pov-recovery to get the blocks.

* Remove dmp-queue pallet from Rococo Asset Hub and Bridge Hub (#2483)

DMP queue migration is complete and the pallet should be removed to fix
the check runtime upgrade CI.

<img width="1501" alt="Screenshot 2023-11-24 at 16 05 37"
src="https://github.com/paritytech/polkadot-sdk/assets/16665596/ee1da6bb-2756-4423-8085-1e4c73553ad5">

<img width="1501" alt="Screenshot 2023-11-24 at 16 06 44"
src="https://github.com/paritytech/polkadot-sdk/assets/16665596/03f3e88f-aed8-4eaa-aab6-7998f72258be">

* relay-chain-consensus: set a fork_choice (#2462)

After #2001 the `fork_choice` strategy may remain uninitialized in the
block import pipeline which uses relay-chain verifier.
Refer to
https://github.com/paritytech/polkadot-sdk/pull/2430#issuecomment-1823979813
for some further discussion.

* Improve `UnpinHandleInner` debug (#2485)

Printing the `unpin_worker_sender` included the entire stacktrace and
that is a little bit too verbose.

* Derive `MaxEncodedLen` on `SlotDuration` (#2484)

# Description

Needed this in my code as part of the larger data structure.

---------

Co-authored-by: command-bot <>

* pallet-xcm: fix benchmarking (#2489)

Use non-zero weight limit in benchmarking `pallet_xcm::execute()` so the
given XCM actually executes.

* [NPoS] Use EraInfo to manipulate exposure in fast-unstake tests (#2459)

The FastUnstake pallet tests were previously directly modifying storage
items in the pallet-staking to alter exposure. However, due to the
introduction of the [new paged exposure
feature](https://github.com/paritytech/polkadot-sdk/pull/1189) these
tests were not testing against correct storage items. This issue
resulted in a bug that I didn't catch, which has been addressed in [this
fix](https://github.com/paritytech/polkadot-sdk/pull/2369).

This PR introduces a modification to how the pallet-fast-unstake handles
exposure. It now utilizes `pallet-staking::EraInfo` to set or mutate
Exposures.

* Remove `RuntimeApi` dependency on system parachain runtime code (#2455)

The last issue blocking the removal of the Polkadot and Kusama system
parachains from the repo in #1737 is the dependency on the runtime code
through the RuntimeApi in `polkadot-parachain`.

This PR introduces two fake runtimes to satisfy the build requirements
and changes the `new_partial` function to make it not be generic over
the runtimes.
The reason for the second runtime is the different Aura keys used in
Polkadot Asset Hub, as the impl for AuraApi depends on this type.
If this changes the `RuntimeApi` generic could be removed completely
from all functions in `services.rs` and and generic type parameters in
`services.rs` and specified as a concrete type to TFullClient`.

---------

Co-authored-by: Bastian Köcher <git@kchr.de>

* Add missing workspace members (#2491)

The following members have been added:

```pre
cumulus/parachains/integration-tests/emulated/chains/parachains/testing/penpal
cumulus/parachains/testnets-common
polkadot/node/tracking-allocator
substrate/frame/examples/frame-crate
```

CI check can be added after
https://github.com/paritytech/pipeline-scripts/pull/105 is merged.

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Bastian Köcher <git@kchr.de>

* bump zombienet version `v1.3.83` (#2492)

Include fix for `0002-parachains-upgrade-smoke-test` test.

* Do not pollute global base path with export genesis/wasm (#2487)

Otherwise the user may runs into weird errors if there is already a db.

* Zombienet: add polkadot-debug image publish as needs for cumulus tests (#2493)

Add `build-push-image-polkadot-debug` job to needs since we changed to
use the polkadot-debug image from the current branch for cumulus test
and we need to be sure that the image is ready. Fix issues like
https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/4481059

cc: @bkchr

Co-authored-by: Bastian Köcher <git@kchr.de>

* polkadot-parachain: one chain-spec for all (#2457)

This PR removes some `ChainSpec` types which are not necessary
(left-overs from #1256). Currently `ChainSpec` does not have to be
generic over the specific `RuntimeGenesisConfig`, it is enough to use
single type for all:

https://github.com/paritytech/polkadot-sdk/blob/9f787018857660440182142adc806954d7d07709/cumulus/polkadot-parachain/src/chain_spec/mod.rs#L53-L54


related to: https://github.com/paritytech/polkadot-sdk/issues/25

---------

Co-authored-by: command-bot <>

* Update documentation for SafeMode and TxPause Pallets (#2413)

# Description

Documentation for the TxPause and SafeMode pallets.

Based on reading and the notes from the following related PRs:
- https://github.com/paritytech/substrate/pull/12092

I believe this also completes the checklist to be able to close the
related PRs:
- Close #302 
- Close #274

---------

Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* PVF: remove audit log access (#2461)

* New runtime `spec_version` format + backport of the bump to 1.4.0 (#2468)

## Overview

This PR aligns the `spec_version` formatting to the [recent
changes](https://github.com/polkadot-fellows/runtimes/pull/26/files#diff-efa4caeb17487ecb13d8f5eb7863c3241d84afa2e73fbf25909a2ca89df0f362R142)
made for the Polkadot/Kusama runtimes.

It also backports the latest version `v1.4.0` bumps as `1_004_000`.

## Details

During the switch from `v0.9` to `v1.x`, the format of the
`spec_version` was modified from: `(M)m_ppp` for a runtime considered on
version `M.m.pp`. For instance `0.9.42` had a `spec_version` of `9420`.

With the transition to `v1.x`, the format was changed to a bigger number
(still `u32`) formatted as `MM_mm_ppp` where `1.2.3` would be stored as
`01_02_003`.

This PR aligns the format with that has been introduced in the
fellowship repo: `MMM_mmm_ppp`.

---------

Co-authored-by: Bastian Köcher <git@kchr.de>

* Zombienet tests - disputes on finalized blocks (#2184)

**Overview:**
Adding an extra malus variant focusing on disputing finalized blocks. It
will:
- wrap around approval-voting
- listen to `OverseerSignal::BlockFinalized` and when encountered start
a dispute for the `dispute_offset`th ancestor
- simply pass through all other messages and signals

Add zombienet tests testing various edgecases:
- disputing freshly finalized blocks
- disputing stale finalized blocks
- disputing eagerly pruned finalized blocks (might be separate PR)

**TODO:**
- [x] Register new malus variant
- [x] Simple pass through wrapper (approval-voting)
- [x] Simple network definition
- [x] Listen to block finalizations
- [x] Fetch ancestor hash
- [x] Fetch session index
- [x] Fetch candidate
- [x] Construct and send dispute message
- [x] zndsl test 1 checking that disputes on fresh finalizations resolve
valid Closes #1365
- [x] zndsl test 2 checking that disputes for too old finalized blocks
are not possible Closes #1364
- [ ] zndsl test 3 checking that disputes for candidates with eagerly
pruned relay parent state are handled correctly #1359 (deferred to a
separate PR)
- [x] Unit tests for new malus variant (testing cli etc)
- [x] Clean/streamline error handling
- [ ] ~~Ensure it tests properly on session boundaries~~

---------

Co-authored-by: Javier Viola <javier@parity.io>
Co-authored-by: Marcin S. <marcin@realemail.net>
Co-authored-by: Tsvetomir Dimitrov <tsvetomir@parity.io>

* Decomissioned PR-Custom-Review (#2503)

This PR decomissions
[`PR-Custom-Review`](https://github.com/paritytech/pr-custom-review) in
replacement for
[`Review-bot`](https://github.com/paritytech/review-bot).

* Build the standard library crates when building the runtimes (#2217)

Our executor currently only supports the WASM MVP feature set, however
nowadays when compiling WASM the Rust compiler has more features enabled
by default.

We do set the `-C target-cpu=mvp` flag to make sure that *our* code gets
compiled in a way that is compatible with our executor, however this
doesn't affect Rust's standard library crates (`std`, `core` and
`alloc`) which are by default precompiled and still can make use of
these extra features.

So in this PR we force the compiler to also compile the standard library
crates for us to make sure that they also only use the MVP features.

I've added the `WASM_BUILD_STD` environment variable which can be used
to disable this behavior if set to `0`.

Unfortunately this *will* slow down the compile times when building
runtimes, but there isn't much that we can do about that.

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

---------

Co-authored-by: Bastian Köcher <git@kchr.de>

* asset-hub-westend-integration-tests: add more asset transfers tests (#2488)

Just adds more tests.

* Remove the timestamp handler (#2506)

* Staking: `chill_other` takes stash instead of controller (#2501)

The `chill_other` call is the only staking call that explicitly requires
`controller` in its signature. This PR changes the controller arg to be
the stash instead, with `StakingLedger` then fetching the controller
from storage.

This is not a breaking change per se - the call types do not change, but
is noteworthy as UIs will now want to pass the stash account into
`chill_other` calls, & metadata will reflect this.

Note: This is very low impact. `chill_other` has [hardly ever been
used](https://polkadot.subscan.io/extrinsic?address=&module=staking&call=chill_other&result=all&signedChecked=signed%20only&startDate=&endDate=&startBlock=&timeType=date&version=9431&endBlock=)
on Polkadot - notwithstanding the one called 11 days ago at block
18177457 that was a part of test I did, the last call was made 493 days
ago. Only 2 calls have ever been successful.

Addresses controller deprecation #2500

---------

Co-authored-by: command-bot <>
Co-authored-by: Gonçalo Pestana <g6pestana@gmail.com>

* CI: Fix `build-and-attach-release-runtimes.yml` (#2471)

Incorporate suggestion from release team to get this workflow working.

edit: worked on this test GH release:
https://github.com/paritytech/polkadot-sdk/releases/tag/liam-debug-ghw.
let's try it.

* Fixes cumulus README instructions (#2442)

README instructions fixes to be compatible with the `polkadot-prepare`
and `polkadot-execute` binary split.

* Pools: Add ability to configure commission claiming permissions (#2474)

Addresses #409.

This request has been raised by multiple community members - the ability
for the nomination pool root role to configure permissionless commission
claiming:

> Would it be possible to have a claim_commission_other extrinsic for
claiming commission of nomination pools permissionless?

This PR does not quite introduce this additional call, but amends
`do_claim_commission` to check a new `claim_permission` field in the
`Commission` struct, configured by an enum:

```
enum CommissionClaimPermission {
   Permissionless,
   Account(AccountId),
}
```
This can be optionally set in a bonded pool's
`commission.claim_permission` field:

```
struct BondedPool {
   commission: {
      <snip>
      claim_permission: Option<CommissionClaimPermission<T::AccountId>>,
   },
   <snip>
}
```

This is a new field and requires a migration to add it to existing
pools. This will be `None` on pool creation, falling back to the `root`
role having sole access to claim commission if it is not set; this is
the behaviour as it is today. Once set, the field _can_ be set to `None`
again.

#### Changes
- [x] Add `commision.claim_permission` field.
- [x] Add `can_claim_commission` and amend `do_claim_commission`.
- [x] Add `set_commission_claim_permission` call.
- [x] Test to cover new configs and call.
- [x] Add and amend benchmarks.
- [x] Generate new weights + slot into call
`set_commission_claim_permission`.
- [x] Add migration to introduce `commission.claim_permission`, bump
storage version.
- [x] Update Westend weights.
- [x] Migration working.

---------

Co-authored-by: command-bot <>

* Added NetworkId::PolkadotBulletin variant (#2517)

We're going to bridge Polkadot Bridge Hub with [Polkadot Bulletin
chain](https://github.com/zdave-parity/polkadot-bulletin-chain) soon
(and Rococo Bridge Hub with 1:1 copy of Polkadot Bulletin chain even
sooner), so we need a variant for that chain in `NetworkId`. As
suggested, I'm adding a new variant for it to the `NetworkId` (we may
have used `ByGenesis(_)`, but decision was made to have a dedicated
variant for that).

* polkadot: disable block authoring backoff on production networks (#2510)

Currently the polkadot node will backoff from block authoring if
finality starts lagging. This PR disables this mechanism on production
networks (polkadot and kusama) and adds a flags to optionally force
enabling it.

* Set `frame_system::LastRuntimeUpgrade` after running `try-runtime` migrations (#2515)

Sets `frame_system::LastRuntimeUpgrade` after running try-runtime
migrations to better emulate real behavior.

This fixes an issue where migrations using the spec version to determine
whether to execute can incorrectly fail idempotency checks.

@s0me0ne-unkn0wn noticed this issue with the session key migration
introduced in https://github.com/paritytech/polkadot-sdk/pull/2265.

* Increase `cargo-check-each-crate-macos` timeout (#2519)

* Moves all test runtimes to use `derive_impl` (#2409)

Step in https://github.com/paritytech/polkadot-sdk/issues/171

This PR adds `derive_impl` on all `frame_system` config impls for mock
runtimes. The overridden configs are maintained as of now to ensure
minimal changes.

---------

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* PVF: Add test instructions (#2058)

* Remove `wasm-builder`'s README (#2525)

Followup of https://github.com/paritytech/polkadot-sdk/pull/2217

This PR deletes the README of the `wasm-builder` crate and moves its
docs back into the rustdoc, [as requested
here](https://github.com/paritytech/polkadot-sdk/pull/2217#discussion_r1406401175).
(:

* Remove `im-online` pallet from Rococo and Westend (#2265)

Co-authored-by: ordian <write@reusable.software>
Co-authored-by: Vladimir Istyufeev <vladimir@parity.io>

* polkadot: remove grandpa pause support (#2511)

This was never used and we probably don't need it anyway.

* Remove pov-recovery race condition/Improve zombienet test (#2526)

The test was a bit flaky on CI. 

There was a race condition in the pov-recovery system. If the timing is
bad, it can happen that a block waits for a parent that is already
queued for import. The check if a block has children waiting happens
when we insert into the import queue. So we need to do an additional
check once we receive the import notification for the parent block.

Second issue is that `alice` was missing `--in-peers 0` and `--out-peers
0`, so alice was sometimes still fetching block via sync and the
assertion on the logs in zombienet would fail.

There is another potential issue that I saw once locally. We have a
failing pov-recovery queue that fails from time to time to check that
the retry mechanism does what it should. We now make sure that the same
candidate is never failed twice, so the tests become more predictable.

* Rework the event system of `sc-network` (#1370)

This commit introduces a new concept called `NotificationService` which
allows Polkadot protocols to communicate with the underlying
notification protocol implementation directly, without routing events
through `NetworkWorker`. This implies that each protocol has its own
service which it uses to communicate with remote peers and that each
`NotificationService` is unique with respect to the underlying
notification protocol, meaning `NotificationService` for the transaction
protocol can only be used to send and receive transaction-related
notifications.

The `NotificationService` concept introduces two additional benefits:
  * allow protocols to start using custom handshakes
  * allow protocols to accept/reject inbound peers

Previously the validation of inbound connections was solely the
responsibility of `ProtocolController`. This caused issues with light
peers and `SyncingEngine` as `ProtocolController` would accept more
peers than `SyncingEngine` could accept which caused peers to have
differing views of their own states. `SyncingEngine` would reject excess
peers but these rejections were not properly communicated to those peers
causing them to assume that they were accepted.

With `NotificationService`, the local handshake is not sent to remote
peer if peer is rejected which allows it to detect that it was rejected.

This commit also deprecates the use of `NetworkEventStream` for all
notification-related events and going forward only DHT events are
provided through `NetworkEventStream`. If protocols wish to follow each
other's events, they must introduce additional abtractions, as is done
for GRANDPA and transactions protocols by following the syncing protocol
through `SyncEventStream`.

Fixes https://github.com/paritytech/polkadot-sdk/issues/512
Fixes https://github.com/paritytech/polkadot-sdk/issues/514
Fixes https://github.com/paritytech/polkadot-sdk/issues/515
Fixes https://github.com/paritytech/polkadot-sdk/issues/554
Fixes https://github.com/paritytech/polkadot-sdk/issues/556

---
These changes are transferred from
https://github.com/paritytech/substrate/pull/14197 but there are no
functional changes compared to that PR

---------

Co-authored-by: Dmitry Markin <dmitry@markin.tech>
Co-authored-by: Alexandru Vasile <60601340+lexnv@users.noreply.github.com>

* [ci] Run gitspiegel trigger with merge conflicts (#2531)

Currently gitspiegel trigger won't run if there is merge conflict. This
PR fixes it.

close https://github.com/paritytech/gitspiegel/issues/183

* Remove long deprecated `AllPalletsWithoutSystemReversed` (#2509)

Remove deprecated `AllPalletsXY` types.

They have been deprecated for nearly 1.5 years now, I think its fine to
remove them.
If anyone feels like we should first put a date on the deprecation as
stated in the deprecation guideline, feel free to speak up. To me it
looks like this has been forgotten and can be directly removed.

* Remove `dmp_queue` pallet from Westend SP runtimes  (#2516)

Westend SP dmp queue pallet removal is complete.

<img width="1499" alt="Screenshot 2023-11-28 at 08 31 27"
src="https://github.com/paritytech/polkadot-sdk/assets/16665596/906246fb-3de9-4133-a827-431636a097ad">

<img width="1499" alt="Screenshot 2023-11-28 at 08 32 08"
src="https://github.com/paritytech/polkadot-sdk/assets/16665596/bde84891-b044-42c7-9a0b-59125cd24db1">

<img width="1499" alt="Screenshot 2023-11-28 at 08 31 45"
src="https://github.com/paritytech/polkadot-sdk/assets/16665596/38337484-0856-45c0-b9ff-8c785bc3c0e3">

* Enable parallel key scraping (#1985)

closes #174

---------

Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* substrate-node: `NativeElseWasmExecutor` is no longer used (#2521)

This PR removes `NativeElseWasmExecutor` usage from substrate node.
Instead [`WasmExecutor<(sp_io::SubstrateHostFunctions,
sp_statement_store::runtime_api::HostFunctions)>`](https://github.com/paritytech/polkadot-sdk/blob/49a41ab3bb3f630c20e5b24cec8d92382404631c/substrate/bin/node/executor/src/lib.rs#L26)
is used.

Related to #2358.

---------

Co-authored-by: Davide Galassi <davxy@datawok.net>

* Remove system parachains Polkadot and Kusama runtimes (#1737)

Since the Polkadot and Kusama runtimes are no longer in the repo, the
relevant systems parachains runtimes also need to be removed. More
context [here](https://github.com/paritytech/polkadot-sdk/issues/603)
and [here](https://github.com/paritytech/polkadot-sdk/pull/1731).

Removes the following:
- `asset-hub-kusama` and `asset-hub-polkadot`
- `bridge-hub-kusama` and `bridge-hub-polkadot`
- `collectives-polkadot`
- `glutton-kusama`

Partially solves #603 and adds to #1731.

* Improve `CodeExecutor` (#2358)

Since `sp-state-machine` and `GenesisConfigBuilderRuntimeCaller` always
set `use_native` to be false.
We should remove this param and make `NativeElseWasmExecutor` behave
like its name.
It could make the above components use the correct execution strategy.

Maybe polkadot do not need about `NativeElseWasmExecutor` anymore. But
it is still needed by other chains and it's useful for debugging.

---------

Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: command-bot <>
Co-authored-by: Michal Kucharczyk <1728078+michalkucharczyk@users.noreply.github.com>

* add Rotko common good parachain nodes (#2533)

rotko networks parachain bootnodes 
```
# array of commands for testing
parachains=(
  "./polkadot-parachain --chain asset-hub-polkadot --reserved-only --reserved-nodes /dns/mint14.rotko.net/tcp/33514/p2p/12D3KooWKkzLjYF6M5eEs7nYiqEtRqY8SGVouoCwo3nCWsRnThDW --no-hardware-benchmarks"
  "./polkadot-parachain --chain asset-hub-polkadot --reserved-only --reserved-nodes /dns/mint14.rotko.net/tcp/34514/ws/p2p/12D3KooWKkzLjYF6M5eEs7nYiqEtRqY8SGVouoCwo3nCWsRnThDW --no-hardware-benchmarks"
  "./polkadot-parachain --chain asset-hub-polkadot --reserved-only --reserved-nodes /dns/mint14.rotko.net/tcp/35514/wss/p2p/12D3KooWKkzLjYF6M5eEs7nYiqEtRqY8SGVouoCwo3nCWsRnThDW --no-hardware-benchmarks"
  "./polkadot-parachain --chain asset-hub-kusama --reserved-only --reserved-nodes /dns/mine14.rotko.net/tcp/33524/p2p/12D3KooWJUFnjR2PNbsJhudwPVaWCoZy1acPGKjM2cSuGj345BBu --no-hardware-benchmarks"
  "./polkadot-parachain --chain asset-hub-kusama --reserved-only --reserved-nodes /dns/mine14.rotko.net/tcp/34524/ws/p2p/12D3KooWJUFnjR2PNbsJhudwPVaWCoZy1acPGKjM2cSuGj345BBu --no-hardware-benchmarks"
  "./polkadot-parachain --chain asset-hub-kusama --reserved-only --reserved-nodes /dns/mine14.rotko.net/tcp/35524/wss/p2p/12D3KooWJUFnjR2PNbsJhudwPVaWCoZy1acPGKjM2cSuGj345BBu --no-hardware-benchmarks"
  "./polkadot-parachain --chain asset-hub-westend --reserved-only --reserved-nodes /dns/wmint14.rotko.net/tcp/33534/p2p/12D3KooWE4UDXqgtTcMCyUQ8S4uvaT8VMzzTBA6NWmKuYwTacWuN --no-hardware-benchmarks"
  "./polkadot-parachain --chain asset-hub-westend --reserved-only --reserved-nodes /dns/wmint14.rotko.net/tcp/34534/ws/p2p/12D3KooWE4UDXqgtTcMCyUQ8S4uvaT8VMzzTBA6NWmKuYwTacWuN --no-hardware-benchmarks"
  "./polkadot-parachain --chain asset-hub-westend --reserved-only --reserved-nodes /dns/wmint14.rotko.net/tcp/35534/wss/p2p/12D3KooWE4UDXqgtTcMCyUQ8S4uvaT8VMzzTBA6NWmKuYwTacWuN --no-hardware-benchmarks"
  "./polkadot-parachain --chain bridge-hub-polkadot --reserved-only --reserved-nodes /dns/pbr13.rotko.net/tcp/33543/p2p/12D3KooWMxZY7tDc2Rh454VaJJ7RexKAXVS6xSBEvTnXSGCnuGDw --no-hardware-benchmarks"
  "./polkadot-parachain --chain bridge-hub-polkadot --reserved-only --reserved-nodes /dns/pbr13.rotko.net/tcp/34543/ws/p2p/12D3KooWMxZY7tDc2Rh454VaJJ7RexKAXVS6xSBEvTnXSGCnuGDw --no-hardware-benchmarks"
  "./polkadot-parachain --chain bridge-hub-polkadot --reserved-only --reserved-nodes /dns/pbr13.rotko.net/tcp/35543/wss/p2p/12D3KooWMxZY7tDc2Rh454VaJJ7RexKAXVS6xSBEvTnXSGCnuGDw --no-hardware-benchmarks"
  "./polkadot-parachain --chain bridge-hub-kusama --reserved-only --reserved-nodes /dns/kbr13.rotko.net/tcp/33553/p2p/12D3KooWAmBp54mUEYtvsk2kxNEsDbAvdUMcaghxKXgUQxmPEQ66 --no-hardware-benchmarks"
  "./polkadot-parachain --chain bridge-hub-kusama --reserved-only --reserved-nodes /dns/kbr13.rotko.net/tcp/34553/ws/p2p/12D3KooWAmBp54mUEYtvsk2kxNEsDbAvdUMcaghxKXgUQxmPEQ66 --no-hardware-benchmarks"
  "./polkadot-parachain --chain bridge-hub-kusama --reserved-only --reserved-nodes /dns/kbr13.rotko.net/tcp/35553/wss/p2p/12D3KooWAmBp54mUEYtvsk2kxNEsDbAvdUMcaghxKXgUQxmPEQ66 --no-hardware-benchmarks"
  "./polkadot-parachain --chain bridge-hub-westend --reserved-only --reserved-nodes /dns/wbr13.rotko.net/tcp/33563/p2p/12D3KooWJyeRHpxZZbfBCNEgeUFzmRC5AMSAs2tJhjJS1k5hULkD --no-hardware-benchmarks"
  "./polkadot-parachain --chain bridge-hub-westend --reserved-only --reserved-nodes /dns/wbr13.rotko.net/tcp/34563/ws/p2p/12D3KooWJyeRHpxZZbfBCNEgeUFzmRC5AMSAs2tJhjJS1k5hULkD --no-hardware-benchmarks"
  "./polkadot-parachain --chain bridge-hub-westend --reserved-only --reserved-nodes /dns/wbr13.rotko.net/tcp/35563/wss/p2p/12D3KooWJyeRHpxZZbfBCNEgeUFzmRC5AMSAs2tJhjJS1k5hULkD --no-hardware-benchmarks"
  "./polkadot-parachain --chain collectives-polkadot --reserved-only --reserved-nodes /dns/pch13.rotko.net/tcp/33573/wss/p2p/12D3KooWRXudHoazPZ9osMfdY38e8CBxQLD4RhrVeHpRSNNpcDtH --no-hardware-benchmarks"
  "./polkadot-parachain --chain collectives-polkadot --reserved-only --reserved-nodes /dns/pch13.rotko.net/tcp/34573/wss/p2p/12D3KooWRXudHoazPZ9osMfdY38e8CBxQLD4RhrVeHpRSNNpcDtH --no-hardware-benchmarks"
  "./polkadot-parachain --chain collectives-polkadot --reserved-only --reserved-nodes /dns/pch13.rotko.net/tcp/35573/wss/p2p/12D3KooWRXudHoazPZ9osMfdY38e8CBxQLD4RhrVeHpRSNNpcDtH --no-hardware-benchmarks"
  "./polkadot-parachain --chain collectives-westend --reserved-only --reserved-nodes /dns/wch13.rotko.net/tcp/33593/p2p/12D3KooWPG85zhuSRoyptjLkFD4iJFistjiBmc15JgQ96B4fdXYr --no-hardware-benchmarks"
  "./polkadot-parachain --chain collectives-westend --reserved-only --reserved-nodes /dns/wch13.rotko.net/tcp/34593/ws/p2p/12D3KooWPG85zhuSRoyptjLkFD4iJFistjiBmc15JgQ96B4fdXYr --no-hardware-benchmarks"
  "./polkadot-parachain --chain collectives-westend --reserved-only --reserved-nodes /dns/wch13.rotko.net/tcp/35593/wss/p2p/12D3KooWPG85zhuSRoyptjLkFD4iJFistjiBmc15JgQ96B4fdXYr --no-hardware-benchmarks"
)
```

* Bump fs4 from 0.6.6 to 0.7.0 (#1844)

* ParachainHost: No need to be generic over the block or hash type (#2537)

The `BlockNumber` and `Hash` are fixed types any way.

* Adding LuckyFriday's Bootnodes per IBP Application (#2538)

Good day,

This PR requests the inclusion of two bootnode entries for Polkadot,
Kusama and Westend as part of LuckyFriday's IBP application. The nodes
are hosted on self-owned hardware in a co-located facility. We've
undertaken connectivity tests ourselves and also from members of the
IBP.

The test commands used are as follows:

```
polkadot --chain westend --base-path /tmp/node --name "Boot" --reserved-only --reserved-nodes "/dns/ibp-boot-westend.luckyfriday.io/tcp/30334/wss/p2p/12D3KooWDg1YEytdwFFNWroFj6gio4YFsMB3miSbHKgdpJteUMB9" --no-hardware-benchmarks

polkadot --chain westend --base-path /tmp/node --name "Boot" --reserved-only --reserved-nodes "/dns/ibp-boot-westend.luckyfriday.io/tcp/30333/p2p/12D3KooWDg1YEytdwFFNWroFj6gio4YFsMB3miSbHKgdpJteUMB9" --no-hardware-benchmarks

polkadot --chain kusama --base-path /tmp/node --name "Boot" --reserved-only --reserved-nodes "/dns/ibp-boot-kusama.luckyfriday.io/tcp/30334/wss/p2p/12D3KooW9vu1GWHBuxyhm7rZgD3fhGZpNajPXFexadvhujWMgwfT" --no-hardware-benchmarks

polkadot --chain kusama --base-path /tmp/node --name "Boot" --reserved-only --reserved-nodes "/dns/ibp-boot-kusama.luckyfriday.io/tcp/30333/p2p/12D3KooW9vu1GWHBuxyhm7rZgD3fhGZpNajPXFexadvhujWMgwfT" --no-hardware-benchmarks

polkadot --chain polkadot --base-path /tmp/node --name "Boot" --reserved-only --reserved-nodes "/dns/ibp-boot-polkadot.luckyfriday.io/tcp/30334/wss/p2p/12D3KooWEjk6QXrZJ26fLpaajisJGHiz6WiQsR8k7mkM9GmWKnRZ" --no-hardware-benchmarks

polkadot --chain polkadot --base-path /tmp/node --name "Boot" --reserved-only --reserved-nodes "/dns/ibp-boot-polkadot.luckyfriday.io/tcp/30333/p2p/12D3KooWEjk6QXrZJ26fLpaajisJGHiz6WiQsR8k7mkM9GmWKnRZ" --no-hardware-benchmarks
```

All tests yielded syncing with 1 peer, a positive result. We have also
backed up our node-key in the event that restoration is required.

I hope that the aforementioned meets the requirement for inclusion and
look forward to a speedy turnaround.

Kind Regards,
Will | Paradox

* sp-api: Sprinkle some `automatically_derived` attributes

This attribute is informing tooling that the code is automatically
derived and thus, should not enable any linting.

* Disable trace-level logging from the `test-linux-stable-int` (#2546)

* chainHead: Backport error codes from spec (#2539)

This PR backports the error codes from the spec.

This relies on two specs for defining the error codes:
- Our rpc-spec-v2 https://github.com/paritytech/json-rpc-interface-spec.
- JSON-RPC spec https://www.jsonrpc.org/specification#error_object.

To better describe the error codes, they are divided into two separate
modules `rpc_spec_v2` and `json_rpc_spec` respectively.

The `InvalidSubscriptionID` and `FetchBlockHeader` are merged into the
JSON-RPC spec `INTERNAL_ERROR`.
While the other error codes are adjusted from spec.

Errors that are currently in use:
- -32801 block hash not reported by chainHead_follow or block hash has
been unpinned
- -32802 chainHead_follow started with withRuntime == false
- -32803 chainHead_follow did not generate an
operationWaitingForContinue event

The following are errors defined in the [JSON-RPC
spec](https://www.jsonrpc.org/specification#error_object):
- -32602 The provided parameter isn't one of the expected values, has
different format or is missing
- -32603 Internal server error

Note: Error `-32801` must be introduced and generated by the outstanding
https://github.com/paritytech/polkadot-sdk/issues/1505

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

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* state-db: log_target usage fixed (#2547)

Use `LOG_TARGET/LOG_TARGET_PIN` in logs.

* Parachain Template: Prune `AuxStore` bound and corresponding crate dependency (#2303)

This small PR removes an unnecessary trait bound to the `AuxStore` trait
from the Parachain template's `rpc.rs` file.

With that bound removed, the entire dependency on `sc-client-api` can
also be removed.

---------

Co-authored-by: Joshy Orndorff <git-user-email.h0ly5@simplelogin.com>
Co-authored-by: Bastian Köcher <git@kchr.de>

* Contracts: use compiled rust tests (#2347)

see #2189

This PR does the following:
- Bring the user api functions into a new pallet-contracts-uapi (They
are currently defined in ink!
[here])(https://github.com/paritytech/ink/blob/master/crates/env/src/engine/on_chain/ext.rs)
- Add older api versions and unstable to the user api trait.
- Remove pallet-contracts-primitives and bring the types it defined in
uapi / pallet-contracts
- Add the infrastructure to build fixtures from Rust files and test it
works by replacing `dummy.wat` and `call.wat`
- Move all the doc from wasm/runtime.rs to pallet-contracts-uapi.

This will be done in a follow up:
- convert the rest of the test from .wat to rust
- bring risc-v uapi up to date with wasm
- finalize the uapi host fns, making sure everything is codegen from the
source host fns in pallet-contracts

---------

Co-authored-by: Alexander Theißen <alex.theissen@me.com>

* upgraded review bot to 2.3.0 (#2549)

Upgraded to version 2.3.0 which includes:
- paritytech/review-bot#103
- paritytech/review-bot#102

* Register metrics for the notification handles (#2562)

Add metrics for notification handles so substream events are correctly
reported to Prometheus

* Introduce Polkadot-Sdk `developer_hub`  (#2102)

This PR introduces the new crate `developer_hub` into the polkadot-sdk
repo. The vision for the developer-hub crate is detailed in [this
document](https://docs.google.com/document/d/1XLLkFNE8v8HLvZpI2rzsa8N2IN1FcKntc8q-Sc4xBAk/edit?usp=sharing).

<img width="1128" alt="Screenshot 2023-11-02 at 10 45 48"
src="https://github.com/paritytech/polkadot-sdk/assets/5588131/1e12b60f-fef5-42c4-8503-a3ba234077c3">


Other than adding the new crate, it also does the following: 

* Remove the `substrate` crate, as there is now a unique umbrella crate
for multiple things in `developer_hub::polkadot_sdk`.
* (backport candidate) A minor change to `frame-support` macros that
allows `T::RuntimeOrigin` to also be acceptable as the origin type.
* (backport candidate) A minor change to `frame-system` that allows us
to deposit events at genesis because now the real genesis config is
generated via wasm, and we can safely assume `cfg!(feature = "std")`
means only testing. related to #62.
* (backport candidate) Introduces a small `read_events_for_pallet` to
`frame_system` for easier event reading in tests.
* From https://github.com/paritytech/polkadot-sdk-docs/issues/31, it
takes action on improving the `pallet::call` docs.
* From https://github.com/paritytech/polkadot-sdk-docs/issues/31, it
takes action on improving the `UncheckedExtrinsic` docs.

## Way Forward

First, a version of this is deployed temporarily
[here](https://blog.kianenigma.nl/polkadot-sdk/developer_hub/index.html).
I will keep it up to date on a daily basis.

### This Pull Request

I see two ways forward: 

1. We acknowledge that everything in `developer-hub` is going to be WIP,
and merge this asap. We should not yet use links to this crate anywhere.
2. We make this be the feature branch, make PRs against this, and either
gradually backport it, or only merge to master once it is done.

I am personally in favor of option 1. If we stick to option 2, we need a
better way to deploy a staging version of this to gh-pages.

### Issue Tracking

The main issues related to the future of `developer_hub` are: 

- https://github.com/paritytech/polkadot-sdk-docs/issues/31
- https://github.com/paritytech/polkadot-sdk-docs/issues/4
- https://github.com/paritytech/polkadot-sdk-docs/issues/26 
- https://github.com/paritytech/polkadot-sdk-docs/issues/32
- https://github.com/paritytech/polkadot-sdk-docs/issues/36


### After This Pull Request

- [ ] create a redirect for
https://paritytech.github.io/polkadot-sdk/master/substrate/
- [x] analy…
claravanstaden added a commit to Snowfork/polkadot-sdk that referenced this pull request Dec 6, 2023
* [ci] Enable zombienet jobs in PRs (#2361)

Since preparation for the merge queues needs more time I'm enabling
zombienet jobs in PRs CI back.

* westend: remove SessionKeys migration already applied on-chain (#2363)

Westend now successfully updated to `spec: 103000`, we **have to
remove** the session keys migration before the next release as it
doesn't gracefully handle reapplying it.

* implementers-guide: update github link (#2368)

cc @joepetrowski

* Fix Typo: `PalletXcmExtrinsicsBenchmark` (#2354)

Missed in https://github.com/paritytech/polkadot-sdk/pull/1672

* add pallet nomination-pools versioned migration to kitchensink (#2167)

The versioned migrations are already there in pallet nomination-pools:

https://github.com/paritytech/polkadot-sdk/blob/f6ee4781f633f0f89598f7b230595afe401da8dc/substrate/frame/nomination-pools/src/migration.rs#L27-L48

Just updating the kitchensink runtime to point to them.

This is also nice because it points the dev to an example of how to use
`VersionedMigration`.

* fix typo (#2377)

* bump zombienet version `v1.3.80` (#2376)

New release includes logic to move all jobs to `spot instances`.
Thx!

* [NPoS] Check if staker is exposed in paged exposure storage entries (#2369)

Addresses a bug caused by
https://github.com/paritytech/polkadot-sdk/pull/1189. The changes are
still not released yet, so would like to push the fix soon so it can go
together with the release of the above PR.

`fast_unstake` checks if a staker is exposed in an era. However, this fn
is still returning whether the staker is exposed based on the old
storage item. This PR fixes that by looking in both old and new exposure
storages.

Also adds some integrity tests for paged exposures.

* Beefy: small fixes (#2378)

Related to #2285

- save the state of the BEEFY gadget after processing a finality proof.
We need this in order to avoid skipping blocks.
- avoid reprocessing the old state when not necessary

* crypto: `lazy_static` removed, light parser for address URI added (#2250)

The `lazy_static` package does not work well in `no-std`: it requires
`spin_no_std` feature, which also will propagate into `std` if enabled.
This is not what we want.

This PR provides simple address uri parser which allows to get rid of
_regex_ which was used to parse the address uri, what in turns allows to
remove lazy_static.

Three regular expressions
(`SS58_REGEX`,`SECRET_PHRASE_REGEX`,`JUNCTION_REGEX`) were replaced with
the parser which unifies all of them.

The new parser does not support Unicode, it is ASCII only.

Related to: #2044

---------

Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: Koute <koute@users.noreply.github.com>
Co-authored-by: command-bot <>

* [trivial] asset-hubs runtimes: fix incorrect doc-comments (#2384)

Fix some incorrect doc-comments

* Do not panic if the `fdlimit` call to increase the file descriptor limit fails (#2155)

# Description

Sometimes changing file descriptor limits is not allowed, but there is
no need to crash the node if/when this happens. Since `fdlimit`'s author
decided to use panics instead of returning `Result`, we need to catch
it.

# Checklist

- [x] My PR includes a detailed description as outlined in the
"Description" section above
- [ ] My PR follows the [labeling requirements](CONTRIBUTING.md#Process)
of this project (at minimum one label for `T`
  required)
- [ ] I have made corresponding changes to the documentation (if
applicable)
- [ ] I have added tests that prove my fix is effective or that my
feature works (if applicable)

---------

Co-authored-by: Koute <koute@users.noreply.github.com>

* Relax `force_default_xcm_version` for testnet system parachains (#2385)

This PR fixes two things:
- relax `force_default_xcm_version` for testnet system parachains (e.g.
BridgeHubWestend has now 2 and there is no way to change it to 3, so we
need to call `force_xcm_version(3)` for every parachain that it is
connected to, because we send XCMv3 messages)
- add `Storage` item to `PolkadotXcm` pallet definition (now we cannot
see storage items for `pallet_xcm` in PJS)


## TODO

- [ ] when merged open PR to `polkadot-fellows/runtimes` repo

* Make collator RPC mode non-experimental (#2381)

The `--relay-chain-rpc-urls` CLI flag has been available for a while
now. We have collators with this running and parachain teams are also
using it. It should be fine now to remove the experimental status.

* Fix migrations and add CI check for new system chains (#2336)

Westend Collectives migration CI check can be fixed once we have
https://github.com/paritytech/try-runtime-cli/pull/58, will open another
PR once it is available.

- [x] Remove deprecated `DmpQueue` pallet from Rococo Contracts, the
migration is complete
- [x] Fix Asset Hub Rococo storage versions
- [x] Add migration check CI for Asset Hub Rococo and Westend Bridge Hub

* Bump bandersnatch VRF revision (#2389)

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

cc @burdges

* Bump secp256k1 from 0.24.3 to 0.28.0 (#2357)

Bumps [secp256k1](https://github.com/rust-bitcoin/rust-secp256k1) from
0.24.3 to 0.28.0.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/rust-bitcoin/rust-secp256k1/blob/master/CHANGELOG.md">secp256k1's
changelog</a>.</em></p>
<blockquote>
<h1>0.28.0 - 2023-10-23</h1>
<ul>
<li>Add bindings to the ElligatorSwift implementation <a
href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/627">#627</a></li>
<li>Depend on recent release of <code>bitcoin_hashes</code> v0.13.0 <a
href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/621">#621</a></li>
<li>Add a verify function to <code>PublicKey</code> <a
href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/618">#618</a></li>
<li>Add serialize function for schnorr::Signature <a
href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/607">#607</a></li>
<li>Bump MSRV to 1.48 <a
href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/595">#595</a></li>
<li>Remove implementations of <code>PartialEq</code>, <code>Eq</code>,
<code>PartialOrd</code>, <code>Ord</code>, and <code>Hash</code> from
the
<code>impl_array_newtype</code> macro. Users will now need to derive
these traits if they are wanted.</li>
</ul>
<h1>0.27.0 - 2023-03-15</h1>
<ul>
<li><a
href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/588">Depend
on newly release <code>bitcoin_hashes</code> v0.12</a>.</li>
<li><a
href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/578">Implement
<code>Debug</code> trait for <code>Scalar</code> type</a>.</li>
<li><a
href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/582">Implement
<code>insecure-erase</code></a>.</li>
</ul>
<h1>0.26.0 - 2202-12-19</h1>
<ul>
<li>Update libsecp25k1 to v0.2.0</li>
</ul>
<h1>0.25.0 - 2022-12-07</h1>
<ul>
<li><a
href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/548">Fix
soundness issue with <code>preallocated_gen_new</code></a></li>
<li>Update to <code>secp256k1-sys</code> <a
href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/549">v0.7.0</a></li>
<li>Use type system to <a
href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/483">improve
safety</a>.</li>
<li><a
href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/490">Change
secp256k1-sys symbol names to 0_6_1</a>.</li>
<li><a
href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/499">Introduce
<code>rustfmt</code></a> to the codebase.</li>
<li><a
href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/507">Make
all raw pointer methods go through the CPtr trait</a>.</li>
<li><a
href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/518">Make
comparison functions stable</a>.</li>
<li><a
href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/512">Remove</a>
public constant <code>ONE_KEY</code> (consider using
<code>FromStr</code> as a replacement).</li>
</ul>
<h1>0.24.1 - 2022-10-25</h1>
<ul>
<li><a
href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/issues/491">Fix
broken deserialization logic of <code>KeyPair</code></a> that previously
always panicked. After the patch deserialization only panics if neither
the <code>global-context</code> nor the <code>alloc</code> (default)
feature is active.</li>
</ul>
<h1>0.24.0 - 2022-07-20</h1>
<ul>
<li>Upgrade to new release of <a
href="https://github.com/rust-bitcoin/bitcoin_hashes/releases/tag/0.11.0">bitcoin_hashes</a>.</li>
</ul>
<h1>0.23.4 - 2022-07-14</h1>
<ul>
<li><a
href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/474">Disable
automatic rerandomization of contexts under WASM</a></li>
</ul>
<h1>0.23.3 - 2022-06-29</h1>
<ul>
<li><a
href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/465">Add
must_use for mut self key manipulation methods</a></li>
<li><a
href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/pull/466">Fix
fuzzing feature guard</a></li>
</ul>
<h1>0.23.2 - 2022-06-27</h1>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/rust-bitcoin/rust-secp256k1/commit/7de09c8050da12a13ef9ee3850597f69c887952d"><code>7de09c8</code></a>
Merge <a
href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/issues/256">rust-bitcoin/rust-secp256k1256</a>:
Tracking PR for release: `secp256k1 v0...</li>
<li><a
href="https://github.com/rust-bitcoin/rust-secp256k1/commit/3dc5b165401f249c01a88cec54061301cffd97a0"><code>3dc5b16</code></a>
Bump version to v0.28.0</li>
<li><a
href="https://github.com/rust-bitcoin/rust-secp256k1/commit/3aada83180beec2b9f5ab8e7b9280a5517d3bcde"><code>3aada83</code></a>
Merge <a
href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/issues/256">rust-bitcoin/rust-secp256k1256</a>:
Add bindings to the ElligatorSwift imp...</li>
<li><a
href="https://github.com/rust-bitcoin/rust-secp256k1/commit/39febcb866ce285d53052a3636602f04483aa710"><code>39febcb</code></a>
Create rust-bidings</li>
<li><a
href="https://github.com/rust-bitcoin/rust-secp256k1/commit/da4f67b274c3061717723a568cfb182e4e2e7cce"><code>da4f67b</code></a>
Merge <a
href="https://redirect.github.com/rust-bitcoin/rust-secp256k1/issues/256">rust-bitcoin/rust-secp256k1256</a>:
Update vendored lib secp256k1 to v0.4.0</li>
<li><a
href="https://github.com/rust-bitcoin/rust-secp256k1/commit/80b2a8d4aa6ffa72041d569eab2278cd8c1ace2a"><code>80b2a8d</code></a>
Update vendored libsecp to v0.4.0</li>
<li><a
href="https://github.com/rust-bitcoin/rust-secp256k1/commit/d2285c929a086276ce6d1670d795c49191e30c65"><code>d2285c9</code></a>
ci: Remove MIPS* from CI</li>
<li><a
href="https://github.com/rust-bitcoin/rust-secp256k1/commit/0d58f50d523b40a78de0b87146208e3ad338c8ba"><code>0d58f50</code></a>
ci: generalize grp in &quot;illegal callback&quot; test</li>
<li><a
href="https://github.com/rust-bitcoin/rust-secp256k1/commit/acf9ac13e9f8df84dd52d2f012cda7211a6af10c"><code>acf9ac1</code></a>
delete <code>test_manual_create_destroy</code> test</li>
<li><a
href="https://github.com/rust-bitcoin/rust-secp256k1/commit/04ce50891bb0d49be5355f5c0d82db70d7dda65a"><code>04ce508</code></a>
lib: fix bad unit test</li>
<li>Additional commits viewable in <a
href="https://github.com/rust-bitcoin/rust-secp256k1/compare/secp256k1-0.24.3...secp256k1-0.28.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=secp256k1&package-manager=cargo&previous-version=0.24.3&new-version=0.28.0)](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 <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>
Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>

* Preserve artifact cache unless stale (#1918)

Co-authored-by: Marcin S <marcin@realemail.net>

* Pools: Add `MaxUnbonding` to metadata (#2397)

* Bump docker/build-push-action from 5.0.0 to 5.1.0 (#2404)

Bumps
[docker/build-push-action](https://github.com/docker/build-push-action)
from 5.0.0 to 5.1.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/docker/build-push-action/releases">docker/build-push-action's
releases</a>.</em></p>
<blockquote>
<h2>v5.1.0</h2>
<ul>
<li>Add <code>annotations</code> input by <a
href="https://github.com/crazy-max"><code>@​crazy-max</code></a> in <a
href="https://redirect.github.com/docker/build-push-action/pull/992">docker/build-push-action#992</a></li>
<li>Add <code>secret-envs</code> input by <a
href="https://github.com/elias-lundgren"><code>@​elias-lundgren</code></a>
in <a
href="https://redirect.github.com/docker/build-push-action/pull/980">docker/build-push-action#980</a></li>
<li>Bump <code>@​babel/traverse</code> from 7.17.3 to 7.23.2 in <a
href="https://redirect.github.com/docker/build-push-action/pull/991">docker/build-push-action#991</a></li>
<li>Bump <code>@​docker/actions-toolkit</code> from 0.13.0-rc.1 to
0.14.0 in <a
href="https://redirect.github.com/docker/build-push-action/pull/990">docker/build-push-action#990</a>
<a
href="https://redirect.github.com/docker/build-push-action/pull/1006">docker/build-push-action#1006</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/docker/build-push-action/compare/v5.0.0...v5.1.0">https://github.com/docker/build-push-action/compare/v5.0.0...v5.1.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/docker/build-push-action/commit/4a13e500e55cf31b7a5d59a38ab2040ab0f42f56"><code>4a13e50</code></a>
Merge pull request <a
href="https://redirect.github.com/docker/build-push-action/issues/1006">#1006</a>
from docker/dependabot/npm_and_yarn/docker/actions-t...</li>
<li><a
href="https://github.com/docker/build-push-action/commit/74166686865cdc289a02f214871fb53447b73447"><code>7416668</code></a>
chore: update generated content</li>
<li><a
href="https://github.com/docker/build-push-action/commit/b4f76a5dc6a67282180eddc6d460f23bc97bfcbc"><code>b4f76a5</code></a>
chore(deps): Bump <code>@​docker/actions-toolkit</code> from 0.13.0 to
0.14.0</li>
<li><a
href="https://github.com/docker/build-push-action/commit/b7feb766fae338d85274c87a9d0f24c09690dbe2"><code>b7feb76</code></a>
Merge pull request <a
href="https://redirect.github.com/docker/build-push-action/issues/1005">#1005</a>
from crazy-max/ci-inspect</li>
<li><a
href="https://github.com/docker/build-push-action/commit/fae8018297c67066fff64a6e9c319c86f89b8982"><code>fae8018</code></a>
ci: inspect sbom and provenance</li>
<li><a
href="https://github.com/docker/build-push-action/commit/b625868b13c3feb675cabbf9bfeb52ae94166606"><code>b625868</code></a>
Merge pull request <a
href="https://redirect.github.com/docker/build-push-action/issues/1004">#1004</a>
from crazy-max/ci-update-buildx</li>
<li><a
href="https://github.com/docker/build-push-action/commit/5193ef1da6ea0d66de97d22817c258b203ade96a"><code>5193ef1</code></a>
ci: update buildx to latest</li>
<li><a
href="https://github.com/docker/build-push-action/commit/d3afd779e409ac26db5374fb27fe4aae9f6adb42"><code>d3afd77</code></a>
Merge pull request <a
href="https://redirect.github.com/docker/build-push-action/issues/991">#991</a>
from docker/dependabot/npm_and_yarn/babel/traverse-7....</li>
<li><a
href="https://github.com/docker/build-push-action/commit/7a786bb2b9408f7f997564f677248fabd4b886d5"><code>7a786bb</code></a>
Merge pull request <a
href="https://redirect.github.com/docker/build-push-action/issues/992">#992</a>
from crazy-max/annotations</li>
<li><a
href="https://github.com/docker/build-push-action/commit/c66ae3adcfbf698ecd851c6bb782654a0c6ffcae"><code>c66ae3a</code></a>
chore: update generated content</li>
<li>Additional commits viewable in <a
href="https://github.com/docker/build-push-action/compare/0565240e2d4ab88bba5387d719585280857ece09...4a13e500e55cf31b7a5d59a38ab2040ab0f42f56">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=docker/build-push-action&package-manager=github_actions&previous-version=5.0.0&new-version=5.1.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* remove retry from backers on failed candidate validation (#2182)

Hey guys, as discussed I've changed the name to a more general one
`PvfExecKind`, is this good or too general?
Creating this as a draft, I still have to fix the tests.

Closes #1585

Kusama address: FkB6QEo8VnV3oifugNj5NeVG3Mvq1zFbrUu4P5YwRoe5mQN

---------

Co-authored-by: command-bot <>
Co-authored-by: Marcin S <marcin@realemail.net>

* bump zombienet version `v1.3.82` (#2396)

Includes:
 - bump `pjs` modules versions
- re-enable test disable in
https://github.com/paritytech/polkadot-sdk/pull/2294

---------

Co-authored-by: Bastian Köcher <info@kchr.de>

* `chain-spec-builder`: cleanup (#2174)

This PR removes:
-  `New`, `Generate`, `Edit` commands,
- `kitchensink` dependency
from the `chain-spec-builder` util.

New `convert-to-raw`, `update-code` commands were added.

Additionally renames the `runtime` command (which was added in #1256) to
`create`.

---------

Co-authored-by: Sebastian Kunert <skunert49@gmail.com>
Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: command-bot <>

* Refactor `ValidationError` (#2406)

* Add output positional arg to undying-collator cli (#2375)

Follow up from https://github.com/paritytech/polkadot-sdk/pull/2370 to
add `output` positional argument to undying-collator.

cc @JoshOrndorff

---------

Co-authored-by: Bastian Köcher <git@kchr.de>

* PVF worker: switch on seccomp networking restrictions (#2221)

* cumulus-consensus-common: block import: `delayed_best_block` flag added (#2001)

This PR adds the `delayed_best_block` flag to `ParachainBlockImport`. If
not set, the `params.fork_choice` is not updated (to
`ForkChoiceStrategy::Custom`) during the block import.

When `delayed_best_block` is set to `false` all parachain blocks on the
[longest
fork](https://github.com/paritytech/polkadot-sdk/blob/552be4800d9e4b480f79a300fc531783e04be099/substrate/client/service/src/client/client.rs#L708-L709)
will be notified as the best block, allowing transaction pool to be
updated with every imported block.

Otherwise imported blocks will not be notified as best blocks
(`fork_choice=ForkChoiceStrategy::Custom(false)`), and transaction pool
would be updated only with best block received from relay-chain.

Improvement for: #1202

---------

Co-authored-by: Bastian Köcher <git@kchr.de>

* Different XCM builders, default one requires fee payment (#2253)

Adding on top of the new builder pattern for creating XCM programs, I'm
adding some more APIs:

```rust
let paying_fees: Xcm<()> = Xcm::builder() // Only allow paying for fees
  .withdraw_asset() // First instruction has to load the holding register
  .buy_execution() // Second instruction has to be `buy_execution`
  .build();

let paying_fees_invalid: Xcm<()> = Xcm::builder()
  .withdraw_asset()
  .build(); // Invalid, need to pay for fees

let not_paying_fees: Xcm<()> = Xcm::builder_unpaid()
  .unpaid_execution() // Needed
  .withdraw_asset()
  .deposit_asset()
  .build();

let all_goes: Xcm<()> = Xcm::builder_unsafe() // You can do anything
  .withdraw_asset()
  .deposit_asset()
  .build();
```

The invalid bits are because the methods don't even exist on the types
that you'd want to call them on.

---------

Co-authored-by: command-bot <>

* added action to pass review bot on merge queue (#2414)

This action will trigger when a merge queue is created and will add a
positive status check under the `review-bot` account, allowing the PR to
pass the required check for the merge.

---------

Co-authored-by: Chevdor <chevdor@users.noreply.github.com>

* Update tick collator for async backing (#1497)

This updates the tick runtime and polkadot-parachain collator to use
async backing.

* cumulus-test-service: block import fix (#2430)

This is follow-up for:
https://github.com/paritytech/polkadot-sdk/pull/2001

Block import queue for `test-parachain` (`cumulus-test-service`) shall
use delayed best block feature.

This should fixed broken zombienet tests.

* Deprecate `RewardDestination::Controller` (#2380)

Deprecates `RewardDestination::Controller` variant.

- [x] `RewardDestination::Controller` annotated with `#[deprecated]`.
- [x] `Controller` variant is now handled the same way as `Stash` in
`payout_stakers`.
- [x] `set_payee` errors if `RewardDestination::Controller` is provided.
- [x] Added `update_payee` call to lazily migrate
`RewardDestination::Controller` `Payee` storage entries to
`RewardDestination::Account(controller)` .
- [x] `payout_stakers_dead_controller` has been removed from benches &
weights - was not used.
- [x] Tests no longer use `RewardDestination::Controller`.

---------

Co-authored-by: command-bot <>
Co-authored-by: Gonçalo Pestana <g6pestana@gmail.com>
Co-authored-by: georgepisaltu <52418509+georgepisaltu@users.noreply.github.com>

* Revert docker images tag naming to <prnum-shortsha> (#2434)

Docker images from paritypr are also used in testnets. PR reverts docker
tags naming to a more convenient.

cc @PierreBesson

* Fixes import path in benchmark macro (#2437)

Fully-qualified path was not being used in benchmark macro for one of
the cases. This PR fixes this and removes the unnecessary import in a
couple of files, which I believe was done to fix this issue.

* PVF: Fix unshare "no such file or directory" error (#2426)

* Make TypeInfo for SkipCheckIfFeeless transparent, too (#2449)

The `SkipCheckifFeeless::IDENTIFIER` became transparent (ie was whatever
the inner signed ext was). This PR just makes the `TypeInfo` transparent
too, so that libraries that use said info to decode the data (ie subxt)
can behave identically whether or not the `SkipCheckifFeeless` wrapper
is used or not.

---------

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* work with additional key values (#1757)

Add the possibility to inject additional key-values in the
sproof-builder that generates the relay root that gets stored in
parachain-system.

Rationale: pallets that verify additional storage items (not those
verified by parachain-system) from the relay should be able to proof
against the relay root that gets stored in parachain-system. This PR
allows to create provide additional nibles that can later be used for
verifiability in other pallets

* polkadot-node-subsystems: `ChainApiBackend` added + `polkadot-debug` image version fixed (#2411)

The out-dated version (bad tag) of [polkadot
image](https://github.com/paritytech/polkadot-sdk/blob/ede4a362622dfa69eb167eaa876246b1289f4b41/.gitlab/pipeline/zombienet/cumulus.yml#L31)
([docker
info](https://hub.docker.com/layers/paritypr/polkadot-debug/master/images/sha256:adb1658052cf671b50c90d5cece5c7a131efa1a95978249bd5cb85a5ad654f7a?context=explore))
was used. This PR fixes this.

See also:
https://github.com/paritytech/polkadot-sdk/pull/2411#issuecomment-1822632724

Also adds an abstraction that allows asynchronous backends to be passed to `ChainApiSubsystem`
---------

Co-authored-by: Sebastian Kunert <skunert49@gmail.com>

* Remove `#[macro_use]` annotation from `mod service` in all nodes. (#2456)

This PR removes `#[macro_use]` from the service module in each of the
Substrate nodes in the repo.

* Parachain Template
* Polkadot Parachain
* Minimal Node
* Node Template
* Kitchen Sink Node

IDK why this annotation was present, maybe from when we had the
`new_partial!` macro?

---------

Co-authored-by: Joshy Orndorff <git-user-email.h0ly5@simplelogin.com>

* Add `on-chain-release-build` feature for Collectives Westend (#2463)

Collectives Westend is missing an `on-chain-release-build` feature flag.

* CI: Disable runtime upgrade spec name check on Westend Asset Hub and fix Staking pallet migration (#2447)

Westend Asset Hub currently failing because the spec name is being
changed next runtime upgrade
(https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/4413125).

This also fixes an idempotency issue with a staking pallet migration.
Similar issues will be caught automatically now that we've also updated
to try-runtime-cli v0.5.0 which checks for idempotency issues.

This also enables try-state checks running in the CI.

* sp-api: Move macro related re-exports to `__private` (#2446)

This moves the macro related re-exports to `__private` to make it more
obvious for downstream users that they are using an internal api.

---------

Co-authored-by: command-bot <>

* Fix trait imports from sp-api (#2472)

Broken after #2446.

* Amend staking docs to account for state of controller deprecation (#2451)

Amends some staking pallet docs, and deprecation comment, to adjust to
the latest controller deprecation state.

Note, do we need the `README.md` file, which is a duplicate of the
pallet docs? Docs would be easier to maintain, and less ambiguity for
devs to refer to, if we had one source of truth in the generated pallet
docs.

* Make publish CI consistant and bump to v0.3.0 (#2453)

* pallet-xcm: ensure xcm outcome is always complete, revert effects otherwise (#2405)

On extrinsics/call, ensure local XCM execution is complete/successful.
Otherwise, fail the extrinsic so that state changes don't get committed
to the db.

Added regression tests that fail without the fix.

fixes #2237

---------

Co-authored-by: Adrian Catangiu <adrian@parity.io>

* pallet-staking: Converts all math operations to safe (#2435)

This PR converts unsafe math operations to safe in the staking pallet.
 
Closes https://github.com/paritytech/polkadot-sdk/issues/2431

---------

Co-authored-by: Ankan <10196091+Ank4n@users.noreply.github.com>

* Adapt test worker to profile flag (#2450)

closes #2194 

cc @mrcnski

---------

Co-authored-by: Bastian Köcher <git@kchr.de>

* Disable any peer connections for parachain nodes in pov-recovery zombienet test (#2475)

I noticed that this test broke at some point. The parachain nodes should
only acquire their blocks from the relay chain. But they were connecting
to their peers and started fetching blocks from there.

In this test I now take additional measures so we check that each nodes
really uses pov-recovery to get the blocks.

* Remove dmp-queue pallet from Rococo Asset Hub and Bridge Hub (#2483)

DMP queue migration is complete and the pallet should be removed to fix
the check runtime upgrade CI.

<img width="1501" alt="Screenshot 2023-11-24 at 16 05 37"
src="https://github.com/paritytech/polkadot-sdk/assets/16665596/ee1da6bb-2756-4423-8085-1e4c73553ad5">

<img width="1501" alt="Screenshot 2023-11-24 at 16 06 44"
src="https://github.com/paritytech/polkadot-sdk/assets/16665596/03f3e88f-aed8-4eaa-aab6-7998f72258be">

* relay-chain-consensus: set a fork_choice (#2462)

After #2001 the `fork_choice` strategy may remain uninitialized in the
block import pipeline which uses relay-chain verifier.
Refer to
https://github.com/paritytech/polkadot-sdk/pull/2430#issuecomment-1823979813
for some further discussion.

* Improve `UnpinHandleInner` debug (#2485)

Printing the `unpin_worker_sender` included the entire stacktrace and
that is a little bit too verbose.

* Derive `MaxEncodedLen` on `SlotDuration` (#2484)

# Description

Needed this in my code as part of the larger data structure.

---------

Co-authored-by: command-bot <>

* pallet-xcm: fix benchmarking (#2489)

Use non-zero weight limit in benchmarking `pallet_xcm::execute()` so the
given XCM actually executes.

* [NPoS] Use EraInfo to manipulate exposure in fast-unstake tests (#2459)

The FastUnstake pallet tests were previously directly modifying storage
items in the pallet-staking to alter exposure. However, due to the
introduction of the [new paged exposure
feature](https://github.com/paritytech/polkadot-sdk/pull/1189) these
tests were not testing against correct storage items. This issue
resulted in a bug that I didn't catch, which has been addressed in [this
fix](https://github.com/paritytech/polkadot-sdk/pull/2369).

This PR introduces a modification to how the pallet-fast-unstake handles
exposure. It now utilizes `pallet-staking::EraInfo` to set or mutate
Exposures.

* Remove `RuntimeApi` dependency on system parachain runtime code (#2455)

The last issue blocking the removal of the Polkadot and Kusama system
parachains from the repo in #1737 is the dependency on the runtime code
through the RuntimeApi in `polkadot-parachain`.

This PR introduces two fake runtimes to satisfy the build requirements
and changes the `new_partial` function to make it not be generic over
the runtimes.
The reason for the second runtime is the different Aura keys used in
Polkadot Asset Hub, as the impl for AuraApi depends on this type.
If this changes the `RuntimeApi` generic could be removed completely
from all functions in `services.rs` and and generic type parameters in
`services.rs` and specified as a concrete type to TFullClient`.

---------

Co-authored-by: Bastian Köcher <git@kchr.de>

* Add missing workspace members (#2491)

The following members have been added:

```pre
cumulus/parachains/integration-tests/emulated/chains/parachains/testing/penpal
cumulus/parachains/testnets-common
polkadot/node/tracking-allocator
substrate/frame/examples/frame-crate
```

CI check can be added after
https://github.com/paritytech/pipeline-scripts/pull/105 is merged.

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Bastian Köcher <git@kchr.de>

* bump zombienet version `v1.3.83` (#2492)

Include fix for `0002-parachains-upgrade-smoke-test` test.

* Do not pollute global base path with export genesis/wasm (#2487)

Otherwise the user may runs into weird errors if there is already a db.

* Zombienet: add polkadot-debug image publish as needs for cumulus tests (#2493)

Add `build-push-image-polkadot-debug` job to needs since we changed to
use the polkadot-debug image from the current branch for cumulus test
and we need to be sure that the image is ready. Fix issues like
https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/4481059

cc: @bkchr

Co-authored-by: Bastian Köcher <git@kchr.de>

* polkadot-parachain: one chain-spec for all (#2457)

This PR removes some `ChainSpec` types which are not necessary
(left-overs from #1256). Currently `ChainSpec` does not have to be
generic over the specific `RuntimeGenesisConfig`, it is enough to use
single type for all:

https://github.com/paritytech/polkadot-sdk/blob/9f787018857660440182142adc806954d7d07709/cumulus/polkadot-parachain/src/chain_spec/mod.rs#L53-L54


related to: https://github.com/paritytech/polkadot-sdk/issues/25

---------

Co-authored-by: command-bot <>

* Update documentation for SafeMode and TxPause Pallets (#2413)

# Description

Documentation for the TxPause and SafeMode pallets.

Based on reading and the notes from the following related PRs:
- https://github.com/paritytech/substrate/pull/12092

I believe this also completes the checklist to be able to close the
related PRs:
- Close #302 
- Close #274

---------

Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* PVF: remove audit log access (#2461)

* New runtime `spec_version` format + backport of the bump to 1.4.0 (#2468)

## Overview

This PR aligns the `spec_version` formatting to the [recent
changes](https://github.com/polkadot-fellows/runtimes/pull/26/files#diff-efa4caeb17487ecb13d8f5eb7863c3241d84afa2e73fbf25909a2ca89df0f362R142)
made for the Polkadot/Kusama runtimes.

It also backports the latest version `v1.4.0` bumps as `1_004_000`.

## Details

During the switch from `v0.9` to `v1.x`, the format of the
`spec_version` was modified from: `(M)m_ppp` for a runtime considered on
version `M.m.pp`. For instance `0.9.42` had a `spec_version` of `9420`.

With the transition to `v1.x`, the format was changed to a bigger number
(still `u32`) formatted as `MM_mm_ppp` where `1.2.3` would be stored as
`01_02_003`.

This PR aligns the format with that has been introduced in the
fellowship repo: `MMM_mmm_ppp`.

---------

Co-authored-by: Bastian Köcher <git@kchr.de>

* Zombienet tests - disputes on finalized blocks (#2184)

**Overview:**
Adding an extra malus variant focusing on disputing finalized blocks. It
will:
- wrap around approval-voting
- listen to `OverseerSignal::BlockFinalized` and when encountered start
a dispute for the `dispute_offset`th ancestor
- simply pass through all other messages and signals

Add zombienet tests testing various edgecases:
- disputing freshly finalized blocks
- disputing stale finalized blocks
- disputing eagerly pruned finalized blocks (might be separate PR)

**TODO:**
- [x] Register new malus variant
- [x] Simple pass through wrapper (approval-voting)
- [x] Simple network definition
- [x] Listen to block finalizations
- [x] Fetch ancestor hash
- [x] Fetch session index
- [x] Fetch candidate
- [x] Construct and send dispute message
- [x] zndsl test 1 checking that disputes on fresh finalizations resolve
valid Closes #1365
- [x] zndsl test 2 checking that disputes for too old finalized blocks
are not possible Closes #1364
- [ ] zndsl test 3 checking that disputes for candidates with eagerly
pruned relay parent state are handled correctly #1359 (deferred to a
separate PR)
- [x] Unit tests for new malus variant (testing cli etc)
- [x] Clean/streamline error handling
- [ ] ~~Ensure it tests properly on session boundaries~~

---------

Co-authored-by: Javier Viola <javier@parity.io>
Co-authored-by: Marcin S. <marcin@realemail.net>
Co-authored-by: Tsvetomir Dimitrov <tsvetomir@parity.io>

* Decomissioned PR-Custom-Review (#2503)

This PR decomissions
[`PR-Custom-Review`](https://github.com/paritytech/pr-custom-review) in
replacement for
[`Review-bot`](https://github.com/paritytech/review-bot).

* Build the standard library crates when building the runtimes (#2217)

Our executor currently only supports the WASM MVP feature set, however
nowadays when compiling WASM the Rust compiler has more features enabled
by default.

We do set the `-C target-cpu=mvp` flag to make sure that *our* code gets
compiled in a way that is compatible with our executor, however this
doesn't affect Rust's standard library crates (`std`, `core` and
`alloc`) which are by default precompiled and still can make use of
these extra features.

So in this PR we force the compiler to also compile the standard library
crates for us to make sure that they also only use the MVP features.

I've added the `WASM_BUILD_STD` environment variable which can be used
to disable this behavior if set to `0`.

Unfortunately this *will* slow down the compile times when building
runtimes, but there isn't much that we can do about that.

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

---------

Co-authored-by: Bastian Köcher <git@kchr.de>

* asset-hub-westend-integration-tests: add more asset transfers tests (#2488)

Just adds more tests.

* Remove the timestamp handler (#2506)

* Staking: `chill_other` takes stash instead of controller (#2501)

The `chill_other` call is the only staking call that explicitly requires
`controller` in its signature. This PR changes the controller arg to be
the stash instead, with `StakingLedger` then fetching the controller
from storage.

This is not a breaking change per se - the call types do not change, but
is noteworthy as UIs will now want to pass the stash account into
`chill_other` calls, & metadata will reflect this.

Note: This is very low impact. `chill_other` has [hardly ever been
used](https://polkadot.subscan.io/extrinsic?address=&module=staking&call=chill_other&result=all&signedChecked=signed%20only&startDate=&endDate=&startBlock=&timeType=date&version=9431&endBlock=)
on Polkadot - notwithstanding the one called 11 days ago at block
18177457 that was a part of test I did, the last call was made 493 days
ago. Only 2 calls have ever been successful.

Addresses controller deprecation #2500

---------

Co-authored-by: command-bot <>
Co-authored-by: Gonçalo Pestana <g6pestana@gmail.com>

* CI: Fix `build-and-attach-release-runtimes.yml` (#2471)

Incorporate suggestion from release team to get this workflow working.

edit: worked on this test GH release:
https://github.com/paritytech/polkadot-sdk/releases/tag/liam-debug-ghw.
let's try it.

* Fixes cumulus README instructions (#2442)

README instructions fixes to be compatible with the `polkadot-prepare`
and `polkadot-execute` binary split.

* Pools: Add ability to configure commission claiming permissions (#2474)

Addresses #409.

This request has been raised by multiple community members - the ability
for the nomination pool root role to configure permissionless commission
claiming:

> Would it be possible to have a claim_commission_other extrinsic for
claiming commission of nomination pools permissionless?

This PR does not quite introduce this additional call, but amends
`do_claim_commission` to check a new `claim_permission` field in the
`Commission` struct, configured by an enum:

```
enum CommissionClaimPermission {
   Permissionless,
   Account(AccountId),
}
```
This can be optionally set in a bonded pool's
`commission.claim_permission` field:

```
struct BondedPool {
   commission: {
      <snip>
      claim_permission: Option<CommissionClaimPermission<T::AccountId>>,
   },
   <snip>
}
```

This is a new field and requires a migration to add it to existing
pools. This will be `None` on pool creation, falling back to the `root`
role having sole access to claim commission if it is not set; this is
the behaviour as it is today. Once set, the field _can_ be set to `None`
again.

#### Changes
- [x] Add `commision.claim_permission` field.
- [x] Add `can_claim_commission` and amend `do_claim_commission`.
- [x] Add `set_commission_claim_permission` call.
- [x] Test to cover new configs and call.
- [x] Add and amend benchmarks.
- [x] Generate new weights + slot into call
`set_commission_claim_permission`.
- [x] Add migration to introduce `commission.claim_permission`, bump
storage version.
- [x] Update Westend weights.
- [x] Migration working.

---------

Co-authored-by: command-bot <>

* Added NetworkId::PolkadotBulletin variant (#2517)

We're going to bridge Polkadot Bridge Hub with [Polkadot Bulletin
chain](https://github.com/zdave-parity/polkadot-bulletin-chain) soon
(and Rococo Bridge Hub with 1:1 copy of Polkadot Bulletin chain even
sooner), so we need a variant for that chain in `NetworkId`. As
suggested, I'm adding a new variant for it to the `NetworkId` (we may
have used `ByGenesis(_)`, but decision was made to have a dedicated
variant for that).

* polkadot: disable block authoring backoff on production networks (#2510)

Currently the polkadot node will backoff from block authoring if
finality starts lagging. This PR disables this mechanism on production
networks (polkadot and kusama) and adds a flags to optionally force
enabling it.

* Set `frame_system::LastRuntimeUpgrade` after running `try-runtime` migrations (#2515)

Sets `frame_system::LastRuntimeUpgrade` after running try-runtime
migrations to better emulate real behavior.

This fixes an issue where migrations using the spec version to determine
whether to execute can incorrectly fail idempotency checks.

@s0me0ne-unkn0wn noticed this issue with the session key migration
introduced in https://github.com/paritytech/polkadot-sdk/pull/2265.

* Increase `cargo-check-each-crate-macos` timeout (#2519)

* Moves all test runtimes to use `derive_impl` (#2409)

Step in https://github.com/paritytech/polkadot-sdk/issues/171

This PR adds `derive_impl` on all `frame_system` config impls for mock
runtimes. The overridden configs are maintained as of now to ensure
minimal changes.

---------

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* PVF: Add test instructions (#2058)

* Remove `wasm-builder`'s README (#2525)

Followup of https://github.com/paritytech/polkadot-sdk/pull/2217

This PR deletes the README of the `wasm-builder` crate and moves its
docs back into the rustdoc, [as requested
here](https://github.com/paritytech/polkadot-sdk/pull/2217#discussion_r1406401175).
(:

* Remove `im-online` pallet from Rococo and Westend (#2265)

Co-authored-by: ordian <write@reusable.software>
Co-authored-by: Vladimir Istyufeev <vladimir@parity.io>

* polkadot: remove grandpa pause support (#2511)

This was never used and we probably don't need it anyway.

* Remove pov-recovery race condition/Improve zombienet test (#2526)

The test was a bit flaky on CI. 

There was a race condition in the pov-recovery system. If the timing is
bad, it can happen that a block waits for a parent that is already
queued for import. The check if a block has children waiting happens
when we insert into the import queue. So we need to do an additional
check once we receive the import notification for the parent block.

Second issue is that `alice` was missing `--in-peers 0` and `--out-peers
0`, so alice was sometimes still fetching block via sync and the
assertion on the logs in zombienet would fail.

There is another potential issue that I saw once locally. We have a
failing pov-recovery queue that fails from time to time to check that
the retry mechanism does what it should. We now make sure that the same
candidate is never failed twice, so the tests become more predictable.

* Rework the event system of `sc-network` (#1370)

This commit introduces a new concept called `NotificationService` which
allows Polkadot protocols to communicate with the underlying
notification protocol implementation directly, without routing events
through `NetworkWorker`. This implies that each protocol has its own
service which it uses to communicate with remote peers and that each
`NotificationService` is unique with respect to the underlying
notification protocol, meaning `NotificationService` for the transaction
protocol can only be used to send and receive transaction-related
notifications.

The `NotificationService` concept introduces two additional benefits:
  * allow protocols to start using custom handshakes
  * allow protocols to accept/reject inbound peers

Previously the validation of inbound connections was solely the
responsibility of `ProtocolController`. This caused issues with light
peers and `SyncingEngine` as `ProtocolController` would accept more
peers than `SyncingEngine` could accept which caused peers to have
differing views of their own states. `SyncingEngine` would reject excess
peers but these rejections were not properly communicated to those peers
causing them to assume that they were accepted.

With `NotificationService`, the local handshake is not sent to remote
peer if peer is rejected which allows it to detect that it was rejected.

This commit also deprecates the use of `NetworkEventStream` for all
notification-related events and going forward only DHT events are
provided through `NetworkEventStream`. If protocols wish to follow each
other's events, they must introduce additional abtractions, as is done
for GRANDPA and transactions protocols by following the syncing protocol
through `SyncEventStream`.

Fixes https://github.com/paritytech/polkadot-sdk/issues/512
Fixes https://github.com/paritytech/polkadot-sdk/issues/514
Fixes https://github.com/paritytech/polkadot-sdk/issues/515
Fixes https://github.com/paritytech/polkadot-sdk/issues/554
Fixes https://github.com/paritytech/polkadot-sdk/issues/556

---
These changes are transferred from
https://github.com/paritytech/substrate/pull/14197 but there are no
functional changes compared to that PR

---------

Co-authored-by: Dmitry Markin <dmitry@markin.tech>
Co-authored-by: Alexandru Vasile <60601340+lexnv@users.noreply.github.com>

* [ci] Run gitspiegel trigger with merge conflicts (#2531)

Currently gitspiegel trigger won't run if there is merge conflict. This
PR fixes it.

close https://github.com/paritytech/gitspiegel/issues/183

* Remove long deprecated `AllPalletsWithoutSystemReversed` (#2509)

Remove deprecated `AllPalletsXY` types.

They have been deprecated for nearly 1.5 years now, I think its fine to
remove them.
If anyone feels like we should first put a date on the deprecation as
stated in the deprecation guideline, feel free to speak up. To me it
looks like this has been forgotten and can be directly removed.

* Remove `dmp_queue` pallet from Westend SP runtimes  (#2516)

Westend SP dmp queue pallet removal is complete.

<img width="1499" alt="Screenshot 2023-11-28 at 08 31 27"
src="https://github.com/paritytech/polkadot-sdk/assets/16665596/906246fb-3de9-4133-a827-431636a097ad">

<img width="1499" alt="Screenshot 2023-11-28 at 08 32 08"
src="https://github.com/paritytech/polkadot-sdk/assets/16665596/bde84891-b044-42c7-9a0b-59125cd24db1">

<img width="1499" alt="Screenshot 2023-11-28 at 08 31 45"
src="https://github.com/paritytech/polkadot-sdk/assets/16665596/38337484-0856-45c0-b9ff-8c785bc3c0e3">

* Enable parallel key scraping (#1985)

closes #174

---------

Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* substrate-node: `NativeElseWasmExecutor` is no longer used (#2521)

This PR removes `NativeElseWasmExecutor` usage from substrate node.
Instead [`WasmExecutor<(sp_io::SubstrateHostFunctions,
sp_statement_store::runtime_api::HostFunctions)>`](https://github.com/paritytech/polkadot-sdk/blob/49a41ab3bb3f630c20e5b24cec8d92382404631c/substrate/bin/node/executor/src/lib.rs#L26)
is used.

Related to #2358.

---------

Co-authored-by: Davide Galassi <davxy@datawok.net>

* Remove system parachains Polkadot and Kusama runtimes (#1737)

Since the Polkadot and Kusama runtimes are no longer in the repo, the
relevant systems parachains runtimes also need to be removed. More
context [here](https://github.com/paritytech/polkadot-sdk/issues/603)
and [here](https://github.com/paritytech/polkadot-sdk/pull/1731).

Removes the following:
- `asset-hub-kusama` and `asset-hub-polkadot`
- `bridge-hub-kusama` and `bridge-hub-polkadot`
- `collectives-polkadot`
- `glutton-kusama`

Partially solves #603 and adds to #1731.

* Improve `CodeExecutor` (#2358)

Since `sp-state-machine` and `GenesisConfigBuilderRuntimeCaller` always
set `use_native` to be false.
We should remove this param and make `NativeElseWasmExecutor` behave
like its name.
It could make the above components use the correct execution strategy.

Maybe polkadot do not need about `NativeElseWasmExecutor` anymore. But
it is still needed by other chains and it's useful for debugging.

---------

Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: command-bot <>
Co-authored-by: Michal Kucharczyk <1728078+michalkucharczyk@users.noreply.github.com>

* add Rotko common good parachain nodes (#2533)

rotko networks parachain bootnodes 
```
# array of commands for testing
parachains=(
  "./polkadot-parachain --chain asset-hub-polkadot --reserved-only --reserved-nodes /dns/mint14.rotko.net/tcp/33514/p2p/12D3KooWKkzLjYF6M5eEs7nYiqEtRqY8SGVouoCwo3nCWsRnThDW --no-hardware-benchmarks"
  "./polkadot-parachain --chain asset-hub-polkadot --reserved-only --reserved-nodes /dns/mint14.rotko.net/tcp/34514/ws/p2p/12D3KooWKkzLjYF6M5eEs7nYiqEtRqY8SGVouoCwo3nCWsRnThDW --no-hardware-benchmarks"
  "./polkadot-parachain --chain asset-hub-polkadot --reserved-only --reserved-nodes /dns/mint14.rotko.net/tcp/35514/wss/p2p/12D3KooWKkzLjYF6M5eEs7nYiqEtRqY8SGVouoCwo3nCWsRnThDW --no-hardware-benchmarks"
  "./polkadot-parachain --chain asset-hub-kusama --reserved-only --reserved-nodes /dns/mine14.rotko.net/tcp/33524/p2p/12D3KooWJUFnjR2PNbsJhudwPVaWCoZy1acPGKjM2cSuGj345BBu --no-hardware-benchmarks"
  "./polkadot-parachain --chain asset-hub-kusama --reserved-only --reserved-nodes /dns/mine14.rotko.net/tcp/34524/ws/p2p/12D3KooWJUFnjR2PNbsJhudwPVaWCoZy1acPGKjM2cSuGj345BBu --no-hardware-benchmarks"
  "./polkadot-parachain --chain asset-hub-kusama --reserved-only --reserved-nodes /dns/mine14.rotko.net/tcp/35524/wss/p2p/12D3KooWJUFnjR2PNbsJhudwPVaWCoZy1acPGKjM2cSuGj345BBu --no-hardware-benchmarks"
  "./polkadot-parachain --chain asset-hub-westend --reserved-only --reserved-nodes /dns/wmint14.rotko.net/tcp/33534/p2p/12D3KooWE4UDXqgtTcMCyUQ8S4uvaT8VMzzTBA6NWmKuYwTacWuN --no-hardware-benchmarks"
  "./polkadot-parachain --chain asset-hub-westend --reserved-only --reserved-nodes /dns/wmint14.rotko.net/tcp/34534/ws/p2p/12D3KooWE4UDXqgtTcMCyUQ8S4uvaT8VMzzTBA6NWmKuYwTacWuN --no-hardware-benchmarks"
  "./polkadot-parachain --chain asset-hub-westend --reserved-only --reserved-nodes /dns/wmint14.rotko.net/tcp/35534/wss/p2p/12D3KooWE4UDXqgtTcMCyUQ8S4uvaT8VMzzTBA6NWmKuYwTacWuN --no-hardware-benchmarks"
  "./polkadot-parachain --chain bridge-hub-polkadot --reserved-only --reserved-nodes /dns/pbr13.rotko.net/tcp/33543/p2p/12D3KooWMxZY7tDc2Rh454VaJJ7RexKAXVS6xSBEvTnXSGCnuGDw --no-hardware-benchmarks"
  "./polkadot-parachain --chain bridge-hub-polkadot --reserved-only --reserved-nodes /dns/pbr13.rotko.net/tcp/34543/ws/p2p/12D3KooWMxZY7tDc2Rh454VaJJ7RexKAXVS6xSBEvTnXSGCnuGDw --no-hardware-benchmarks"
  "./polkadot-parachain --chain bridge-hub-polkadot --reserved-only --reserved-nodes /dns/pbr13.rotko.net/tcp/35543/wss/p2p/12D3KooWMxZY7tDc2Rh454VaJJ7RexKAXVS6xSBEvTnXSGCnuGDw --no-hardware-benchmarks"
  "./polkadot-parachain --chain bridge-hub-kusama --reserved-only --reserved-nodes /dns/kbr13.rotko.net/tcp/33553/p2p/12D3KooWAmBp54mUEYtvsk2kxNEsDbAvdUMcaghxKXgUQxmPEQ66 --no-hardware-benchmarks"
  "./polkadot-parachain --chain bridge-hub-kusama --reserved-only --reserved-nodes /dns/kbr13.rotko.net/tcp/34553/ws/p2p/12D3KooWAmBp54mUEYtvsk2kxNEsDbAvdUMcaghxKXgUQxmPEQ66 --no-hardware-benchmarks"
  "./polkadot-parachain --chain bridge-hub-kusama --reserved-only --reserved-nodes /dns/kbr13.rotko.net/tcp/35553/wss/p2p/12D3KooWAmBp54mUEYtvsk2kxNEsDbAvdUMcaghxKXgUQxmPEQ66 --no-hardware-benchmarks"
  "./polkadot-parachain --chain bridge-hub-westend --reserved-only --reserved-nodes /dns/wbr13.rotko.net/tcp/33563/p2p/12D3KooWJyeRHpxZZbfBCNEgeUFzmRC5AMSAs2tJhjJS1k5hULkD --no-hardware-benchmarks"
  "./polkadot-parachain --chain bridge-hub-westend --reserved-only --reserved-nodes /dns/wbr13.rotko.net/tcp/34563/ws/p2p/12D3KooWJyeRHpxZZbfBCNEgeUFzmRC5AMSAs2tJhjJS1k5hULkD --no-hardware-benchmarks"
  "./polkadot-parachain --chain bridge-hub-westend --reserved-only --reserved-nodes /dns/wbr13.rotko.net/tcp/35563/wss/p2p/12D3KooWJyeRHpxZZbfBCNEgeUFzmRC5AMSAs2tJhjJS1k5hULkD --no-hardware-benchmarks"
  "./polkadot-parachain --chain collectives-polkadot --reserved-only --reserved-nodes /dns/pch13.rotko.net/tcp/33573/wss/p2p/12D3KooWRXudHoazPZ9osMfdY38e8CBxQLD4RhrVeHpRSNNpcDtH --no-hardware-benchmarks"
  "./polkadot-parachain --chain collectives-polkadot --reserved-only --reserved-nodes /dns/pch13.rotko.net/tcp/34573/wss/p2p/12D3KooWRXudHoazPZ9osMfdY38e8CBxQLD4RhrVeHpRSNNpcDtH --no-hardware-benchmarks"
  "./polkadot-parachain --chain collectives-polkadot --reserved-only --reserved-nodes /dns/pch13.rotko.net/tcp/35573/wss/p2p/12D3KooWRXudHoazPZ9osMfdY38e8CBxQLD4RhrVeHpRSNNpcDtH --no-hardware-benchmarks"
  "./polkadot-parachain --chain collectives-westend --reserved-only --reserved-nodes /dns/wch13.rotko.net/tcp/33593/p2p/12D3KooWPG85zhuSRoyptjLkFD4iJFistjiBmc15JgQ96B4fdXYr --no-hardware-benchmarks"
  "./polkadot-parachain --chain collectives-westend --reserved-only --reserved-nodes /dns/wch13.rotko.net/tcp/34593/ws/p2p/12D3KooWPG85zhuSRoyptjLkFD4iJFistjiBmc15JgQ96B4fdXYr --no-hardware-benchmarks"
  "./polkadot-parachain --chain collectives-westend --reserved-only --reserved-nodes /dns/wch13.rotko.net/tcp/35593/wss/p2p/12D3KooWPG85zhuSRoyptjLkFD4iJFistjiBmc15JgQ96B4fdXYr --no-hardware-benchmarks"
)
```

* Bump fs4 from 0.6.6 to 0.7.0 (#1844)

* ParachainHost: No need to be generic over the block or hash type (#2537)

The `BlockNumber` and `Hash` are fixed types any way.

* Adding LuckyFriday's Bootnodes per IBP Application (#2538)

Good day,

This PR requests the inclusion of two bootnode entries for Polkadot,
Kusama and Westend as part of LuckyFriday's IBP application. The nodes
are hosted on self-owned hardware in a co-located facility. We've
undertaken connectivity tests ourselves and also from members of the
IBP.

The test commands used are as follows:

```
polkadot --chain westend --base-path /tmp/node --name "Boot" --reserved-only --reserved-nodes "/dns/ibp-boot-westend.luckyfriday.io/tcp/30334/wss/p2p/12D3KooWDg1YEytdwFFNWroFj6gio4YFsMB3miSbHKgdpJteUMB9" --no-hardware-benchmarks

polkadot --chain westend --base-path /tmp/node --name "Boot" --reserved-only --reserved-nodes "/dns/ibp-boot-westend.luckyfriday.io/tcp/30333/p2p/12D3KooWDg1YEytdwFFNWroFj6gio4YFsMB3miSbHKgdpJteUMB9" --no-hardware-benchmarks

polkadot --chain kusama --base-path /tmp/node --name "Boot" --reserved-only --reserved-nodes "/dns/ibp-boot-kusama.luckyfriday.io/tcp/30334/wss/p2p/12D3KooW9vu1GWHBuxyhm7rZgD3fhGZpNajPXFexadvhujWMgwfT" --no-hardware-benchmarks

polkadot --chain kusama --base-path /tmp/node --name "Boot" --reserved-only --reserved-nodes "/dns/ibp-boot-kusama.luckyfriday.io/tcp/30333/p2p/12D3KooW9vu1GWHBuxyhm7rZgD3fhGZpNajPXFexadvhujWMgwfT" --no-hardware-benchmarks

polkadot --chain polkadot --base-path /tmp/node --name "Boot" --reserved-only --reserved-nodes "/dns/ibp-boot-polkadot.luckyfriday.io/tcp/30334/wss/p2p/12D3KooWEjk6QXrZJ26fLpaajisJGHiz6WiQsR8k7mkM9GmWKnRZ" --no-hardware-benchmarks

polkadot --chain polkadot --base-path /tmp/node --name "Boot" --reserved-only --reserved-nodes "/dns/ibp-boot-polkadot.luckyfriday.io/tcp/30333/p2p/12D3KooWEjk6QXrZJ26fLpaajisJGHiz6WiQsR8k7mkM9GmWKnRZ" --no-hardware-benchmarks
```

All tests yielded syncing with 1 peer, a positive result. We have also
backed up our node-key in the event that restoration is required.

I hope that the aforementioned meets the requirement for inclusion and
look forward to a speedy turnaround.

Kind Regards,
Will | Paradox

* sp-api: Sprinkle some `automatically_derived` attributes

This attribute is informing tooling that the code is automatically
derived and thus, should not enable any linting.

* Disable trace-level logging from the `test-linux-stable-int` (#2546)

* chainHead: Backport error codes from spec (#2539)

This PR backports the error codes from the spec.

This relies on two specs for defining the error codes:
- Our rpc-spec-v2 https://github.com/paritytech/json-rpc-interface-spec.
- JSON-RPC spec https://www.jsonrpc.org/specification#error_object.

To better describe the error codes, they are divided into two separate
modules `rpc_spec_v2` and `json_rpc_spec` respectively.

The `InvalidSubscriptionID` and `FetchBlockHeader` are merged into the
JSON-RPC spec `INTERNAL_ERROR`.
While the other error codes are adjusted from spec.

Errors that are currently in use:
- -32801 block hash not reported by chainHead_follow or block hash has
been unpinned
- -32802 chainHead_follow started with withRuntime == false
- -32803 chainHead_follow did not generate an
operationWaitingForContinue event

The following are errors defined in the [JSON-RPC
spec](https://www.jsonrpc.org/specification#error_object):
- -32602 The provided parameter isn't one of the expected values, has
different format or is missing
- -32603 Internal server error

Note: Error `-32801` must be introduced and generated by the outstanding
https://github.com/paritytech/polkadot-sdk/issues/1505

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

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* state-db: log_target usage fixed (#2547)

Use `LOG_TARGET/LOG_TARGET_PIN` in logs.

* Parachain Template: Prune `AuxStore` bound and corresponding crate dependency (#2303)

This small PR removes an unnecessary trait bound to the `AuxStore` trait
from the Parachain template's `rpc.rs` file.

With that bound removed, the entire dependency on `sc-client-api` can
also be removed.

---------

Co-authored-by: Joshy Orndorff <git-user-email.h0ly5@simplelogin.com>
Co-authored-by: Bastian Köcher <git@kchr.de>

* Contracts: use compiled rust tests (#2347)

see #2189

This PR does the following:
- Bring the user api functions into a new pallet-contracts-uapi (They
are currently defined in ink!
[here])(https://github.com/paritytech/ink/blob/master/crates/env/src/engine/on_chain/ext.rs)
- Add older api versions and unstable to the user api trait.
- Remove pallet-contracts-primitives and bring the types it defined in
uapi / pallet-contracts
- Add the infrastructure to build fixtures from Rust files and test it
works by replacing `dummy.wat` and `call.wat`
- Move all the doc from wasm/runtime.rs to pallet-contracts-uapi.

This will be done in a follow up:
- convert the rest of the test from .wat to rust
- bring risc-v uapi up to date with wasm
- finalize the uapi host fns, making sure everything is codegen from the
source host fns in pallet-contracts

---------

Co-authored-by: Alexander Theißen <alex.theissen@me.com>

* upgraded review bot to 2.3.0 (#2549)

Upgraded to version 2.3.0 which includes:
- paritytech/review-bot#103
- paritytech/review-bot#102

* Register metrics for the notification handles (#2562)

Add metrics for notification handles so substream events are correctly
reported to Prometheus

* Introduce Polkadot-Sdk `developer_hub`  (#2102)

This PR introduces the new crate `developer_hub` into the polkadot-sdk
repo. The vision for the developer-hub crate is detailed in [this
document](https://docs.google.com/document/d/1XLLkFNE8v8HLvZpI2rzsa8N2IN1FcKntc8q-Sc4xBAk/edit?usp=sharing).

<img width="1128" alt="Screenshot 2023-11-02 at 10 45 48"
src="https://github.com/paritytech/polkadot-sdk/assets/5588131/1e12b60f-fef5-42c4-8503-a3ba234077c3">


Other than adding the new crate, it also does the following: 

* Remove the `substrate` crate, as there is now a unique umbrella crate
for multiple things in `developer_hub::polkadot_sdk`.
* (backport candidate) A minor change to `frame-support` macros that
allows `T::RuntimeOrigin` to also be acceptable as the origin type.
* (backport candidate) A minor change to `frame-system` that allows us
to deposit events at genesis because now the real genesis config is
generated via wasm, and we can safely assume `cfg!(feature = "std")`
means only testing. related to #62.
* (backport candidate) Introduces a small `read_events_for_pallet` to
`frame_system` for easier event reading in tests.
* From https://github.com/paritytech/polkadot-sdk-docs/issues/31, it
takes action on improving the `pallet::call` docs.
* From https://github.com/paritytech/polkadot-sdk-docs/issues/31, it
takes action on improving the `UncheckedExtrinsic` docs.

## Way Forward

First, a version of this is deployed temporarily
[here](https://blog.kianenigma.nl/polkadot-sdk/developer_hub/index.html).
I will keep it up to date on a daily basis.

### This Pull Request

I see two ways forward: 

1. We acknowledge that everything in `developer-hub` is going to be WIP,
and merge this asap. We should not yet use links to this crate anywhere.
2. We make this be the feature branch, make PRs against this, and either
gradually backport it, or only merge to master once it is done.

I am personally in favor of option 1. If we stick to option 2, we need a
better way to deploy a staging version of this to gh-pages.

### Issue Tracking

The main issues related to the future of `developer_hub` are: 

- https://github.com/paritytech/polkadot-sdk-docs/issues/31
- https://github.com/paritytech/polkadot-sdk-docs/issues/4
- https://github.com/paritytech/polkadot-sdk-docs/issues/26 
- https://github.com/paritytech/polkadot-sdk-docs/issues/32
- https://github.com/paritytech/polkadot-sdk-docs/issues/36


### After This Pull Request

- [ ] create a redirect for
https://paritytech.github.io/polkadot-sdk/master/substrate/
- [x] analy…
@Polkadot-Forum
Copy link

This pull request has been mentioned on Polkadot Forum. There might be relevant details there:

https://forum.polkadot.network/t/polkadot-release-analysis-v1-4-0/5152/1

bkontur added a commit to bkontur/runtimes that referenced this pull request Jan 10, 2024
bkontur added a commit to bkontur/runtimes that referenced this pull request Jan 10, 2024
bkontur added a commit to bkontur/runtimes that referenced this pull request Jan 10, 2024
girazoki pushed a commit to moondance-labs/polkadot-sdk that referenced this pull request Jan 11, 2024
…ves (paritytech#1672)

`pallet-xcm` is the main user-facing interface for XCM functionality,
including assets manipulation functions like `teleportAssets()` and
`reserve_transfer_assets()` calls.

While `teleportAsset()` works both ways, `reserve_transfer_assets()`
works only for sending reserve-based assets to a remote destination and
beneficiary when the reserve is the _local chain_.

This PR enhances `pallet_xcm::(limited_)reserve_withdraw_assets` to
support transfers when reserves are other chains.
This will allow complete, **bi-directional** reserve-based asset
transfers user stories using `pallet-xcm`.

Enables following scenarios:
- transferring assets with local reserve (was previously supported iff
asset used as fee also had local reserve - now it works in all cases),
- transferring assets with reserve on destination,
- transferring assets with reserve on remote/third-party chain (iff
assets and fees have same remote reserve),
- transferring assets with reserve different than the reserve of the
asset to be used as fees - meaning can be used to transfer random asset
with local/dest reserve while using DOT for fees on all involved chains,
even if DOT local/dest reserve doesn't match asset reserve,
- transferring assets with any type of local/dest reserve while using
fees which can be teleported between involved chains.

All of the above is done by pallet inner logic without the user having
to specify which scenario/reserves/teleports/etc. The correct scenario
and corresponding XCM programs are identified, and respectively, built
automatically based on runtime configuration of trusted teleporters and
trusted reserves.

- while `fees` and "non-fee" `assets` CAN have different reserves (or
fees CAN be teleported), the remaining "non-fee" `assets` CANNOT, among
themselves, have different reserve locations (this is also implicitly
enforced by `MAX_ASSETS_FOR_TRANSFER=2`, but this can be safely
increased in the future).
- `fees` and "non-fee" `assets` CANNOT have **different remote**
reserves (this could also be supported in the future, but adds even more
complexity while possibly not being worth it - we'll see what the future
holds).

Fixes paritytech#1584
Fixes paritytech#2055

---------

Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
Co-authored-by: Branislav Kontur <bkontur@gmail.com>
bkontur added a commit to bkontur/runtimes that referenced this pull request Jan 11, 2024
Agusrodri pushed a commit to moonbeam-foundation/polkadot-sdk that referenced this pull request Jan 11, 2024
…ves (paritytech#1672)

`pallet-xcm` is the main user-facing interface for XCM functionality,
including assets manipulation functions like `teleportAssets()` and
`reserve_transfer_assets()` calls.

While `teleportAsset()` works both ways, `reserve_transfer_assets()`
works only for sending reserve-based assets to a remote destination and
beneficiary when the reserve is the _local chain_.

This PR enhances `pallet_xcm::(limited_)reserve_withdraw_assets` to
support transfers when reserves are other chains.
This will allow complete, **bi-directional** reserve-based asset
transfers user stories using `pallet-xcm`.

Enables following scenarios:
- transferring assets with local reserve (was previously supported iff
asset used as fee also had local reserve - now it works in all cases),
- transferring assets with reserve on destination,
- transferring assets with reserve on remote/third-party chain (iff
assets and fees have same remote reserve),
- transferring assets with reserve different than the reserve of the
asset to be used as fees - meaning can be used to transfer random asset
with local/dest reserve while using DOT for fees on all involved chains,
even if DOT local/dest reserve doesn't match asset reserve,
- transferring assets with any type of local/dest reserve while using
fees which can be teleported between involved chains.

All of the above is done by pallet inner logic without the user having
to specify which scenario/reserves/teleports/etc. The correct scenario
and corresponding XCM programs are identified, and respectively, built
automatically based on runtime configuration of trusted teleporters and
trusted reserves.

- while `fees` and "non-fee" `assets` CAN have different reserves (or
fees CAN be teleported), the remaining "non-fee" `assets` CANNOT, among
themselves, have different reserve locations (this is also implicitly
enforced by `MAX_ASSETS_FOR_TRANSFER=2`, but this can be safely
increased in the future).
- `fees` and "non-fee" `assets` CANNOT have **different remote**
reserves (this could also be supported in the future, but adds even more
complexity while possibly not being worth it - we'll see what the future
holds).

Fixes paritytech#1584
Fixes paritytech#2055

---------

Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
Co-authored-by: Branislav Kontur <bkontur@gmail.com>
bkontur added a commit to bkontur/runtimes that referenced this pull request Jan 12, 2024
bkontur added a commit to bkontur/runtimes that referenced this pull request Jan 12, 2024
bkontur added a commit to bkontur/runtimes that referenced this pull request Jan 22, 2024
bkontur added a commit to bkontur/runtimes that referenced this pull request Jan 23, 2024
claravanstaden pushed a commit to Snowfork/runtimes that referenced this pull request Feb 5, 2024
AurevoirXavier added a commit to darwinia-network/darwinia that referenced this pull request Jun 21, 2024
@acatangiu acatangiu deleted the pallet-xcm-fully-support-reserve-transfers branch June 25, 2024 14:15
AurevoirXavier added a commit to darwinia-network/darwinia that referenced this pull request Jun 28, 2024
* Setup deps

* Remove Koi from account migration test

* paritytech/polkadot-sdk#1495

* Bump

* paritytech/polkadot-sdk#1524

* !! paritytech/polkadot-sdk#1363

* paritytech/polkadot-sdk#1492

* paritytech/polkadot-sdk#1911

* paritytech/polkadot-sdk#1900

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* paritytech/polkadot-sdk#1661

* paritytech/polkadot-sdk#2144

* paritytech/polkadot-sdk#2048

* paritytech/polkadot-sdk#1672

* paritytech/polkadot-sdk#2303

* paritytech/polkadot-sdk#1256

* Remove identity and vesting

* Fixes

* paritytech/polkadot-sdk#2657

* paritytech/polkadot-sdk#1313

* paritytech/polkadot-sdk#2331

* paritytech/polkadot-sdk#2409 part.1

* paritytech/polkadot-sdk#2767

* paritytech/polkadot-sdk#2521

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* paritytech/polkadot-sdk#1222

* paritytech/polkadot-sdk#1234 part.1

* Satisfy compiler

* XCM V4 part.1

* paritytech/polkadot-sdk#1246

* Remove pallet-democracy part.1

* paritytech/polkadot-sdk#2142

* paritytech/polkadot-sdk#2428

* paritytech/polkadot-sdk#3228

* XCM V4 part.2

* Bump

* Build all runtimes

* Build node

* Remove pallet-democracy

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Format

* Fix pallet tests

* Fix precompile tests

* Format

* Fixes

* Async, remove council, common pallet config

* Fix `ethtx-forward` test case (#1519)

* Fix ethtx-forward tests

* Format

* Fix following the review

* Fixes

* Fixes

* Use default impl

* Benchmark helper

* Bench part.1

* Bench part.2

* Bench part.3

* Fix all tests

* Typo

* Feat

* Fix EVM tracing build

* Reuse upstream `proof_size_base_cost()` (#1521)

* Format issue

* Fixes

* Fix CI

---------

Signed-off-by: Xavier Lau <xavier@inv.cafe>
Co-authored-by: Bear Wang <boundless.forest@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T2-pallets This PR/Issue is related to a particular pallet. T6-XCM This PR/Issue is related to XCM.
Projects
Status: Audited
10 participants