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

Update to latest SDK #4

Merged
merged 82 commits into from
Nov 7, 2024
Merged

Conversation

dudo50
Copy link

@dudo50 dudo50 commented Nov 7, 2024

This PR updates to latest SDK

alindima and others added 30 commits October 28, 2024 11:34
Resolves #5970

Removes the code of the legacy parachains assigner, which was used prior
to coretime. Now that all networks are upgraded to use the coretime
assigner, we can remove it.
Redo of #5953

---------

Co-authored-by: Alexander Theißen <[email protected]>
Co-authored-by: GitHub Action <[email protected]>
Update typeinfo impl to make it transparent for subxt

see paritytech/subxt#1845

---------

Co-authored-by: GitHub Action <[email protected]>
This will reduce the call stack depth in order to raise the allowed code
size. Should allow around 100KB of instructions. This is necessary to
stay within the memory envelope. More code size is more appropriate for
testing right now. We will re-evaluate parameters once we have 64bit
support.

---------

Co-authored-by: GitHub Action <[email protected]>
Implement a syscall to retreive the transaction origin.

---------

Signed-off-by: Cyrill Leutwiler <[email protected]>
Signed-off-by: xermicus <[email protected]>
Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: command-bot <>
Co-authored-by: Alexander Theißen <[email protected]>
A step towards #4782

In order to nail down the right preludes in `polkadot-sdk-frame`, we
need to migrate a number of pallets to be written with it. Moreover,
migrating our pallets to this simpler patter will encourage the
ecosystem to also follow along.

If this PR is approved and has no unwanted negative consequences, I will
make a tracking issue to migrate all pallets to this umbrella crate.

TODO: 

- [x] fix frame benchmarking template. Can we detect the umbrella crate
in there and have an `if else`? cc @ggwpez
- [x] Migrate benchmarking to v2 @re-gius a good candidate for you, you
can open a PR against my branch.
- [x] tracking issue with follow-ups

---------

Co-authored-by: Guillaume Thiolliere <[email protected]>
Co-authored-by: Giuseppe Re <[email protected]>
Co-authored-by: Dónal Murray <[email protected]>
Co-authored-by: Shawn Tabrizi <[email protected]>
Co-authored-by: Oliver Tale-Yazdi <[email protected]>
Part of:

- #6202

---------

Co-authored-by: Dónal Murray <[email protected]>
This PR refactors `pallet-identity` to decouple usernames from
identities.

Main changes in this PR:
- Separate usernames from identities in storage, allowing for correct
deposit accounting
- Introduce the option for username authorities to put up a deposit to
issue a username
- Allow authorities to remove usernames by declaring the intent to do
so, then removing the username after the grace period expires
- Refactor the authority storage to be keyed by suffix rather than owner
account.
- Introduce the concept of a system provider for a username, different
from a governance allocation, allowing for usernames set by the system
and not a specific authority
- Implement multi-block migration to enable all of the changes described
above

---------

Signed-off-by: georgepisaltu <[email protected]>
Co-authored-by: Ankan <[email protected]>
This removes the need to use a custom toolchain to build the contract
test fixtures. Instead, we supply a custom target and use the currently
in use upstream toolchain.

---------

Co-authored-by: Jan Bujak <[email protected]>
Co-authored-by: Cyrill Leutwiler <[email protected]>
Co-authored-by: command-bot <>
Co-authored-by: Shawn Tabrizi <[email protected]>
# Description

This PR moves the `pallet-grandpa` to the `v2` of `frame_benchmarking`.
I submitted PR #6025 as an external contributor from my own fork, so I
made this one from within this repo to see how the process would change.

## Integration

N/A

## Review Notes

Same as #6025, straightforward.

---------

Co-authored-by: Shawn Tabrizi <[email protected]>
Add a docker for pallet-revive eth-rpc

 Tested with 
```
sudo docker build . -t eth-rpc -f substrate/frame/revive/rpc/Dockerfile
sudo docker run --network="host" -e RUST_LOG="info,eth-rpc=debug" eth-rpc
```

---------

Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Alexander Theißen <[email protected]>
polkadot/zombienet_tests/smoke/0004-coretime-smoke-test.zndsl still
timeouts on CI from time to time. Bumping the timeout a bit more.

Related to #6226

---------

Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Oliver Tale-Yazdi <[email protected]>
Part of:

- #6202.

---------

Co-authored-by: Dónal Murray <[email protected]>
# Benchmark Overhead Command for Parachains

This implements the `benchmark overhead` command for parachains. Full
context is available at:
#5303. Previous attempt
was this #5283, but here
we have integration into frame-omni-bencher and improved tooling.

