Skip to content

merging donal-ahm with master#8936

Merged
ggwpez merged 60 commits intodonal-ahmfrom
kk-fix-conflicts-donal-ahm
Jun 26, 2025
Merged

merging donal-ahm with master#8936
ggwpez merged 60 commits intodonal-ahmfrom
kk-fix-conflicts-donal-ahm

Conversation

@karolk91
Copy link
Copy Markdown
Contributor

Merging donal-ahm with master

ordian and others added 25 commits June 16, 2025 13:28
Fixes #8859 

Long-term fix would be addressing #5520.
Changes for new CI runners.
For the staking-async test runtime, we extend the duration of the signed
phase from 2 to 4 minutes, in order to give enough time to the staking
miner to mine, submit the score, verify it's on chain and then submit
all pages during the signed phase.

While testing on CI / locally for a 32-page solution, the miner ends up
submitting pages pretty close to the end of the signed phase itself.

Whereas this is a valuable scenario to test to prove miner's robustness,
in the main happy path and while testing locally, we want the miner by
default to have enough time to submit the whole solution and to be able
to handle a re-tx if one/N pages fail to be submitted still within the
same Signed phase cycle.
Fixes #677
Fixes #2399 

# Description

To detect potential corruption of PVF artifacts on disk, we store their
checksums and verify if they match before execution. In case of a
mismatch, we recreate the artifact.

## Integration

In Candidate Validation, we treat the error similarly to
PossiblyInvalidError::RuntimeConstruction due to their close nature.

## Review Notes

The Black3 hashing algorithm has already been used. I believe we can
switch to twox, as suggested in the issue, because the checksum does not
need to be cryptographically hashed, and we do not reveal the checksum
in logs.

---------

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

Fixes #8823

---------

Co-authored-by: Javier Viola <javier@parity.io>
Add needed env vars to run with the new runners (polkadot workflow) and
move cumulus/substrate to zombienet action.
Extend overseer to send priority messages, the new functionality is used
for sending messages on the grandpa call path when we call
dispute-coordinator and approval-voting in
finality_target_with_longest_chain to make sure we don't block
unnecessarily.

Depends on: paritytech/orchestra#87.

---------

Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>
Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Javier Viola <javier@parity.io>
Co-authored-by: Javier Viola <363911+pepoviola@users.noreply.github.com>
# Description

Fixed some comments in the implementation of proxy pallet.
Fixes: #8868

The error skipped in log is acceptable, the announced block does not
have the parent imported yet.

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Closes #8871
Related to #8748

Fix `zombienet-substrate-0002-validators-warp-sync`
Only record storage change in diff mode if the value differ from the
initial one.
Previous implementation would report a diff for example when the old
value was written again.

Updated tests in paritytech/evm-test-suite#96

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This PR bring two new features to the `election-provider-multi-block`
pallets, based on audit reviews and our empirical experience in westend:

1. While I have not found the actual root cause, the offchain-worker
miner in westend collators is sometimes unreliable. In this PR, I have
added a configuration that would disable the call cache for this
offchain worker. I have run this new code in my personal WAH collator,
and it is indeed more reliable. This just gives us more lever to easily
disable the cache. Investigation should still continue as to what is the
root cause.
2. the signed submission system now supports a governance set of
`invulnerables`. See the code comments for what this implies.
 
Marking this as silent for now as these crates are unreleased for faster
pace, but can add prdoc if needed.

This will be quite useful to lower the chance of backports after #8764
deadline, but is not mandatory.

It partially closes
https://github.com/orgs/paritytech/projects/189?pane=issue&itemId=114585501&issue=paritytech%7Cpolkadot-sdk%7C8879

---------

Co-authored-by: Paolo La Camera <paolo@parity.io>
Fix in-memory sqlite connection pool issue
see launchbadge/sqlx#2510

---------

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

# Description
Fixing bridges integration tests by setting up pool

---------

