Skip to content

[DO NOT MERGE] cherry-picks for polkadot-sdk stable2506#15

Closed
tmpolaczyk wants to merge 41 commits into
stable2506from
tanssi-polkadot-stable2506
Closed

[DO NOT MERGE] cherry-picks for polkadot-sdk stable2506#15
tmpolaczyk wants to merge 41 commits into
stable2506from
tanssi-polkadot-stable2506

Conversation

@tmpolaczyk
Copy link
Copy Markdown

No description provided.

girazoki and others added 18 commits September 16, 2025 16:39
This cherry-pick should match this pull request:

paritytech#1641
* modify inbound queue to support custom message processing

* passively test tuple trait implementation

* rename XCM to Xcm everywhere

* add comment explaining MessageProcessor
* add on_new_commitment hook

Missing dependencies xcm-emulator
…mulator (paritytech#8809)

With the addition of
paritytech#8083 there is no
possibility right now of making the xcm-executor work with custom
inherents. Custom inherents are usually driven by killing a storage item
of the form `wasInherentSet` `on_initialize` and asserting that such
inherent was set `on_finalize`. Before the xcm-emulator worked as these
hooks were running just for the ParachainSystem pallet, but now, they
run for all pallets.

My proposal is to add an item to the xcm-emulator parachain
configuration of the form `AdditionalInherentCode`, which simply
executes code that returns a `DispatchResult`. Whether users want to
mock a storage item or run the inherent is up to them, this hook would
allow them to do both.

This item is optional, meaning that if it is non-set then it would do
nothing

---------

Co-authored-by: Branislav Kontur <bkontur@gmail.com>
Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Bastian Köcher <git@kchr.de>
Bump bounded-collections dep from `0.2.3` to `0.3.2` based on the latest
[release](https://crates.io/crates/bounded-collections/0.3.2)

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Bastian Köcher <git@kchr.de>
Backport paritytech#9938 into `stable2509` from claravanstaden.

See the
[documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md)
on how to use this bot.

<!--
  # To be used by other automation, do not modify:
  original-pr-number: #${pull_number}
-->

Co-authored-by: Clara van Staden <claravanstaden64@gmail.com>
Co-authored-by: Adrian Catangiu <adrian@parity.io>
* Snowbridge - Adds Fulu hardfork (paritytech#9938)

Adds Fulu hardfork version. No other onchain changes required.

Fulu activation on Sepolia is 14 October, Mainnet 3 December.

---------

Co-authored-by: Adrian Catangiu <adrian@parity.io>
(cherry picked from commit c223162)

* fix test

---------

Co-authored-by: Clara van Staden <claravanstaden64@gmail.com>
Co-authored-by: Adrian Catangiu <adrian@parity.io>
…ustification (paritytech#9015)

A grandpa race-casse has been identified in the versi-net stack around
authority set changes, which leads to the following:

- T0 / Node A: Completes round (15)
- T1 / Node A: Applies new authority set change and increments the SetID
(from 0 to 1)
- T2 / Node B: Sends Precommit for round (15) with SetID (0) -- previous
set ID
- T3 / Node B: Applies new authority set change and increments the SetID
(1)

In this scenario, Node B is not aware at the moment of sending
justifications that the Set ID has changed.
The downstream effect is that Node A will not be able to verify the
signature of justifications, since a different SetID is taken into
account. This will cascade through the sync engine, where the Node B is
wrongfully banned and disconnected.

This PR aims to fix the edge-case by making the grandpa resilient to
verifying prior setIDs for signatures.
When the signature of the grandpa justification fails to decode, the
prior SetID is also verified. If the prior SetID produces a valid
signature, then the outdated justification error is propagated through
the code (ie `SignatureResult::OutdatedSet`).

The sync engine will handle the outdated justifications as invalid, but
without banning the peer. This leads to increased stability of the
network during authority changes, which caused frequent disconnects to
versi-net in the past.

### Review Notes
- Main changes that verify prior SetId on failures are placed in
[check_message_signature_with_buffer](https://github.com/paritytech/polkadot-sdk/pull/9015/files#diff-359d7a46ea285177e5d86979f62f0f04baabf65d595c61bfe44b6fc01af70d89R458-R501)
- Sync engine no longer disconnects outdated justifications in
[process_service_command](https://github.com/paritytech/polkadot-sdk/pull/9015/files#diff-9ab3391aa82ee2b2868ece610100f84502edcf40638dba9ed6953b6e572dfba5R678-R703)

### Testing Done
- Deployed the PR to versi-net with 40 validators
- Prior we have noticed 10/40 validators disconnecting every 15-20
minutes, leading to instability
- Over past 24h the issue has been mitigated:
https://grafana.teleport.parity.io/goto/FPNWlmsHR?orgId=1
- Note: bootnodes 0 and 1 are currently running outdated versions that
do not incorporate this SetID verification improvement

Closes: paritytech#8872
Closes: paritytech#1147

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Dmitry Markin <dmitry@markin.tech>
…tions (paritytech#9251)

Allow setting idle connection timeout value. This can be helpful in
custom networks to allow maintaining long-lived connections.

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…#9315)

Increase Kademlia memory store capacity for DHT content providers (used
by parachain DHT-based bootnodes) and reduce provider republish interval
& TTL. This is needed to support testnets with 1-minute fast runtime and
up to 13 parachains.

Parameters set:
- 10000 provider keys per node
- 10h provider record TTL
- 3.5h provider republish interval

Closes paritytech/litep2p#405.

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…8819)

# Description

This PR fixes confusing trace log messages in the substrate client
network behavior code.

## Integration

These log messages can be merged into existing logging code, or the
changes can be safely ignored.

## Review Notes

When the node logs:
> Will start to connect at until Instant

It is unclear if connections will start at the instant, or will occur
until the instant.
This PR deletes "until" to make the message match the behaviour in the
code.

There's also a minor grammar fix in another trace message.

# Checklist

* [ ] 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.

Please add the label T0-node to this PR.

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

This release adds the ability to use system DNS resolver and change
Kademlia DNS memory store capacity. It also fixes the Bitswap protocol
implementation and correctly handles the dropped notification substreams
by unregistering them from the protocol list.

### Added

- kad: Expose memory store configuration
([paritytech#407](paritytech/litep2p#407))
- transport: Allow changing DNS resolver config
([paritytech#384](paritytech/litep2p#384))

### Fixed

- notification: Unregister dropped protocols
([paritytech#391](paritytech/litep2p#391))
- bitswap: Fix protocol implementation
([paritytech#402](paritytech/litep2p#402))
- transport-manager: stricter supported multiaddress check
([paritytech#403](paritytech/litep2p#403))

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
dmitry-markin and others added 2 commits October 28, 2025 17:00
This upgrade fixes the initialization of mDNS in the environment with no
multicast addresses available and compatibility with kubo IPFS >= 0.37
when run with `--ipfs-server`. It also enables communication with remote
peers having RSA network identity keys.

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Branislav Kontur <bkontur@gmail.com>
Switch to system DNS resolver instead of 8.8.8.8 that litep2p uses by
default. This enables full administrator control of what upstream DNS
servers to use, including resolution of local names using custom DNS
servers.

Fixes paritytech#9298.

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@tmpolaczyk tmpolaczyk force-pushed the tanssi-polkadot-stable2506 branch from 5049d5a to a48ddc6 Compare November 4, 2025 13:15
girazoki and others added 4 commits November 11, 2025 15:15
…ech#10158)

Right now the default message processor is somewhat tied to specific
`AggregateMessageOrigin` from `polkadot_runtime_parachains::inclusion`.
this pr changes it so that we require a conversion from that
AggregateMessageOrigin, but nothing else, the rest stays generic.

In the longer run we can allow customizing the processor to some other
thing, but this was a sufficiently easier change

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Adrian Catangiu <adrian@parity.io>
@Pray4Lovee
Copy link
Copy Markdown

// Fix compile errors in bridge hub benchmarks

use crate::{ 
    Balances, 
    EthereumInboundQueue, 
    EthereumOutboundQueue, 
    EthereumSystem, 
    MessageQueue, 
    Runtime, 
    RuntimeEvent, 
    TransactionByteFee, 
    TreasuryAccount,
};
#[cfg(feature = "runtime-benchmarks")]
use benchmark_helpers::DoNothingRouter;
use bridge_hub_common::AggregateMessageOrigin;
use frame_support::{parameter_types, weights::ConstantMultiplier};
use pallet_xcm::EnsureXcm;

#[cfg(feature = "runtime-benchmarks")]
mod benchmark_helpers {
    use crate::{ EthereumBeaconClient, Runtime, RuntimeOrigin };
    use codec::Encode;
    use snowbridge_beacon_primitives::BeaconHeader;
    use snowbridge_inbound_queue_primitives::EventFixture;
    use snowbridge_pallet_inbound_queue::BenchmarkHelper;
    use sp_core::H256;
    use xcm::latest::{ Assets, Location, SendError, SendResult, SendXcm, Xcm, XcmHash };

    impl<T: snowbridge_pallet_ethereum_client::Config> BenchmarkHelper<T> for Runtime {
        fn initialize_storage(beacon_header: BeaconHeader, block_roots_root: H256) {
            // Store finalized Ethereum header and block root
            EthereumBeaconClient::store_finalized_header(beacon_header, block_roots_root).unwrap();
            // We haven't implemented the initialization yet, hence a placeholder
            todo!();
        }
    }
}
// Bridge hub westend modifications

use crate::{ EthereumBeaconClient, Runtime, RuntimeOrigin };
use codec::Encode;
use hex_literal::hex;
use snowbridge_beacon_primitives::BeaconHeader;
use snowbridge_inbound_queue_primitives::EventFixture;
use snowbridge_pallet_inbound_queue::BenchmarkHelper;
use snowbridge_pallet_inbound_queue_v2::BenchmarkHelper as InboundQueueBenchmarkHelperV2;
use snowbridge_pallet_outbound_queue_v2::BenchmarkHelper as OutboundQueueBenchmarkHelperV2;
use sp_core::H256;
use xcm::latest::{ Assets, Location, SendError, SendResult, SendXcm, Xcm, XcmHash };

impl<T: snowbridge_pallet_ethereum_client::Config> BenchmarkHelper<T> for Runtime {
    fn initialize_storage(beacon_header: BeaconHeader, block_roots_root: H256) {
        // Placeholder for Ethereum header storage
        // This code is a temporary placeholder until further implementation
        todo!();
    }
}

Summary of Fixes

  1. File: bridge-hub-rococo/src/bridge_to_ethereum_config.rs

    • Fixed compile errors related to missing dependencies and redefined imports.
    • Added EthereumBeaconClient and integrated BenchmarkHelper interface for Polkadot ↔ Ethereum communication.
  2. File: bridge-hub-westend/src/bridge_to_ethereum_config.rs

    • Fixed similar compile issues, added xcm integration, and extended the BenchmarkHelper trait to handle inbound and outbound queues with Ethereum.

Important Notes

  • The todo!() in both files represents unimplemented functionality that requires future work (i.e., Ethereum header storage logic).
  • The benchmark helpers for Snowbridge have been implemented but are not yet fully functional, pending more specific bridging and storage logic.

tmpolaczyk and others added 8 commits November 17, 2025 16:51
- The current `MessageToXcm` inbound converter is somewhat verbose, with
injected types that are sparse and unorganized, This change cleans up
and refactors the code accordingly. (I can’t find the original comment,
but I vaguely recall it being mentioned by @acatangiu in a previous PR
review).

- Add more tests cover some edge cases, such as claiming assets trapped
on AH from a parachain.

---------

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

Fixes a bug where Snowbridge Inbound V2 tips were not paid out to the
relayer.

## Review Notes

Any tips added to a message in the Inbound Queue v2 (Ethereum to
Polkadot direction), were burned and added to storage, but never paid
out to the relayer. This PR fixes this bug by adding the tip to the
relayer fee.

---------

Co-authored-by: Branislav Kontur <bkontur@gmail.com>
…tytech#10313)

## Description 

While testing different XCM messages via xcm-emulator, I noticed that
the limit of 256 for `max_upward_message_size` in
`RelayStateSproofBuilder` can be reached very easily.

I suggest increasing it to `1024 * 1024` so that we can have a good
range for testing.

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Branislav Kontur <bkontur@gmail.com>
…xcess weight (#20)

Co-authored-by: girazoki <gorka.irazoki@gmail.com>
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.