## Changes Overview

Users are now able to use `frame-omni-bencher` to generate
`extrinsic_weight.rs` and `block_weight.rs` files for their runtime. The
core logic for generating these remains untouched; this PR provides
mostly machinery to make it work for parachains at all.

Similar to the pallet benchmarks, we gain the option to benchmark based
on just a runtime:

```
frame-omni-bencher v1 benchmark overhead --runtime {{runtime}}
```

or with a spec:

```
frame-omni-bencher v1 benchmark overhead --chain {{spec}} --genesis-builder spec
```

In this case, the genesis state is generated from the runtime presets.
However, it is also possible to use `--chain` and genesis builder `spec`
to generate the genesis state from the chain spec.

Additionally, we use metadata to perform some checks based on the
pallets the runtime exposes:

- If we see the `ParaInherent` pallet, we assume that we are dealing
with a relay chain. This means that we don't need proof recording during
import (since there is no storage weight).
- If we detect the `ParachainSystem` pallet, we assume that we are
dealing with a parachain and take corresponding actions like patching a
para id into the genesis state.

On the inherent side, I am currently supplying the standard inherents
every parachain needs.

In the current state, `frame-omni-bencher` supports all system chains.
In follow-up PRs, we could add additional inherents to increase
compatibility.

Since we are building a block during the benchmark, we also need to
build an extrinsic. By default, I am leveraging subxt to build the xt
dynamically. If a chain is not compatible with the `SubstrateConfig`
that comes with `subxt`, it can provide a custom extrinsic builder to
benchmarking-cli. This requires either a custom bencher implementation
or an integration into the parachains node.

Also cumulus-test-runtime has been migrated to provide genesis configs.

## Chain Compatibility
The current version here is compatible with the system chains and common
substrate chains. The way to go for others would be to customize the
frame-omni-bencher by providing a custom extrinsicbuilder. I did an
example implementation that works for mythical:
https://github.com/skunert/mythical-bencher

## Follow-Ups
- After #6040 is finished, we should integrate this here to make the
tooling truly useful. In the current form, the state is fairly small and
not representative.

