Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Changelog for the runtimes governed by the Polkadot Fellowship.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [Unreleased]
## [1.9.2] 08.10.2025

### Added

Expand All @@ -17,6 +17,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- [AHM] Fix crowdloan withdrawing and weight limit ([polkadot-fellows/runtimes/pull/943](https://github.com/polkadot-fellows/runtimes/pull/943))
- [Encointer] Fix remote treasury payout on asset hub ([polkadot-fellows/runtimes/pull/944](https://github.com/polkadot-fellows/runtimes/pull/944))
- [AHM] Post Kusama Migration cleanup ([polkadot-fellows/runtimes/pull/946](https://github.com/polkadot-fellows/runtimes/pull/946))
- [AHM] Improve StakingAsync's VMP Messaging (https://github.com/polkadot-fellows/runtimes/pull/950)

## [1.9.1] 30.09.2025

Expand Down
14 changes: 7 additions & 7 deletions Cargo.lock

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

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pallet-ah-migrator = { path = "pallets/ah-migrator", default-features = false }
pallet-rc-migrator = { path = "pallets/rc-migrator", default-features = false }
pallet-ah-ops = { path = "pallets/ah-ops", default-features = false }
pallet-election-provider-multi-block = { version = "0.3.2", default-features = false }
pallet-staking-async = { version = "0.4.2", default-features = false }
pallet-staking-async = { version = "0.6.0", default-features = false }
hex = { version = "0.4.3", default-features = false }
rand = { version = "0.9.2" }
impl-trait-for-tuples = { version = "0.2.3", default-features = false }
Expand Down Expand Up @@ -163,8 +163,8 @@ pallet-session-benchmarking = { version = "42.0.0", default-features = false }
pallet-society = { version = "42.2.0", default-features = false }
pallet-staking = { version = "42.0.0", default-features = false }
pallet-delegated-staking = { version = "9.0.0", default-features = false }
pallet-staking-async-ah-client = { version = "0.3.0", default-features = false }
pallet-staking-async-rc-client = { version = "0.3.0", default-features = false }
pallet-staking-async-ah-client = { version = "0.5.0", default-features = false }
pallet-staking-async-rc-client = { version = "0.5.0", default-features = false }
pallet-staking-reward-curve = { version = "12.0.0" }
pallet-staking-reward-fn = { version = "24.0.0", default-features = false }
pallet-staking-runtime-api = { version = "28.0.0", default-features = false }
Expand Down
85 changes: 46 additions & 39 deletions relay/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ pub use pallet_election_provider_multi_phase::{Call as EPMCall, GeometricDeposit
use pallet_grandpa::{fg_primitives, AuthorityId as GrandpaId};
use pallet_session::historical as session_historical;
use pallet_staking::UseValidatorsMap;
use pallet_staking_async_ah_client as ah_client;
use pallet_staking_async_rc_client as rc_client;
use pallet_transaction_payment::{FeeDetails, FungibleAdapter, RuntimeDispatchInfo};
use pallet_treasury::TreasuryAccountId;
use pallet_xcm::{EnsureXcm, IsVoiceOfBody};
Expand Down Expand Up @@ -188,7 +190,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: alloc::borrow::Cow::Borrowed("kusama"),
impl_name: alloc::borrow::Cow::Borrowed("parity-kusama"),
authoring_version: 2,
spec_version: 1_009_001,
spec_version: 1_009_002,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 26,
Expand Down Expand Up @@ -1771,7 +1773,9 @@ impl pallet_staking_async_ah_client::Config for Runtime {
type PointsPerBlock = ConstU32<20>;
type MaxOffenceBatchSize = ConstU32<32>;
type Fallback = Staking;
type WeightInfo = pallet_staking_async_ah_client::weights::SubstrateWeight<Runtime>;
type MaximumValidatorsWithPoints = ConstU32<{ MaxActiveValidators::get() * 2 }>;
// Session length is 1h, we retry for about 6m.
type MaxSessionReportRetries = ConstU32<64>;
}

pub struct EnsureAssetHub;
Expand Down Expand Up @@ -1803,19 +1807,15 @@ enum AssetHubRuntimePallets<AccountId> {

#[derive(Encode, Decode)]
enum RcClientCalls<AccountId> {
// TODO @kianenigma: double check the call indices after https://github.com/paritytech/polkadot-sdk/pull/9619/files.
// RelayNewOffence is removed, RelayNewOffencePaged is new, and is still in index 1
#[codec(index = 0)]
RelaySessionReport(pallet_staking_async_rc_client::SessionReport<AccountId>),
RelaySessionReport(rc_client::SessionReport<AccountId>),
#[codec(index = 1)]
RelayNewOffence(SessionIndex, Vec<pallet_staking_async_rc_client::Offence<AccountId>>),
RelayNewOffencePaged(Vec<(SessionIndex, rc_client::Offence<AccountId>)>),
}

pub struct SessionReportToXcm;
impl sp_runtime::traits::Convert<pallet_staking_async_rc_client::SessionReport<AccountId>, Xcm<()>>
for SessionReportToXcm
{
fn convert(a: pallet_staking_async_rc_client::SessionReport<AccountId>) -> Xcm<()> {
impl Convert<rc_client::SessionReport<AccountId>, Xcm<()>> for SessionReportToXcm {
fn convert(a: rc_client::SessionReport<AccountId>) -> Xcm<()> {
Xcm(vec![
Instruction::UnpaidExecution {
weight_limit: WeightLimit::Unlimited,
Expand All @@ -1832,47 +1832,51 @@ impl sp_runtime::traits::Convert<pallet_staking_async_rc_client::SessionReport<A
}
}

pub struct StakingXcmToAssetHub;
impl pallet_staking_async_ah_client::SendToAssetHub for StakingXcmToAssetHub {
type AccountId = AccountId;

fn relay_session_report(
session_report: pallet_staking_async_rc_client::SessionReport<Self::AccountId>,
) {
// TODO: after https://github.com/paritytech/polkadot-sdk/pull/9619, use `XCMSender::send` and handle error
let message = SessionReportToXcm::convert(session_report);
let dest = AssetHubLocation::get();
let _ = xcm::prelude::send_xcm::<xcm_config::XcmRouter>(dest, message).inspect_err(|err| {
log::error!(target: "runtime::ah-client", "Failed to send relay session report: {err:?}");
});
}

fn relay_new_offence(
session_index: SessionIndex,
offences: Vec<pallet_staking_async_rc_client::Offence<Self::AccountId>>,
) {
let message = Xcm(vec![
pub struct QueuedOffenceToXcm;
impl Convert<Vec<ah_client::QueuedOffenceOf<Runtime>>, Xcm<()>> for QueuedOffenceToXcm {
fn convert(offences: Vec<ah_client::QueuedOffenceOf<Runtime>>) -> Xcm<()> {
Xcm(vec![
Instruction::UnpaidExecution {
weight_limit: WeightLimit::Unlimited,
check_origin: None,
},
Instruction::Transact {
origin_kind: OriginKind::Superuser,
fallback_max_weight: None,
call: AssetHubRuntimePallets::RcClient(RcClientCalls::RelayNewOffence(
session_index,
call: AssetHubRuntimePallets::RcClient(RcClientCalls::RelayNewOffencePaged(
offences,
))
.encode()
.into(),
},
]);
// TODO: after https://github.com/paritytech/polkadot-sdk/pull/9619, use `XCMSender::send` and handle error
let _ = send_xcm::<xcm_config::XcmRouter>(AssetHubLocation::get(), message).inspect_err(
|err| {
log::error!(target: "runtime::ah-client", "Failed to send relay offence message: {err:?}");
},
);
])
}
}

pub struct StakingXcmToAssetHub;
impl pallet_staking_async_ah_client::SendToAssetHub for StakingXcmToAssetHub {
type AccountId = AccountId;

fn relay_session_report(
session_report: rc_client::SessionReport<Self::AccountId>,
) -> Result<(), ()> {
rc_client::XCMSender::<
xcm_config::XcmRouter,
AssetHubLocation,
rc_client::SessionReport<AccountId>,
SessionReportToXcm,
>::send(session_report)
}

fn relay_new_offence_paged(
offences: Vec<ah_client::QueuedOffenceOf<Runtime>>,
) -> Result<(), ()> {
rc_client::XCMSender::<
xcm_config::XcmRouter,
AssetHubLocation,
Vec<ah_client::QueuedOffenceOf<Runtime>>,
QueuedOffenceToXcm,
>::send(offences)
}
}

Expand Down Expand Up @@ -3727,6 +3731,9 @@ mod remote_tests {

#[tokio::test]
async fn next_inflation() {
if var("REMOTE_TESTS").is_err() {
return;
}
use hex_literal::hex;
sp_tracing::try_init_simple();
let transport: Transport =
Expand Down
83 changes: 46 additions & 37 deletions relay/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ use polkadot_runtime_common::{
};
use sp_runtime::traits::Convert;

use pallet_staking_async_ah_client as ah_client;
use pallet_staking_async_rc_client as rc_client;
use relay_common::apis::InflationInfo;
use runtime_parachains::{
assigner_coretime as parachains_assigner_coretime, configuration as parachains_configuration,
Expand Down Expand Up @@ -175,7 +177,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: alloc::borrow::Cow::Borrowed("polkadot"),
impl_name: alloc::borrow::Cow::Borrowed("parity-polkadot"),
authoring_version: 0,
spec_version: 1_009_001,
spec_version: 1_009_002,
Comment thread
ggwpez marked this conversation as resolved.
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 26,
Expand Down Expand Up @@ -1556,7 +1558,9 @@ impl pallet_staking_async_ah_client::Config for Runtime {
type PointsPerBlock = ConstU32<20>;
type MaxOffenceBatchSize = ConstU32<32>;
type Fallback = Staking;
type WeightInfo = pallet_staking_async_ah_client::weights::SubstrateWeight<Runtime>;
type MaximumValidatorsWithPoints = ConstU32<{ MaxActiveValidators::get() * 2 }>;
// Session length is 4h, we retry for about 6m.
type MaxSessionReportRetries = ConstU32<64>;
}

pub struct EnsureAssetHub;
Expand Down Expand Up @@ -1589,16 +1593,14 @@ enum AssetHubRuntimePallets<AccountId> {
#[derive(Encode, Decode)]
enum RcClientCalls<AccountId> {
#[codec(index = 0)]
RelaySessionReport(pallet_staking_async_rc_client::SessionReport<AccountId>),
RelaySessionReport(rc_client::SessionReport<AccountId>),
#[codec(index = 1)]
RelayNewOffence(SessionIndex, Vec<pallet_staking_async_rc_client::Offence<AccountId>>),
RelayNewOffencePaged(Vec<(SessionIndex, rc_client::Offence<AccountId>)>),
}

pub struct SessionReportToXcm;
impl sp_runtime::traits::Convert<pallet_staking_async_rc_client::SessionReport<AccountId>, Xcm<()>>
for SessionReportToXcm
{
fn convert(a: pallet_staking_async_rc_client::SessionReport<AccountId>) -> Xcm<()> {
impl Convert<rc_client::SessionReport<AccountId>, Xcm<()>> for SessionReportToXcm {
fn convert(a: rc_client::SessionReport<AccountId>) -> Xcm<()> {
Xcm(vec![
Instruction::UnpaidExecution {
weight_limit: WeightLimit::Unlimited,
Expand All @@ -1615,47 +1617,51 @@ impl sp_runtime::traits::Convert<pallet_staking_async_rc_client::SessionReport<A
}
}

pub struct StakingXcmToAssetHub;
impl pallet_staking_async_ah_client::SendToAssetHub for StakingXcmToAssetHub {
type AccountId = AccountId;

fn relay_session_report(
session_report: pallet_staking_async_rc_client::SessionReport<Self::AccountId>,
) {
// TODO: after https://github.com/paritytech/polkadot-sdk/pull/9619, use `XCMSender::send` and handle error
let message = SessionReportToXcm::convert(session_report);
let dest = AssetHubLocation::get();
let _ = xcm::prelude::send_xcm::<xcm_config::XcmRouter>(dest, message).inspect_err(|err| {
log::error!(target: "runtime::ah-client", "Failed to send relay session report: {err:?}");
});
}

fn relay_new_offence(
session_index: SessionIndex,
offences: Vec<pallet_staking_async_rc_client::Offence<Self::AccountId>>,
) {
let message = Xcm(vec![
pub struct QueuedOffenceToXcm;
impl Convert<Vec<ah_client::QueuedOffenceOf<Runtime>>, Xcm<()>> for QueuedOffenceToXcm {
fn convert(offences: Vec<ah_client::QueuedOffenceOf<Runtime>>) -> Xcm<()> {
Xcm(vec![
Instruction::UnpaidExecution {
weight_limit: WeightLimit::Unlimited,
check_origin: None,
},
Instruction::Transact {
origin_kind: OriginKind::Superuser,
fallback_max_weight: None,
call: AssetHubRuntimePallets::RcClient(RcClientCalls::RelayNewOffence(
session_index,
call: AssetHubRuntimePallets::RcClient(RcClientCalls::RelayNewOffencePaged(
offences,
))
.encode()
.into(),
},
]);
// TODO: after https://github.com/paritytech/polkadot-sdk/pull/9619, use `XCMSender::send` and handle error
let _ = send_xcm::<xcm_config::XcmRouter>(AssetHubLocation::get(), message).inspect_err(
|err| {
log::error!(target: "runtime::ah-client", "Failed to send relay offence message: {err:?}");
},
);
])
}
}

pub struct StakingXcmToAssetHub;
impl ah_client::SendToAssetHub for StakingXcmToAssetHub {
type AccountId = AccountId;

fn relay_session_report(
session_report: rc_client::SessionReport<Self::AccountId>,
) -> Result<(), ()> {
rc_client::XCMSender::<
xcm_config::XcmRouter,
AssetHubLocation,
rc_client::SessionReport<AccountId>,
SessionReportToXcm,
>::send(session_report)
}

fn relay_new_offence_paged(
offences: Vec<ah_client::QueuedOffenceOf<Runtime>>,
) -> Result<(), ()> {
rc_client::XCMSender::<
xcm_config::XcmRouter,
AssetHubLocation,
Vec<ah_client::QueuedOffenceOf<Runtime>>,
QueuedOffenceToXcm,
>::send(offences)
}
}

Expand Down Expand Up @@ -3509,6 +3515,9 @@ mod remote_tests {

#[tokio::test]
async fn next_inflation() {
if var("REMOTE_TESTS").is_err() {
return;
}
use hex_literal::hex;
sp_tracing::try_init_simple();
let transport: Transport =
Expand Down
2 changes: 1 addition & 1 deletion system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: Cow::Borrowed("statemine"),
impl_name: Cow::Borrowed("statemine"),
authoring_version: 1,
spec_version: 1_009_001,
spec_version: 1_009_002,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 15,
Expand Down
Loading
Loading