Co-authored-by: Branislav Kontur <bkontur@gmail.com>
…max retry count (#8792)

Instead of giving up after 5 discovery attempts, keep retrying with a
delay of 30 seconds until the discovery succeeds.

This fixes a DHT bootnodes zombinet test execution on CI where
individual nodes may start with a significant delay. This will also help
should there be temporary connectivity issues leading to 5 failures in a
row.

---------

Co-authored-by: Alexandru Vasile <60601340+lexnv@users.noreply.github.com>
Introduces integration tests covering `authorize_upgrade` with
whitelisting via Collectives for Westend network:
- relay chain authorizes upgrade for itself
- relay chain authorizes upgrades for all system chains

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Branislav Kontur <bkontur@gmail.com>
This will be moved into an inherent digest.

As preparation for:
#8893

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Rewrite it with zombienet-sdk, while simplyfing it.
The main source of flakyness was timing, because this test was manually
registering parachains, so we had to wait for 2 sessions. Waiting for
session change with zndsl zombienet was a hassle, whereas with
zombienet-sdk is much easier.

Moreover, I needed to replicate the logic change from:
#6554 to the genesis
parachain registration, so that we don't automatically get an extra
assigned core when registering a parachain (unless we want one)
…-coretime-collation-fetching-fairness.zndsl (#8921)

`polkadot/zombienet_tests/functional/0019-coretime-collation-fetching-fairness.zndsl`
is flaky on CI. I suspect the reason for this is session changes
happening during the measurement step. To make this more predictable
I've modified the checker to wait for a session change before counting
the `CandidateIncluded` events. Hopefully this will stabilize the test
on CI too.
)

Make RuntimeCall dispatchable as eth transaction.

By sending a transaction to
`0x6d6f646c70792f70616464720000000000000000`, using the encoded runtime
call as input, the call will be executed by the origin indicated by the
Ethereum signature (0xEE account_id).

see paritytech/foundry-polkadot#130

e.g sending a remark_with_event
```
cast wallet import dev-account --private-key 5fb92d6e98884f76de468fa3f6278f8807c48bebc13595d45af5bdc4da702133
cast send --account dev-account 0x6d6f646c70792f70616464720000000000000000 0x0007143132333435
```

also merged in #8901 and #8920

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Scheduler `on_initialize` supports skipped blocks.

Scheduler correctly handles situations where `on_initialize` is invoked
with block numbers that:
- increase but are not strictly consecutive (e.g., jump from 5 → 10), or
- are repeated (e.g., multiple blocks are built at the same Relay Chain
parent block, all reporting the same `BlockNumberProvider` value).

This situation may occur when the `BlockNumberProvider` is not local -
for example, on a parachain using the Relay Chain block number provider.

Implementation notes:
- The `IncompleteSince` value is always set to the next block `(now +
1)`.
- A scheduled task is considered permanently overweight only if it fails
during the first agenda processing;
# Description

Closes #7384
Closes #75
Closes #8692
Closes #8739 

## Integration

Node developers, node operators & runtime developers will not need to
generate chain specs that contain a `para_id` field starting with this
PR, but they'll have to implement the
`cumulus_primitives_core::GetParachainInfo` runtime API once they drop
the `para_id` field, so that new nodes versions will be able to query
the runtime for the parachain id.

Starting with `2512` the nodes will not support anymore reading the
parachain id from chain specs `para_id` field, so it will be mandatory
for runtime to implement the `cumulus_primitives_core::GetParachainInfo`
trait and be upgraded.

## Review Notes

This PR is based on prior work here:  #7546. It delivers the following:

### Deprecated `para_id` chain spec extension

- nodes like `polkadot-omni-node`/`polkadot-parachain`) will still
support running chainspecs with `para_id` extension for a while (until
stable2512)
- nodes like `test-parachain`/`parachain-template-node` are supporting
only runtimes that implement the new runtime API.
- `chain-spec-builder` will display that `para_id` is deprecated when
calling `help`, or when using the flag.

### Additional cleanup/changes

- fixed & renabled some omni-node/parachain-template-node tests from
`polkadot-sdk-docs` & `templates/zombienet`, which rely on the newly
added runtime API as wellI. Tests based on the `para_id` chain spec
extension are not present anymore, since omni-node will favour taking
the para id based on the runtime API if present.

- removed the concept of running `minimal` with omni-node. I returned to
an old idea of a few of us. At this moment we can't support it anymore
with omni-node since we'd need to add `parachain_info` to
`minimal-template-runtime`, which doesn't make much sense.