## How to Review
I recommend starting from
[here](https://github.com/paritytech/polkadot-sdk/pull/5891/files#diff-50830ff756b3ac3403b7739d66c9e3a5185dbea550669ca71b28d19c7a2a54ecR264),
this method is the main entry point for omni-bencher and `polkadot`
binary.

TBD:
- [x] PRDoc

---------

Co-authored-by: Michal Kucharczyk <[email protected]>
This PR implements the contract API to query the code size of a given
address.

---------

Signed-off-by: Cyrill Leutwiler <[email protected]>
Signed-off-by: xermicus <[email protected]>
Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: command-bot <>
Co-authored-by: PG Herveou <[email protected]>
Closes #5566

Publish the `polkadot-omni-node` binary

This is a best effort. I'm not very familiar with the release /
publishing process and also not sure how to test this.
@paritytech/release-engineering can you take a look on this PR please ?

---------

Co-authored-by: EgorPopelyaev <[email protected]>
- Bound T::Hash to H256
- Implement the block hash API

---------

Signed-off-by: xermicus <[email protected]>
Signed-off-by: Cyrill Leutwiler <[email protected]>
Co-authored-by: command-bot <>
Co-authored-by: GitHub Action <[email protected]>
Add metrics for eth-rpc

---------

Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Alexander Theißen <[email protected]>
Since #6266 we no longer
require a custom toolchain to build the `pallet-revive-fixtures`. Hence
we no longer have to guard the build behind a feature flag.

---------

Co-authored-by: GitHub Action <[email protected]>
Part of #5047
On top of #5679

---------

Signed-off-by: Andrei Sandu <[email protected]>
Co-authored-by: GitHub Action <[email protected]>
The goal of this PR is to have the treasury pallet work on a parachain
which does not produce blocks on a regular schedule, thus can use the
relay chain as a block provider.

Because blocks are not produced regularly, we cannot make the assumption
that block number increases monotonically, and thus have new logic to
handle multiple spend periods passing between blocks.

---------

Co-authored-by: Bastian Köcher <[email protected]>
Co-authored-by: Muharem <[email protected]>
Part of #5047

Plus some cleanups

---------

Signed-off-by: Andrei Sandu <[email protected]>
Co-authored-by: Andrei Sandu <[email protected]>
Co-authored-by: Andrei Sandu <[email protected]>
Co-authored-by: GitHub Action <[email protected]>
Various fixes for the release of eth-rpc & ah-westend-runtime

- Bump asset-hub westend spec version
- Fix the status of the Receipt to properly report failed transactions
- Fix value conversion between native and eth decimal representation

---------

Co-authored-by: GitHub Action <[email protected]>
- [x] Removing `without_storage_info` and adding bounds on the stored
types for pallet `claims` - issue
#6289
- [x] Migrating to benchmarking V2 -
#6202

---------

Co-authored-by: Guillaume Thiolliere <[email protected]>
# Description

Closes #5940  

## Integration

Node devs that rely on templates' nodes binaries for minimal or
parachain would need to follow the updated templates' README.mds again
to find how to build the nodes' binaries.

## Review Notes

Conditional compilation of virtual workspaces would compile the
`members` list as if we passed `--workspace` flag to `cargo build` ,
except when adding a `default-members` list which will be used for any
cargo command executed in the virtual workspace root. To build the full
members list needs passing `--workspace` flag.

Other options investigated:
- feature guard the `node` crate by defining a feature in the `node`
crate, but it feels too complex since all code needs to be feature
guarded. I haven't tried it but technically speaking it might work. I
think though it looks awkward and my opinion is that the alternative is
better.
- defining features in the virtual workspace's Cargo.toml doesn't work
(thought that I might create a feature that will have a dependency on
the `node` crate and then not passing the feature to cargo build results
in ignoring the `node` crate)
- skipping compilation by using an environment variable, read in the
build script, that will exit compilation abruptly if not set, but I
couldn't make it work.
- exclude the crate from the members list and build it specifically by
passing `--package minimal-template-node` flag to the `cargo build`
command. This has the disadvantage of not allowing IDEs based on rust
analyzer to index/compile the node crate.

My conclusion is that any option would require two commands to build the
template, one with the node and one without, and both must be included
in the README or templates usage documentation. If it comes which ones
to pick I am in favor of the `default-members` option, which requires
minimal intervention and expresses how cargo commands are executed on
top of the workspace members, and what's left out from regular usage.

### Testing

Testing was conducted as described bellow:

- [x] zombienet with `minimal-template-node` , `parachain-template-node`
and `polkadot-omni-node`. Things work as expected.
- [x] no chopsticks testing was conducted - feels a bit out of scope for
OmniNode related docs and overall testing when promoting it over the
templates' nodes.
- [x] testing the changes for the sync templates workflow (ignore the
added comment from the Cargo.tomls, it was removed here on this branch:
[99bff3e](99bff3e)):
[minimal](https://github.com/paritytech-stg/polkadot-sdk-minimal-template/pull/22/files#diff-2e9d962a08321605940b5a657135052fbcef87b5e360662bb527c96d9a615542R9),
[parachain](https://github.com/paritytech-stg/polkadot-sdk-parachain-template/pull/19/files#diff-2e9d962a08321605940b5a657135052fbcef87b5e360662bb527c96d9a615542R9),
[solochain](https://github.com/paritytech-stg/polkadot-sdk-solochain-template/pull/17/files#diff-2e9d962a08321605940b5a657135052fbcef87b5e360662bb527c96d9a615542R9).
The links correspond to PRs opened by a bot after manually starting the
sync-templates workflow on `paritytech-stg` org to test the end result
of the `Cargo.toml` changes.

---------

Signed-off-by: Iulian Barbu <[email protected]>
Co-authored-by: Kian Paimani <[email protected]>
Part of:

- #6202.

---------

Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Oliver Tale-Yazdi <[email protected]>
Co-authored-by: Dónal Murray <[email protected]>
Co-authored-by: Giuseppe Re <[email protected]>
Co-authored-by: Dónal Murray <[email protected]>
…ove doc (#6316)

Part of:

- #6202.

---------

Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Guillaume Thiolliere <[email protected]>
Co-authored-by: Guillaume Thiolliere <[email protected]>
Co-authored-by: Oliver Tale-Yazdi <[email protected]>
sandreim and others added 29 commits November 5, 2024 17:52
I've broken this test with
#5883 and this is the
fix.

The benchmark is now updated to use proper core index and session index
for the generated candidates.

TODO:
- [ ] <del> PRDoc </del>

---------

Signed-off-by: Andrei Sandu <[email protected]>
…>` or `String` depending on use case (#5693)

# Description

As described in #4001
`RuntimeVersion` was not encoded consistently using serde. Turned out it
was a remnant of old times and no longer actually needed. As such I
removed it completely in this PR and replaced with `Cow<'static, str>`
for spec/impl names and `String` for error cases.

Fixes #4001.

## Integration

For downstream projects the upgrade will primarily consist of following
two changes:
```diff
#[sp_version::runtime_version]
pub const VERSION: RuntimeVersion = RuntimeVersion {
-	spec_name: create_runtime_str!("statemine"),
-	impl_name: create_runtime_str!("statemine"),
+	spec_name: alloc::borrow::Cow::Borrowed("statemine"),
+	impl_name: alloc::borrow::Cow::Borrowed("statemine"),
```
```diff
		fn dispatch_benchmark(
			config: frame_benchmarking::BenchmarkConfig
-		) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, sp_runtime::RuntimeString> {
+		) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, alloc::string::String> {
```

SCALE encoding/decoding remains the same as before, but serde encoding
in runtime has changed from bytes to string (it was like this in `std`
environment already), which most projects shouldn't have issues with. I
consider the impact of serde encoding here low due to the type only
being used in runtime version struct and mostly limited to runtime
internals, where serde encoding/decoding of this data structure is quite
unlikely (though we did hit exactly this edge-case ourselves
:sweat_smile:).

## Review Notes

Most of the changes are trivial and mechanical, the only non-trivial
change is in
`substrate/primitives/version/proc-macro/src/decl_runtime_version.rs`
where macro call expectation in `sp_version::runtime_version`
implementation was replaced with function call expectation.

# Checklist

* [x] My PR includes a detailed description as outlined in the
"Description" and its two subsections above.
* [ ] My PR follows the [labeling requirements](

https://github.com/paritytech/polkadot-sdk/blob/master/docs/contributor/CONTRIBUTING.md#Process
) of this project (at minimum one label for `T` required)
* External contributors: ask maintainers to put the right label on your
PR.
* [ ] I have made corresponding changes to the documentation (if
applicable)

---------

Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Guillaume Thiolliere <[email protected]>
Co-authored-by: Bastian Köcher <[email protected]>
There was no good example of what is patch and full genesis config file.
Some explanation and example were added to the `chain-spec-builder` doc.

---------

Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Iulian Barbu <[email protected]>
Resolves #5929

Migrates `ChildBountyDescriptions` to be indexed instead of unique child
bounty id unique per all child bounties in the pallet to be unique per
every parent bounty.

Migrates `(ParentBounty, ChildBounty)` keys inside `ChildBounties`
storage item to use new `ChildBounty` ids starting from `0`.

@paritytech/frame-coders

---------

Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Co-authored-by: DavidK <[email protected]>
Co-authored-by: muharem <[email protected]>
Co-authored-by: Oliver Tale-Yazdi <[email protected]>
…mmand (#6016)

Previously, when receiving the `SetReservedPeers { reserved }` all peers
not in the `reserved` set were removed.

This is incorrect, the intention of `SetReservedPeers` is to change the
active set of reserved peers and disconnect previously reserved peers
not in the new set.

While at it, have added a few other improvements to make the peerset
more robust:
- `SetReservedPeers`: does not disconnect all peers
- `SetReservedPeers`: if a reserved peer is no longer reserved, the
peerset tries to move the peers to the regular set if the slots allow
this move. This ensures the (now regular) peer counts towards slot
allocation.
- every 1 seconds: If we don't have enough connect peers, add the
reserved peers to the list that the peerstore ignores. Reserved peers
are already connected and the peerstore might return otherwise a
reserved peer


### Next Steps

- [x] More testing

cc @paritytech/networking

---------

Signed-off-by: Alexandru Vasile <[email protected]>
Co-authored-by: Dmitry Markin <[email protected]>
Co-authored-by: Michal Kucharczyk <[email protected]>
The tests used the same paths. When run on CI, each test is run in its
own process and thus, this "serial_test" crate wasn't used. The tests
are now using their own thread local tempdir, which ensures that the
tests are working when running in parallel in the same program or when
being run individually.
…6337)

# Description

Prior to this PR, the metadata for runtime APIs was entirely based on
that generated by `decl_runtime_apis`. It therefore didn't take into
account that `impl_runtime_apis` might implement older versions of APIs
than what has been declared.

This PR filters the returned runtime API metadata to only include
methods actually implemented, and also avoids including methods labelled
with `changed_in` (which the previous code was atempting to do already
but not successfully, owing to the attr being removed prior to the
check).

We also change all version related things to be `u32`s (rather than
VERSION being `u32` and `api_version`s being `u64`) for consistency /
ease of comparison.

A test is added which works with both the `enable-staging-api` feature
in api/tests enabled or disabled, to check all of this.

---------

Co-authored-by: Bastian Köcher <[email protected]>
Co-authored-by: GitHub Action <[email protected]>
A quick fix to the step that generates a temporary token used in the
pipeline
…6011)

Part of #5047

TODO:

- [x] prdoc
- [x] fix/add tests

---------

Signed-off-by: Andrei Sandu <[email protected]>
Co-authored-by: Andrei Sandu <[email protected]>
Co-authored-by: Andrei Sandu <[email protected]>
…ment (#4012)

closes #1890 

### Overview 

Introduces similar checker struct to `CheckTraitDecls` in
`decl_runtime_apis!` - `CheckTraitImpls`. Overrides
`visit::visit_type_path` to detect usage of `Self` as a type argument
within the scope of `impl_runtime_apis!`.

**Note**: only prevents the usage of `Self` as a type argument in an
angle bracket `<>`, as it is the only use case that fails to compile.
For example, the code
[below](https://github.com/paritytech/polkadot-sdk/blob/master/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/lib.rs#L1002)
compiles fine:

```rs
impl BridgeMessagesConfig<WithBridgeHubRococoMessagesInstance> for Runtime {
  fn is_relayer_rewarded(relayer: &Self::AccountId) -> bool {
	  let bench_lane_id = <Self as BridgeMessagesConfig<WithBridgeHubRococoMessagesInstance>>::bench_lane_id();
	  // ...
```

### Result

Given a block of code like this:

```rs
impl_runtime_apis! {
	impl apis::Core<Block> for Runtime {
		fn initialize_block(header: &HeaderFor<Self>) -> ExtrinsicInclusionMode {
			let _: HeaderFor<Self> = header.clone();
			RuntimeExecutive::initialize_block(header)
		}
		// ...
         }
// ...
```

<details open>

<summary>Output:</summary>

```bash
$ cargo build --release -p minimal-template-node
  error: `Self` can not be used as type argument in the scope of `impl_runtime_apis!`. Use `Runtime` instead.
     --> /polkadot-sdk/templates/minimal/runtime/src/lib.rs:133:11
      |
  133 |             let _: HeaderFor<Self> = header.clone();
      |                    ^^^^^^^^^^^^^^^

  error: `Self` can not be used as type argument in the scope of `impl_runtime_apis!`. Use `Runtime` instead.
     --> /polkadot-sdk/templates/minimal/runtime/src/lib.rs:132:32
      |
  132 |         fn initialize_block(header: &HeaderFor<Self>) -> ExtrinsicInclusionMode {
```

</details>

---------

Co-authored-by: Pavlo Khrystenko <[email protected]>
Co-authored-by: Pavlo Khrystenko <[email protected]>
Co-authored-by: Alexandru Vasile <[email protected]>
Co-authored-by: Bastian Köcher <[email protected]>
Relax requirements for `assign_core` so that it accepts updates for the
last scheduled entry.

Fixes #6102

---------

Co-authored-by: eskimor <[email protected]>
Co-authored-by: GitHub Action <[email protected]>
# Context

This PR aims to introduce XCMv5, for now it's in progress and will be
updated over time.
This branch will serve as a milestone branch for merging in all features
we want to add to XCM, roughly outlined
[here](polkadot-fellows/xcm-format#60).
More features could be added.

## TODO
- [x] Migrate foreign assets from v3 to v4
- [x] Setup v5 skeleton
- [x] Remove XCMv2
- [x] #5390
- [x] #5585
- [x] #5420
- [x] #5876
- [x] #5971
- [x] #6148
- [x] #6228

Fixes #3434 
Fixes #4190
Fixes #5209
Fixes #5241
Fixes #4284

---------

Signed-off-by: Adrian Catangiu <[email protected]>
Co-authored-by: Adrian Catangiu <[email protected]>
Co-authored-by: Andrii <[email protected]>
Co-authored-by: Branislav Kontur <[email protected]>
Co-authored-by: Joseph Zhao <[email protected]>
Co-authored-by: Nazar Mokrynskyi <[email protected]>
Co-authored-by: Bastian Köcher <[email protected]>
Co-authored-by: Shawn Tabrizi <[email protected]>
Co-authored-by: command-bot <>
Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Serban Iorga <[email protected]>
… the pool (#6357)

closes #6358

Adds the following runtime api to pallet-nomination-pools.
`pool_accounts(pool_id)`: Returns `(bonded_account, reward_account)`
associated with the `pool_id`.

cc: @rossbulat

---------

Co-authored-by: command-bot <>
Co-authored-by: Branislav Kontur <[email protected]>
Bumps [futures](https://github.com/rust-lang/futures-rs) from 0.3.30 to
0.3.31.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/rust-lang/futures-rs/releases">futures's
releases</a>.</em></p>
<blockquote>
<h2>0.3.31</h2>
<ul>
<li>Fix use after free of task in <code>FuturesUnordered</code> when
dropped future panics (<a
href="https://redirect.github.com/rust-lang/futures-rs/issues/2886">#2886</a>)</li>
<li>Fix soundness bug in <code>task::waker_ref</code> (<a
href="https://redirect.github.com/rust-lang/futures-rs/issues/2830">#2830</a>)
This is a breaking change but allowed because it is soundness bug
fix.</li>
<li>Fix bugs in <code>AsyncBufRead::read_line</code> and
<code>AsyncBufReadExt::lines</code> (<a
href="https://redirect.github.com/rust-lang/futures-rs/issues/2884">#2884</a>)</li>
<li>Fix parsing issue in
<code>select!</code>/<code>select_biased!</code> (<a
href="https://redirect.github.com/rust-lang/futures-rs/issues/2832">#2832</a>)
This is technically a breaking change as it will now reject a very odd
undocumented syntax that was previously accidentally accepted.</li>
<li>Work around issue due to upstream <code>Waker::will_wake</code>
change (<a
href="https://redirect.github.com/rust-lang/futures-rs/issues/2865">#2865</a>)</li>
<li>Add <code>stream::Iter::{get_ref,get_mut,into_inner}</code> (<a
href="https://redirect.github.com/rust-lang/futures-rs/issues/2875">#2875</a>)</li>
<li>Add <code>future::AlwaysReady</code> (<a
href="https://redirect.github.com/rust-lang/futures-rs/issues/2825">#2825</a>)</li>
<li>Relax trait bound on non-constructor methods of
<code>io::{BufReader,BufWriter}</code> (<a
href="https://redirect.github.com/rust-lang/futures-rs/issues/2848">#2848</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md">futures's
changelog</a>.</em></p>
<blockquote>
<h1>0.3.31 - 2024-10-05</h1>
<ul>
<li>Fix use after free of task in <code>FuturesUnordered</code> when
dropped future panics (<a
href="https://redirect.github.com/rust-lang/futures-rs/issues/2886">#2886</a>)</li>
<li>Fix soundness bug in <code>task::waker_ref</code> (<a
href="https://redirect.github.com/rust-lang/futures-rs/issues/2830">#2830</a>)
This is a breaking change but allowed because it is soundness bug
fix.</li>
<li>Fix bugs in <code>AsyncBufRead::read_line</code> and
<code>AsyncBufReadExt::lines</code> (<a
href="https://redirect.github.com/rust-lang/futures-rs/issues/2884">#2884</a>)</li>
<li>Fix parsing issue in
<code>select!</code>/<code>select_biased!</code> (<a
href="https://redirect.github.com/rust-lang/futures-rs/issues/2832">#2832</a>)
This is technically a breaking change as it will now reject a very odd
undocumented syntax that was previously accidentally accepted.</li>
<li>Work around issue due to upstream <code>Waker::will_wake</code>
change (<a
href="https://redirect.github.com/rust-lang/futures-rs/issues/2865">#2865</a>)</li>
<li>Add <code>stream::Iter::{get_ref,get_mut,into_inner}</code> (<a
href="https://redirect.github.com/rust-lang/futures-rs/issues/2875">#2875</a>)</li>
<li>Add <code>future::AlwaysReady</code> (<a
href="https://redirect.github.com/rust-lang/futures-rs/issues/2825">#2825</a>)</li>
<li>Relax trait bound on non-constructor methods of
<code>io::{BufReader,BufWriter}</code> (<a
href="https://redirect.github.com/rust-lang/futures-rs/issues/2848">#2848</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/rust-lang/futures-rs/commit/1e052816b09890925cfdfcbe8d390cdaae5e4c38"><code>1e05281</code></a>
Release 0.3.31</li>
<li><a
href="https://github.com/rust-lang/futures-rs/commit/8a8b085a8c1a7396173a104c67e0cf2f5b74fc74"><code>8a8b085</code></a>
Fix clippy::uninit_vec warning</li>
<li><a
href="https://github.com/rust-lang/futures-rs/commit/f3fb74df310d070d91df7995c942f223cba6720a"><code>f3fb74d</code></a>
Document how <code>BoxFuture</code>s / <code>BoxStream</code>s are often
made (<a
href="https://redirect.github.com/rust-lang/futures-rs/issues/2887">#2887</a>)</li>
<li><a
href="https://github.com/rust-lang/futures-rs/commit/f00e7afb467e5f9b3c81724cc3cac1f0687fff7c"><code>f00e7af</code></a>
Fix use after free of task in FuturesUnordered when dropped future
panics (<a
href="https://redirect.github.com/rust-lang/futures-rs/issues/2">#2</a>...</li>
<li><a
href="https://github.com/rust-lang/futures-rs/commit/33c46b3dc65e151e0e794636ad62872330733557"><code>33c46b3</code></a>
ci: Work around sanitizer issue on latest Linux kernel</li>
<li><a
href="https://github.com/rust-lang/futures-rs/commit/7bf5a72826c0daed633ec48e8ddaecd8a32f0d11"><code>7bf5a72</code></a>
Fix issues with <code>AsyncBufRead::read_line</code> and
<code>AsyncBufReadExt::lines</code> (<a
href="https://redirect.github.com/rust-lang/futures-rs/issues/2884">#2884</a>)</li>
<li><a
href="https://github.com/rust-lang/futures-rs/commit/87afaf3973e8652228f7ccaadd04e7b0e456c63d"><code>87afaf3</code></a>
Use <code>#[inline(always)]</code> on <code>clone_arc_raw</code> (<a
href="https://redirect.github.com/rust-lang/futures-rs/issues/2865">#2865</a>)</li>
<li><a
href="https://github.com/rust-lang/futures-rs/commit/549b90b1793a044bcade67b81a3d7eabd95f3971"><code>549b90b</code></a>
Add accessors for the inner of stream::Iter (<a
href="https://redirect.github.com/rust-lang/futures-rs/issues/2875">#2875</a>)</li>
<li><a
href="https://github.com/rust-lang/futures-rs/commit/07b004ac7e0d72e09ff652f234d00e4f26a5f558"><code>07b004a</code></a>
Add missing symbols (<a
href="https://redirect.github.com/rust-lang/futures-rs/issues/2883">#2883</a>)</li>
<li><a
href="https://github.com/rust-lang/futures-rs/commit/86dc069fa278d4197de91eb6e038e0ec64857684"><code>86dc069</code></a>
Various fixes too make the CI green (<a
href="https://redirect.github.com/rust-lang/futures-rs/issues/2885">#2885</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/rust-lang/futures-rs/compare/0.3.30...0.3.31">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=futures&package-manager=cargo&previous-version=0.3.30&new-version=0.3.31)](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] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…#6315)

Part of:

- #6202.

---------

Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Guillaume Thiolliere <[email protected]>
Co-authored-by: Giuseppe Re <[email protected]>
Co-authored-by: Guillaume Thiolliere <[email protected]>
This PR fixes the `0002-validators-warp-sync` zombienet test by matching
for a specific error case.

The following PR introduced a new error for validators that don't have
public addresses available for publishing in the DHT:
- #6298
The log line was moved from `eprintln!("Warning: ...` in sc-cli to the
authority discovery where it is printed properly as an error.


cc @paritytech/sdk-node

Signed-off-by: Alexandru Vasile <[email protected]>
# Description

This is a continuation of
#5666 that finally fixes
#5333.

This should allow developers to create custom syncing strategies or even
the whole syncing engine if they so desire. It also moved syncing engine
creation and addition of corresponding protocol outside
`build_network_advanced` method, which is something Bastian expressed as
desired in
#5 (comment)

Here I replaced strategy-specific types and methods in `SyncingStrategy`
trait with generic ones. Specifically `SyncingAction` is now used by all
strategies instead of strategy-specific types with conversions.
`StrategyKey` was an enum with a fixed set of options and now replaced
with an opaque type that strategies create privately and send to upper
layers as an opaque type. Requests and responses are now handled in a
generic way regardless of the strategy, which reduced and simplified
strategy API.

`PolkadotSyncingStrategy` now lives in its dedicated module (had to edit
.gitignore for this) like other strategies.

`build_network_advanced` takes generic `SyncingService` as an argument
alongside with a few other low-level types (that can probably be
extracted in the future as well) without any notion of specifics of the
way syncing is actually done. All the protocol and tasks are created
outside and not a part of the network anymore. It still adds a bunch of
protocols like for light client and some others that should eventually
be restructured making `build_network_advanced` just building generic
network and not application-specific protocols handling.

## Integration

Just like #5666
introduced `build_polkadot_syncing_strategy`, this PR introduces
`build_default_block_downloader`, but for convenience and to avoid
typical boilerplate a simpler high-level function
`build_default_syncing_engine` is added that will take care of creating
typical block downloader, syncing strategy and syncing engine, which is
what most users will be using going forward. `build_network` towards the
end of the PR was renamed to `build_network_advanced` and
`build_network`'s API was reverted to
pre-#5666, so most users
will not see much of a difference during upgrade unless they opt-in to
use new API.

## Review Notes

For `StrategyKey` I was thinking about using something like private type
and then storing `TypeId` inside instead of a static string in it, let
me know if that would preferred.

The biggest change happened to requests that different strategies make
and how their responses are handled. The most annoying thing here is
that block response decoding, in contrast to all other responses, is
dependent on request. This meant request had to be sent throughout the
system. While originally `Response` was `Vec<u8>`, I didn't want to
re-encode/decode request and response just to fit into that API, so I
ended up with `Box<dyn Any + Send>`. This allows responses to be truly
generic and each strategy will know how to downcast it back to the
concrete type when handling the response.

Import queue refactoring was needed to move `SyncingEngine` construction
out of `build_network` that awkwardly implemented for `SyncingService`,
but due to `&mut self` wasn't usable on `Arc<SyncingService>` for no
good reason. `Arc<SyncingService>` itself is of course useless, but
refactoring to replace it with just `SyncingService` was unfortunately
rejected in #5454

As usual I recommend to review this PR as a series of commits instead of
as the final diff, it'll make more sense that way.

# Checklist

* [x] My PR includes a detailed description as outlined in the
"Description" and its two subsections above.
* [x] My PR follows the [labeling requirements](

https://github.com/paritytech/polkadot-sdk/blob/master/docs/contributor/CONTRIBUTING.md#Process
) of this project (at minimum one label for `T` required)
* External contributors: ask maintainers to put the right label on your
PR.
* [x] I have made corresponding changes to the documentation (if
applicable)
fixes #5966

---------

Co-authored-by: Guillaume Thiolliere <[email protected]>
…6380)

This PR ensures that external addresses with different PeerIDs are not
propagated to the higher layer of the network code.

While at it, this ensures that libp2p only adds the `/p2p/peerid` part
to the discovered address if it does not contain it already.

This is a followup from:
- #6298

cc @paritytech/networking

---------

Signed-off-by: Alexandru Vasile <[email protected]>
Co-authored-by: Dmitry Markin <[email protected]>
Fixes #5530

This PR introduces the removal of backing jobs that have been back
pressured for longer than `allowedAncestryLen`, as these candidates are
no longer viable.

It is reasonable to expect a result for a backing job execution within
`allowedAncestryLen` blocks. Therefore, we set the job TTL as a relay
block number and synchronize the validation host by sending activated
leaves.

---------

Co-authored-by: Andrei Sandu <[email protected]>
Co-authored-by: Branislav Kontur <[email protected]>
This PR has small addition to the db package version. As `cargodeb`
takes the version from the `*.toml` file, this PR adds an extra flag to
the `cargodeb` command so that the version of the deb package matches
the `polkadot` node version.
This PR changes the behavior of `json_patch::merge` function which no
longer removes any keys from the base JSON object.

fixes: #6306

---------

Co-authored-by: GitHub Action <[email protected]>
# Description

E2E tests to Polkadot/Kusama's people chains (in
open-web3-stack/polkadot-ecosystem-tests#63)
revealed that 2 of the identity pallet's extrinsics did not emit events
in case of success:
* `pallet_identity::rename_sub`, and
* `pallet_identity::set_subs`

This PR fixes that.

## Integration

Other than 2 extrinsics emiting an event when previously they did not,
no other behavior in pallets/extrinsics was modified, so no integration
is needed.

## Review Notes

N/A
# Description

Implemented benchmarks for Notifications and RequestResponse protocols
with libp2p implementation. These benchmarks allow us to monitor
regressions and implement fixes before they are observed in real chain.
In the future, they can be used for targeted optimizations of litep2p
compared to libp2p.

Part of #5220

Next steps:
- Add benchmarks for litep2p implementation
- Optimize load to get better results
- Add benchmarks to CI to catch regressions



## Integration

Benchmarks don't affect downstream projects.

---------

Co-authored-by: alvicsam <[email protected]>
Co-authored-by: GitHub Action <[email protected]>
)

Part of:

- #6202.

---------

Co-authored-by: Giuseppe Re <[email protected]>
Co-authored-by: GitHub Action <[email protected]>
This PR exposes additional syncing types to facilitate the development
of a custom syncing strategy based on the existing Polkadot syncing
strategy. Specifically, my goal is to isolate the state sync and chain
sync components, allowing the state to be downloaded from the P2P
network without running a full regular Substrate node. I also need to
intercept the state responses during the state sync process.

The newly exposed types are necessary to implement this custom syncing
strategy.
@dudo50 dudo50 merged commit 87125ff into paraspell-research:master Nov 7, 2024
55 of 108 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.