Skip to content
Merged
Show file tree
Hide file tree
Changes from 49 commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
dc9400a
session/staking/westend AH and RC: allow to set/purge session keys vi…
sigurpol Dec 15, 2025
0955884
ah-client: proper weight for set_keys_from_ah, purge_keys_from_ah
sigurpol Dec 17, 2025
3e86054
staking-async/rc-client: improve documentation
sigurpol Dec 17, 2025
1c09588
staking-async-rc-client: only validators are allowed to set/purge keys
sigurpol Dec 18, 2025
9b76270
fix prdoc
sigurpol Dec 18, 2025
4dd074b
staking-async-rc-client: session keys as raw bytes
sigurpol Dec 18, 2025
45a7526
staking-async-rc-client: improve documentation
sigurpol Dec 18, 2025
d36a42c
improve prdoc
sigurpol Dec 18, 2025
5064a6c
staking-async/ah: add unit testss
sigurpol Dec 18, 2025
619ec8a
staking-async/rc: add unit tests
sigurpol Dec 18, 2025
668f7a3
staking-async/ah: add e2e test
sigurpol Dec 18, 2025
e5b2ef8
staking-async/ah: more tests
sigurpol Dec 18, 2025
fe233b0
session keys and ownership proof fully validated on AH
sigurpol Dec 19, 2025
5fd5a0c
Merge branch 'master' into sigurpol-session-keys-asset-hub
sigurpol Dec 19, 2025
d4c3f2f
Updated ownership_proof_is_valid call to use the new 2 arg signature
sigurpol Dec 19, 2025
96a5e00
more tests
sigurpol Dec 19, 2025
bcd7664
Merge branch 'master' into sigurpol-session-keys-asset-hub
sigurpol Dec 24, 2025
e4af53f
staking-async: fix CI
sigurpol Dec 24, 2025
0a13bb5
asset-hub-westend: add support for staking proxy
sigurpol Dec 24, 2025
294704e
staking-async: tests around staking proxy
sigurpol Dec 24, 2025
b28ced4
asset-hub-westend: test keys match between AH and RC
sigurpol Dec 24, 2025
a498cbb
staking-async/rc: add benchmarks for set/purge_keys
sigurpol Dec 26, 2025
3519aef
Merge branch 'master' into sigurpol-session-keys-asset-hub
sigurpol Dec 26, 2025
fa76173
staking-async/rc: bounded vec for set_keys
sigurpol Dec 26, 2025
be0cd04
Update from github-actions[bot] running command 'bench --pallet palle…
github-actions[bot] Dec 26, 2025
23f49e5
Cleanup
sigurpol Dec 26, 2025
95d37aa
Merge branch 'master' into sigurpol-session-keys-asset-hub
Ank4n Dec 30, 2025
93e82f8
staking-async/rc: remove check on validator in purge_keys
sigurpol Dec 31, 2025
e0f8374
asset-hub-westend: missing weights + cleanup
sigurpol Dec 31, 2025
627348c
pallet-session: add a trait for managing session keys
sigurpol Dec 31, 2025
9978796
pallet-session: add SessionInterface trait for better decoupling with…
sigurpol Dec 31, 2025
e0eb51a
Update from github-actions[bot] running command 'bench --pallet palle…
github-actions[bot] Dec 31, 2025
7b7b349
staking-async/ah-client: add Unexpected(InvalidKeysFromAssetHub event
sigurpol Dec 31, 2025
e17be07
westend/staking-async runtime: fix SessionInterface config
sigurpol Dec 31, 2025
6b2d6cb
pallet-session: remove SessionKeyManager and make do_set/purge_keys p…
sigurpol Dec 31, 2025
b2f8e36
pallet-session: SessionInterface feature-gated with historical
sigurpol Dec 31, 2025
796f268
staking/rc-client: handle XCM fees
sigurpol Jan 6, 2026
e990a3e
staking-async/rc-client: proper benchmark XCM in set/purge_keys
sigurpol Jan 6, 2026
c57ca8c
Merge branch 'master' into sigurpol-session-keys-asset-hub
sigurpol Jan 6, 2026
e1210a9
staking-async/rc-client: cleanup
sigurpol Jan 6, 2026
a19df4c
Update from github-actions[bot] running command 'bench --pallet palle…
github-actions[bot] Jan 6, 2026
70391e3
ahm-test: cleanup
sigurpol Jan 7, 2026
d4c47db
staking-async/rc-client: improve documentation
sigurpol Jan 8, 2026
2f42e83
Merge branch 'master' into sigurpol-session-keys-asset-hub
sigurpol Jan 8, 2026
4ce53b9
Fix review comments
sigurpol Jan 9, 2026
6b3ad41
Fix remaining review comments
sigurpol Jan 9, 2026
a74d143
Merge branch 'master' into sigurpol-session-keys-asset-hub
sigurpol Jan 9, 2026
3bff2f5
Fix merge conflict in asset-hub-westend tests
sigurpol Jan 9, 2026
c4ac31f
Update from github-actions[bot] running command 'bench --pallet palle…
github-actions[bot] Jan 9, 2026
f8656fc
Merge remote-tracking branch 'origin/master' into sigurpol-session-ke…
sigurpol Jan 15, 2026
42b10fb
[staking-async] Abstract XCM from SendToRelayChain trait
sigurpol Jan 15, 2026
436e598
SessionInterface: set/purge_keys bypass deposit holds and consumer re…
sigurpol Jan 15, 2026
aab20e1
fee rework
sigurpol Jan 16, 2026
19d443a
staking-async: mock cleanup
sigurpol Jan 16, 2026
709fd3c
staking-async/rc-client: fix benchmark
sigurpol Jan 16, 2026
ccbe701
Update from github-actions[bot] running command 'bench --pallet palle…
github-actions[bot] Jan 16, 2026
5807eb1
wrap fee charging and delivery in a transaction
sigurpol Jan 18, 2026
7e22c64
Merge remote-tracking branch 'origin/master' into sigurpol-session-ke…
sigurpol Jan 19, 2026
c747ad8
fix prdoc vs semver: breaking changes only for ah/rc-client
sigurpol Jan 20, 2026
e262839
fix prdoc vs semver
sigurpol Jan 20, 2026
d458a78
Merge branch 'master' into sigurpol-session-keys-asset-hub
sigurpol Jan 20, 2026
a247b4d
Fix review comments
sigurpol Jan 20, 2026
4963b1f
Merge branch 'master' into sigurpol-session-keys-asset-hub
sigurpol Jan 20, 2026
9b840ca
staking-async/rc-client: improve doc around fees
sigurpol Jan 20, 2026
88616fe
Merge branch 'master' into sigurpol-session-keys-asset-hub
sigurpol Jan 20, 2026
7d62d55
Merge remote-tracking branch 'origin/master' into sigurpol-session-ke…
sigurpol Jan 21, 2026
45342f2
Fix review comments
sigurpol Jan 21, 2026
b0f0a46
Fix more review comments
sigurpol Jan 21, 2026
f4b92b3
Revert transaction wrapper
sigurpol Jan 21, 2026
90a06a2
staking-async: use realistic keys in testnet runtime
sigurpol Jan 21, 2026
d0d034b
staking-async/papi_test: add test to set and purge keys
sigurpol Jan 21, 2026
b686e91
Added SessionKeysUpdated event to ah-client pallet
sigurpol Jan 21, 2026
30c8ba9
staking-async: handle fees in the test runtime
sigurpol Jan 21, 2026
91ad234
stakig-async: rc-client cleanup to easily integrate runtimes
sigurpol Jan 21, 2026
962ea91
Merge branch 'master' into sigurpol-session-keys-asset-hub
sigurpol Jan 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions cumulus/parachains/runtimes/assets/asset-hub-westend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ sp-storage = { workspace = true }
sp-transaction-pool = { workspace = true }
sp-version = { workspace = true }

# Consensus primitives for Relay Chain SessionKeys validation
sp-authority-discovery = { workspace = true }
sp-consensus-babe = { workspace = true }
sp-consensus-beefy = { workspace = true }
sp-consensus-grandpa = { workspace = true }

# num-traits feature needed for dex integer sq root:
primitive-types = { features = ["codec", "num-traits", "scale-info"], workspace = true }

Expand All @@ -102,6 +108,7 @@ pallet-xcm = { workspace = true }
pallet-xcm-benchmarks = { optional = true, workspace = true }
pallet-xcm-precompiles = { workspace = true }
polkadot-parachain-primitives = { workspace = true }
polkadot-primitives = { workspace = true }
polkadot-runtime-common = { workspace = true }
westend-runtime-constants = { workspace = true }
xcm = { workspace = true }
Expand Down Expand Up @@ -142,6 +149,7 @@ asset-test-utils = { workspace = true, default-features = true }
pallet-revive-fixtures = { workspace = true, default-features = true }
parachains-runtimes-test-utils = { workspace = true, default-features = true }
sp-tracing = { workspace = true, default-features = true }
westend-runtime = { workspace = true, default-features = true }

[build-dependencies]
substrate-wasm-builder = { optional = true, workspace = true, default-features = true }
Expand Down Expand Up @@ -209,12 +217,14 @@ runtime-benchmarks = [
"pallet-xcm/runtime-benchmarks",
"parachains-common/runtime-benchmarks",
"polkadot-parachain-primitives/runtime-benchmarks",
"polkadot-primitives/runtime-benchmarks",
"polkadot-runtime-common/runtime-benchmarks",
"snowbridge-pallet-system-frontend/runtime-benchmarks",
"snowbridge-runtime-common/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"sp-staking/runtime-benchmarks",
"westend-runtime-constants/runtime-benchmarks",
"westend-runtime/runtime-benchmarks",
"xcm-builder/runtime-benchmarks",
"xcm-executor/runtime-benchmarks",
"xcm-runtime-apis/runtime-benchmarks",
Expand Down Expand Up @@ -286,6 +296,7 @@ try-runtime = [
"snowbridge-pallet-system-frontend/try-runtime",
"snowbridge-runtime-common/try-runtime",
"sp-runtime/try-runtime",
"westend-runtime/try-runtime",
]
std = [
"alloy-core/std",
Expand Down Expand Up @@ -369,6 +380,7 @@ std = [
"parachain-info/std",
"parachains-common/std",
"polkadot-parachain-primitives/std",
"polkadot-primitives/std",
"polkadot-runtime-common/std",
"primitive-types/std",
"scale-info/std",
Expand All @@ -378,8 +390,12 @@ std = [
"snowbridge-runtime-common/std",
"sp-api/std",
"sp-arithmetic/std",
"sp-authority-discovery/std",
"sp-block-builder/std",
"sp-consensus-aura/std",
"sp-consensus-babe/std",
"sp-consensus-beefy/std",
"sp-consensus-grandpa/std",
"sp-core/std",
"sp-genesis-builder/std",
"sp-inherents/std",
Expand Down
56 changes: 52 additions & 4 deletions cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ mod bag_thresholds;
pub mod governance;
#[cfg(not(feature = "runtime-benchmarks"))]
mod migrations;
mod staking;
pub mod staking;

use governance::{pallet_custom_origins, FellowshipAdmin, GeneralAdmin, StakingAdmin, Treasurer};

Expand Down Expand Up @@ -692,8 +692,8 @@ pub enum ProxyType {
Governance,
/// Allows access to staking related calls.
///
/// Contains the `Staking`, `Session`, `Utility`, `FastUnstake`, `VoterList`, `NominationPools`
/// pallets.
/// Contains the `Staking`, `StakingRcClient`, `Session`, `Utility`, `VoterList`,
/// `NominationPools` pallets.
Staking,
/// Allows access to nomination pools related calls.
///
Expand Down Expand Up @@ -839,6 +839,7 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
matches!(
c,
RuntimeCall::Staking(..) |
RuntimeCall::StakingRcClient(..) |
RuntimeCall::Session(..) |
RuntimeCall::Utility(..) |
RuntimeCall::NominationPools(..) |
Expand Down Expand Up @@ -1678,6 +1679,9 @@ impl
}
}

#[cfg(feature = "runtime-benchmarks")]
type StakingRcClientBench<T> = pallet_staking_async_rc_client::benchmarking::Pallet<T>;

#[cfg(feature = "runtime-benchmarks")]
mod benches {
frame_benchmarking::define_benchmarks!(
Expand Down Expand Up @@ -1707,6 +1711,7 @@ mod benches {
[pallet_proxy, Proxy]
[pallet_session, SessionBench::<Runtime>]
[pallet_staking_async, Staking]
[pallet_staking_async_rc_client, StakingRcClientBench::<Runtime>]
[pallet_uniques, Uniques]
[pallet_utility, Utility]
[pallet_timestamp, Timestamp]
Expand Down Expand Up @@ -2233,7 +2238,8 @@ pallet_revive::impl_runtime_apis_plus_revive_traits!(
(keys.keys, keys.proof.encode())
}
}
use xcm_config::{MaxAssetsIntoHolding, WestendLocation};

use xcm_config::{MaxAssetsIntoHolding, WestendLocation, PriceForParentDelivery};
use testnet_parachains_constants::westend::locations::{PeopleParaId, PeopleLocation};
parameter_types! {
pub ExistentialDepositAsset: Option<Asset> = Some((
Expand All @@ -2244,6 +2250,48 @@ pallet_revive::impl_runtime_apis_plus_revive_traits!(
pub RandomParaId: ParaId = ParaId::new(43211234);
}

impl pallet_staking_async_rc_client::benchmarking::Config for Runtime {
type DeliveryHelper = cumulus_primitives_utility::ToParentDeliveryHelper<
xcm_config::XcmConfig,
ExistentialDepositAsset,
PriceForParentDelivery,
>;

fn account_to_location(account: Self::AccountId) -> Location {
[AccountId32 { network: None, id: account.into() }].into()
}

fn generate_session_keys_and_proof(owner: Self::AccountId) -> (Vec<u8>, Vec<u8>) {
use staking::RelayChainSessionKeys;
let keys = RelayChainSessionKeys::generate(&owner.encode(), None);
(keys.keys.encode(), keys.proof.encode())
}

fn setup_validator() -> Self::AccountId {
use frame_benchmarking::account;
use frame_support::traits::fungible::Mutate;

let stash: Self::AccountId = account("validator", 0, 0);
let balance = 10_000 * UNITS;

// Fund the account
let _ = Balances::mint_into(&stash, balance);

// Bond and validate
assert_ok!(Staking::bond(
RuntimeOrigin::signed(stash.clone()),
balance / 2,
pallet_staking_async::RewardDestination::Stash
));
assert_ok!(Staking::validate(
RuntimeOrigin::signed(stash.clone()),
pallet_staking_async::ValidatorPrefs::default()
));

stash
}
}

use pallet_xcm::benchmarking::Pallet as PalletXcmExtrinsicsBenchmark;
impl pallet_xcm::benchmarking::Config for Runtime {
type DeliveryHelper = (
Expand Down
Loading
Loading