- most of the parachains runtimes (hope I haven't missed any relevant)
that run by using
`polkadot-parachain/polkadot-omni-node/test-parachain/parachain-template-node`
should fail to work with the previous nodes (that support them) after
`stable2512`. Probably that will be caught in the CI if I missed them
during this PR, but I doubt it.

## Reviewers request

- if there are other nodes used to run parachains runtimes, this is a
good moment to highlight them so that I can update them if needed in
terms of picking up the `parachain_id` from the runtime.

---------

Signed-off-by: Iulian Barbu <iulian.barbu@parity.io>
Co-authored-by: Steven <stevenlawrence13e@gmail.com>
Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Michal Kucharczyk <1728078+michalkucharczyk@users.noreply.github.com>
So the behavior is the same as `as_multi` when it comes to sending an
event.

Closes: #8924

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@karolk91 karolk91 added the R0-no-crate-publish-required The change does not require any crates to be re-published. label Jun 23, 2025
@cla-bot-2021
Copy link
Copy Markdown

cla-bot-2021 Bot commented Jun 23, 2025

User @Stephenlawrence00, please sign the CLA here.

Comment thread cumulus/parachains/runtimes/assets/asset-hub-westend/src/staking.rs
Comment thread cumulus/parachains/runtimes/assets/asset-hub-westend/src/staking.rs
@karolk91
Copy link
Copy Markdown
Contributor Author

karolk91 commented Jun 23, 2025

@ggwpez, Currently my governance tests on donal-ahm branch are failing, with error like:

---- open_gov_on_asset_hub::assethub_can_authorize_upgrade_for_system_chains stdout ----
thread 'open_gov_on_asset_hub::assethub_can_authorize_upgrade_for_system_chains' panicked at /Users/kkdev/Dev/paritytech/polkadot-sdk/substrate/frame/staking/src/pallet/mod.rs:792:5:
Expected Ok(_). Got Err(
    Module(
        ModuleError {
            index: 6,
            error: [
                33,
                0,
                0,
                0,
            ],
            message: Some(
                "Restricted",
            ),
        },
    ),
)


failures:
    open_gov_on_asset_hub::assethub_can_authorize_upgrade_for_itself
    open_gov_on_asset_hub::assethub_can_authorize_upgrade_for_relay_chain
    open_gov_on_asset_hub::assethub_can_authorize_upgrade_for_system_chains
    open_gov_on_relay::relaychain_can_authorize_upgrade_for_itself
    open_gov_on_relay::relaychain_can_authorize_upgrade_for_system_chains

I have narrowed it down to the type Filter = Everything change here:
51e9ad8

michalkucharczyk and others added 8 commits June 25, 2025 06:40
#8923)

While testing mortal transaction I encountered exactly the same problem
as in #8490.
This PR should fix the problem.

fixes: #8490

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This PR changes the node's default transaction pool to the fork aware
implementation.

---------

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

I found the previous version of the comment for the
`schedule_config_update` function slightly unclear.

I understood it to mean that the application of two configuration
changes in the same session would lead to the change being applied in
the current session, instead of having to wait until the session change
as usual.

I tried this out on `chopsticks` just to be sure.

---------

Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
# Description

Fixes #8886

PVF execution worker communication was organized into a single
ExecuteRequest struct. This should improve performance: one
encode/decode operation instead of four. Also, no more chance of
ordering mistakes.



## Integration

This is an internal refactoring of the PVF execution worker. Downstream
projects will not need any code changes.

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
# Description
This PR enhances the flexibility of the `NoOpPoll` implementation by
introducing a generic `Moment` parameter. This change enables support
for diverse clock configurations across different runtimes, allowing
`NoOpPoll` to work seamlessly with various block number implementations
(e.g., `u32`, `u64`, or custom block number types).

### Integration
Downstream projects using `NoOpPoll` must make these adjustments:

- Add generic parameter: Specify the Moment type when using `NoOpPoll`

- Update type annotations: Modify existing references to include the
generic parameter

### Example Migration:

```diff
// Before
use frame_support::traits::NoOpPoll;

let _ = NoOpPoll;

// After
use frame_support::traits::NoOpPoll;
use frame_system::pallet_prelude::BlockNumberFor;
```

### Generic struct update:

```diff
- pub struct NoOpPoll;
+ pub struct NoOpPoll<Moment>(core::marker::PhantomData<Moment>);
```
### Polling trait implementation:
```diff
- impl<Tally> Polling<Tally> for NoOpPoll {
+ impl<Tally, Moment> Polling<Tally> for NoOpPoll<Moment> {
     type Index = u8;
     type Votes = u32;
     type Class = u16;
-    type Moment = u64;
+    type Moment = Moment;
```

---------

Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: Branislav Kontur <bkontur@gmail.com>
Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
[`TransactionPool::report_invalid`](https://github.com/paritytech/polkadot-sdk/blob/74dafaee5c600fd2c8a59a280f647f94ccf0a755/substrate/client/transaction-pool/api/src/lib.rs#L314)
is now `async`, function was typically used in async context, seems
right to be fully async.

_Note_: expected to be merged after: #8596

---------

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

Fixes #8911

Adds `polkadot_parachain_peer_connectivity` histogram metric to better
understand connectivity patterns.

## Integration

Doesn't affect downstream projects.

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Introduces implementation of `set_up_complex_asset_transfer()` to
correctly benchmark weights for `transfer_assets` extrinsics on Rococo
Coretime and Westend Coretime. Introducing also test scenarios to cover
common xcm teleport use cases

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@Ank4n
Copy link
Copy Markdown
Contributor

Ank4n commented Jun 25, 2025

@sigurpol, @Ank4n

Could you please check why pallet_fast_unstake benchmarks are failing here:

The following 4 benchmarks failed:
- pallet_fast_unstake::deregister
- pallet_fast_unstake::on_idle_check
- pallet_fast_unstake::on_idle_unstake
- pallet_fast_unstake::register_fast_unstake

My best guess is: its a consequence of #8436 and benchmarking code here should be adapted with something like

diff --git a/substrate/frame/fast-unstake/src/benchmarking.rs b/substrate/frame/fast-unstake/src/benchmarking.rs
index db35b1f1b3..11f4bde5ea 100644
--- a/substrate/frame/fast-unstake/src/benchmarking.rs
+++ b/substrate/frame/fast-unstake/src/benchmarking.rs
@@ -51,6 +51,7 @@ fn fund_and_bond_account<T: Config>(account: &T::AccountId) {

        // bond and nominate ourselves, this will guarantee that we are not backing anyone.
        assert_ok!(T::Staking::bond(account, stake, account));
+       assert_ok!(T::Staking::validate(account, Default::default());
        assert_ok!(T::Staking::nominate(account, vec![account.clone()]));
 }

but T::Staking:: doesn't provide validate(..) method. I could probably extend trait StakingInterface with validate() but I lack domain knowledge in this area

Oh shoot, I think this is happening because fast-unstake bench is trying to call pallet-staking (old pallet existing on Westend runtime) but WAH runtime against which this bench is ran does not have pallet-staking, it has pallet-staking-async. I suspect even some other pallet benches (nom pool, delegated staking) will fail on WAH.

What needs to be done is – use new pallets in the bench as well as in the mocks of these pallets. And remove them from Westend.

I was planning to do it here, but currently tied up with other tasks. It makes more sense to make those changes in your PR though. Would you be able take a stab at it?

@sigurpol
Copy link
Copy Markdown
Contributor

If you don't have buffer, I can try to fix them tomorrow, still need to wrap up a couple of tasks today

ggwpez and others added 4 commits June 25, 2025 14:30
The .polkavm files are not recompiled when deleting
`target/pallet-revive-fixtures`. I assume that CI is not caching that
folder or the .polkavm file extension. This leads to the
`include_bytes!` macro to not finding these files.

Tested it here polkadot-fellows/runtimes#785

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Alexander Theißen <alex.theissen@me.com>
# Description

This PR adds the `Instantiated` event for pallet-revive for the top
frame. Addresses issue #8677

This might need refreshing the weights of bot `instantiate` and
`instantiate_with_code`, as it emits a new event.

## Integration

No additional work is needed to integrate this feature. The pallet will
emit on `Instantiated` event every time `instantiate` or
`instantiate_with_code` successfully performs an instantiation.

# 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)
* [x] I have added tests that prove my fix is effective or that my
feature works (if applicable)

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Alexander Theißen <alex.theissen@me.com>
The benchmarks were failing because they were trying to nominate to
accounts that weren't properly registered validators. The PR #8436
correctly added validation to prevent this (fixing a silent failure),
but this broke benchmarks that had invalid setups.

Rather than create complex validator setups, we simply removed
nomination from the benchmarks entirely - which is actually more
realistic for fast-unstake usage patterns: fast-unstake is designed for
accounts that are bonded but **not actively nominating**.
@sigurpol
Copy link
Copy Markdown
Contributor

@sigurpol, @Ank4n
Could you please check why pallet_fast_unstake benchmarks are failing here:

The following 4 benchmarks failed:
- pallet_fast_unstake::deregister
- pallet_fast_unstake::on_idle_check
- pallet_fast_unstake::on_idle_unstake
- pallet_fast_unstake::register_fast_unstake

My best guess is: its a consequence of #8436 and benchmarking code here should be adapted with something like

diff --git a/substrate/frame/fast-unstake/src/benchmarking.rs b/substrate/frame/fast-unstake/src/benchmarking.rs
index db35b1f1b3..11f4bde5ea 100644
--- a/substrate/frame/fast-unstake/src/benchmarking.rs
+++ b/substrate/frame/fast-unstake/src/benchmarking.rs
@@ -51,6 +51,7 @@ fn fund_and_bond_account<T: Config>(account: &T::AccountId) {

        // bond and nominate ourselves, this will guarantee that we are not backing anyone.
        assert_ok!(T::Staking::bond(account, stake, account));
+       assert_ok!(T::Staking::validate(account, Default::default());
        assert_ok!(T::Staking::nominate(account, vec![account.clone()]));
 }

but T::Staking:: doesn't provide validate(..) method. I could probably extend trait StakingInterface with validate() but I lack domain knowledge in this area

Oh shoot, I think this is happening because fast-unstake bench is trying to call pallet-staking (old pallet existing on Westend runtime) but WAH runtime against which this bench is ran does not have pallet-staking, it has pallet-staking-async. I suspect even some other pallet benches (nom pool, delegated staking) will fail on WAH.

What needs to be done is – use new pallets in the bench as well as in the mocks of these pallets. And remove them from Westend.

I was planning to do it here, but currently tied up with other tasks. It makes more sense to make those changes in your PR though. Would you be able take a stab at it?

@Ank4n can you please kindly verify that this fix 07d7925 makes sense ?

My analysis: The benchmarks failed because they attempted to nominate accounts that were not properly registered as validators. #8436 correctly added validation to prevent this, fixing a silent failure. However, this change broke benchmarks with invalid setups. Wdyt?

@Ank4n
Copy link
Copy Markdown
Contributor

Ank4n commented Jun 26, 2025

If you don't have buffer, I can try to fix them tomorrow, still need to wrap up a couple of tasks today

Heads up:

@sigurpol, @Ank4n
Could you please check why pallet_fast_unstake benchmarks are failing here:

The following 4 benchmarks failed:
- pallet_fast_unstake::deregister
- pallet_fast_unstake::on_idle_check
- pallet_fast_unstake::on_idle_unstake
- pallet_fast_unstake::register_fast_unstake

My best guess is: its a consequence of #8436 and benchmarking code here should be adapted with something like

diff --git a/substrate/frame/fast-unstake/src/benchmarking.rs b/substrate/frame/fast-unstake/src/benchmarking.rs
index db35b1f1b3..11f4bde5ea 100644
--- a/substrate/frame/fast-unstake/src/benchmarking.rs
+++ b/substrate/frame/fast-unstake/src/benchmarking.rs
@@ -51,6 +51,7 @@ fn fund_and_bond_account<T: Config>(account: &T::AccountId) {

        // bond and nominate ourselves, this will guarantee that we are not backing anyone.
        assert_ok!(T::Staking::bond(account, stake, account));
+       assert_ok!(T::Staking::validate(account, Default::default());
        assert_ok!(T::Staking::nominate(account, vec![account.clone()]));
 }

but T::Staking:: doesn't provide validate(..) method. I could probably extend trait StakingInterface with validate() but I lack domain knowledge in this area

Oh shoot, I think this is happening because fast-unstake bench is trying to call pallet-staking (old pallet existing on Westend runtime) but WAH runtime against which this bench is ran does not have pallet-staking, it has pallet-staking-async. I suspect even some other pallet benches (nom pool, delegated staking) will fail on WAH.
What needs to be done is – use new pallets in the bench as well as in the mocks of these pallets. And remove them from Westend.
I was planning to do it here, but currently tied up with other tasks. It makes more sense to make those changes in your PR though. Would you be able take a stab at it?

@Ank4n can you please kindly verify that this fix 07d7925 makes sense ?

My analysis: The benchmarks failed because they attempted to nominate accounts that were not properly registered as validators. #8436 correctly added validation to prevent this, fixing a silent failure. However, this change broke benchmarks with invalid setups. Wdyt?

If it passes the tests then all good. I might have been wrong in my last assumption, looking at fast-unstake again, it should be fine since the dependency is via trait `StakingInterface. I am trying to replicate this issue locally.

@sigurpol
Copy link
Copy Markdown
Contributor

If you don't have buffer, I can try to fix them tomorrow, still need to wrap up a couple of tasks today

Heads up:

@sigurpol, @Ank4n
Could you please check why pallet_fast_unstake benchmarks are failing here:

The following 4 benchmarks failed:
- pallet_fast_unstake::deregister
- pallet_fast_unstake::on_idle_check
- pallet_fast_unstake::on_idle_unstake
- pallet_fast_unstake::register_fast_unstake

My best guess is: its a consequence of #8436 and benchmarking code here should be adapted with something like

diff --git a/substrate/frame/fast-unstake/src/benchmarking.rs b/substrate/frame/fast-unstake/src/benchmarking.rs
index db35b1f1b3..11f4bde5ea 100644
--- a/substrate/frame/fast-unstake/src/benchmarking.rs
+++ b/substrate/frame/fast-unstake/src/benchmarking.rs
@@ -51,6 +51,7 @@ fn fund_and_bond_account<T: Config>(account: &T::AccountId) {

        // bond and nominate ourselves, this will guarantee that we are not backing anyone.
        assert_ok!(T::Staking::bond(account, stake, account));
+       assert_ok!(T::Staking::validate(account, Default::default());
        assert_ok!(T::Staking::nominate(account, vec![account.clone()]));
 }

but T::Staking:: doesn't provide validate(..) method. I could probably extend trait StakingInterface with validate() but I lack domain knowledge in this area

Oh shoot, I think this is happening because fast-unstake bench is trying to call pallet-staking (old pallet existing on Westend runtime) but WAH runtime against which this bench is ran does not have pallet-staking, it has pallet-staking-async. I suspect even some other pallet benches (nom pool, delegated staking) will fail on WAH.
What needs to be done is – use new pallets in the bench as well as in the mocks of these pallets. And remove them from Westend.
I was planning to do it here, but currently tied up with other tasks. It makes more sense to make those changes in your PR though. Would you be able take a stab at it?

@Ank4n can you please kindly verify that this fix 07d7925 makes sense ?
My analysis: The benchmarks failed because they attempted to nominate accounts that were not properly registered as validators. #8436 correctly added validation to prevent this, fixing a silent failure. However, this change broke benchmarks with invalid setups. Wdyt?

If it passes the tests then all good. I might have been wrong in my last assumption, looking at fast-unstake again, it should be fine since the dependency is via trait `StakingInterface. I am trying to replicate this issue locally.

But we need to update tests (not benchmarks) under fast-unstake because they are passing JUST because they are relying on staking and not staking-async. Seems out of scope of this PR though so I Would do it in your usual other PR #8807 not to pollute this one

@Ank4n
Copy link
Copy Markdown
Contributor

Ank4n commented Jun 26, 2025

@sigurpol thanks, your fix is all we need here. 🚀

@karolk91 karolk91 requested a review from koute as a code owner June 26, 2025 09:48
ggwpez added 3 commits June 26, 2025 16:36
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
@paritytech-workflow-stopper
Copy link
Copy Markdown

All GitHub workflows were cancelled due to failure one of the required jobs.
Failed workflow url: https://github.com/paritytech/polkadot-sdk/actions/runs/15906183877
Failed job name: test-linux-stable

@ggwpez
Copy link
Copy Markdown
Member

ggwpez commented Jun 26, 2025

Will fix the remaining ones in the other MR.

@ggwpez ggwpez merged commit bcd3aac into donal-ahm Jun 26, 2025
245 of 298 checks passed
@ggwpez ggwpez deleted the kk-fix-conflicts-donal-ahm branch June 26, 2025 16:12
ggwpez added a commit that referenced this pull request Jun 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

R0-no-crate-publish-required The change does not require any crates to be re-published.

Projects

None yet

Development

Successfully merging this pull request may close these issues.