Skip to content

Commit

Permalink
Merge branch 'bko-bump-to-1.6' into rk-coretime
Browse files Browse the repository at this point in the history
  • Loading branch information
bkontur authored Feb 24, 2024
2 parents 7f83cd8 + 5f39fc8 commit 220a28c
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 11 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Add [Encointer](https://encointer.org) system parachain runtime, completing [RFC22](https://github.com/polkadot-fellows/RFCs/blob/main/text/
0022-adopt-encointer-runtime.md) ([polkadot-fellows/runtimes#80](https://github.com/polkadot-fellows/runtimes/pull/80))
- Feature for enabling debug prints in the Polkadot and Kusama runtime ([polkadot-fellows/runtimes#85](https://github.com/polkadot-fellows/runtimes/pull/85))
- Added new "Wish for Change" track ([polkadot-fellows/runtimes#184](https://github.com/polkadot-fellows/runtimes/pull/184))
- Enable Coretime and on-demand on Kusama ([polkadot-fellows/runtimes#159](https://github.com/polkadot-fellows/runtimes/pull/159)

### Changed
Expand All @@ -21,6 +22,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- MMR leaves generated by `pallet_mmr` point to the next-authority-set of the current block instead of the prior block [polkadot-fellows/runtimes#169](https://github.com/polkadot-fellows/runtimes/pull/169)
- Upgrade dependencies to the `polkadot-sdk@1.5.0` release ([polkadot-fellows/runtimes#137](https://github.com/polkadot-fellows/runtimes/pull/137))
- Deprecate the `xcm::body::TREASURER_INDEX` constant and use the standard `Treasury` variant from the `xcm::BodyId` type instead ([polkadot-fellows/runtimes#149](https://github.com/polkadot-fellows/runtimes/pull/149))
- Bump parachains runtime API to v9 in Kusama to enable the `node_features` function [polkadot-fellows/runtimes#194](https://github.com/polkadot-fellows/runtimes/pull/194)
- Upgrade dependencies to the `polkadot-sdk@1.6.0` release ([polkadot-fellows/runtimes#159](https://github.com/polkadot-fellows/runtimes/pull/159))

### Removed
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/emulated/chains/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ decl_test_relay_chains! {
Hrmp: polkadot_runtime::Hrmp,
}
},
#[api_version(8)]
#[api_version(9)]
pub struct Kusama {
genesis = kusama::genesis(),
on_init = (),
Expand Down
3 changes: 3 additions & 0 deletions relay/kusama/src/governance/origins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ pub mod pallet_custom_origins {
Fellowship8Dan,
/// Origin commanded by rank 9 of the Polkadot Fellowship and with a success of 9.
Fellowship9Dan,
/// Origin for signaling that the network wishes for some change.
WishForChange,
}

macro_rules! decl_unit_ensures {
Expand Down Expand Up @@ -128,6 +130,7 @@ pub mod pallet_custom_origins {
ReferendumCanceller,
ReferendumKiller,
WhitelistedCaller,
WishForChange,
FellowshipInitiates: u16 = 0,
Fellows: u16 = 3,
FellowshipExperts: u16 = 5,
Expand Down
17 changes: 16 additions & 1 deletion relay/kusama/src/governance/tracks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const APP_WHITELISTED_CALLER: Curve =
const SUP_WHITELISTED_CALLER: Curve =
Curve::make_reciprocal(1, 28, percent(20), percent(5), percent(50));

const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo<Balance, BlockNumber>); 15] = [
const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo<Balance, BlockNumber>); 16] = [
(
0,
pallet_referenda::TrackInfo {
Expand Down Expand Up @@ -94,6 +94,20 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo<Balance, BlockNumber>); 15
min_support: SUP_WHITELISTED_CALLER,
},
),
(
2,
pallet_referenda::TrackInfo {
name: "wish_for_change",
max_deciding: 10,
decision_deposit: 20 * GRAND,
prepare_period: 2 * HOURS,
decision_period: 14 * DAYS,
confirm_period: 24 * HOURS,
min_enactment_period: 10 * MINUTES,
min_approval: APP_ROOT,
min_support: SUP_ROOT,
},
),
(
10,
pallet_referenda::TrackInfo {
Expand Down Expand Up @@ -294,6 +308,7 @@ impl pallet_referenda::TracksInfo<Balance, BlockNumber> for TracksInfo {
} else if let Ok(custom_origin) = origins::Origin::try_from(id.clone()) {
match custom_origin {
origins::Origin::WhitelistedCaller => Ok(1),
origins::Origin::WishForChange => Ok(2),
// General admin
origins::Origin::StakingAdmin => Ok(10),
origins::Origin::Treasurer => Ok(11),
Expand Down
18 changes: 11 additions & 7 deletions relay/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
use pallet_nis::WithMaximumOf;
use parity_scale_codec::{Decode, Encode, MaxEncodedLen};
use primitives::{
slashing, AccountId, AccountIndex, Balance, BlockNumber, CandidateEvent, CandidateHash,
CommittedCandidateReceipt, CoreState, DisputeState, ExecutorParams, GroupRotationInfo, Hash,
Id as ParaId, InboundDownwardMessage, InboundHrmpMessage, Moment, Nonce,
OccupiedCoreAssumption, PersistedValidationData, ScrapedOnChainVotes, SessionInfo, Signature,
ValidationCode, ValidationCodeHash, ValidatorId, ValidatorIndex, LOWEST_PUBLIC_ID,
PARACHAIN_KEY_TYPE_ID,
slashing, vstaging::NodeFeatures, AccountId, AccountIndex, Balance, BlockNumber,
CandidateEvent, CandidateHash, CommittedCandidateReceipt, CoreState, DisputeState,
ExecutorParams, GroupRotationInfo, Hash, Id as ParaId, InboundDownwardMessage,
InboundHrmpMessage, Moment, Nonce, OccupiedCoreAssumption, PersistedValidationData,
ScrapedOnChainVotes, SessionInfo, Signature, ValidationCode, ValidationCodeHash, ValidatorId,
ValidatorIndex, LOWEST_PUBLIC_ID, PARACHAIN_KEY_TYPE_ID,
};
use runtime_common::{
auctions, claims, crowdloan, impl_runtime_weights,
Expand Down Expand Up @@ -1899,7 +1899,7 @@ sp_api::impl_runtime_apis! {
}
}

#[api_version(8)]
#[api_version(9)]
impl primitives::runtime_api::ParachainHost<Block> for Runtime {
fn validators() -> Vec<ValidatorId> {
parachains_runtime_api_impl::validators::<Runtime>()
Expand Down Expand Up @@ -2046,6 +2046,10 @@ sp_api::impl_runtime_apis! {
fn disabled_validators() -> Vec<ValidatorIndex> {
parachains_vstaging_api_impl::disabled_validators::<Runtime>()
}

fn node_features() -> NodeFeatures {
parachains_vstaging_api_impl::node_features::<Runtime>()
}
}

impl beefy_primitives::BeefyApi<Block, BeefyId> for Runtime {
Expand Down
3 changes: 3 additions & 0 deletions relay/polkadot/src/governance/origins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ pub mod pallet_custom_origins {
BigSpender,
/// Origin able to dispatch a whitelisted call.
WhitelistedCaller,
/// Origin for signaling that the network wishes for some change.
WishForChange,
}

macro_rules! decl_unit_ensures {
Expand Down Expand Up @@ -103,6 +105,7 @@ pub mod pallet_custom_origins {
ReferendumCanceller,
ReferendumKiller,
WhitelistedCaller,
WishForChange,
);

macro_rules! decl_ensure {
Expand Down
17 changes: 16 additions & 1 deletion relay/polkadot/src/governance/tracks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const APP_WHITELISTED_CALLER: Curve =
const SUP_WHITELISTED_CALLER: Curve =
Curve::make_reciprocal(1, 28, percent(20), percent(5), percent(50));

const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo<Balance, BlockNumber>); 15] = [
const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo<Balance, BlockNumber>); 16] = [
(
0,
pallet_referenda::TrackInfo {
Expand Down Expand Up @@ -94,6 +94,20 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo<Balance, BlockNumber>); 15
min_support: SUP_WHITELISTED_CALLER,
},
),
(
2,
pallet_referenda::TrackInfo {
name: "wish_for_change",
max_deciding: 10,
decision_deposit: 20 * GRAND,
prepare_period: 2 * HOURS,
decision_period: 28 * DAYS,
confirm_period: 24 * HOURS,
min_enactment_period: 10 * MINUTES,
min_approval: APP_ROOT,
min_support: SUP_ROOT,
},
),
(
10,
pallet_referenda::TrackInfo {
Expand Down Expand Up @@ -294,6 +308,7 @@ impl pallet_referenda::TracksInfo<Balance, BlockNumber> for TracksInfo {
} else if let Ok(custom_origin) = origins::Origin::try_from(id.clone()) {
match custom_origin {
origins::Origin::WhitelistedCaller => Ok(1),
origins::Origin::WishForChange => Ok(2),
// General admin
origins::Origin::StakingAdmin => Ok(10),
origins::Origin::Treasurer => Ok(11),
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 @@ -360,7 +360,7 @@ impl pallet_asset_conversion::Config for Runtime {
type LiquidityWithdrawalFee = LiquidityWithdrawalFee;
type LPFee = ConstU32<3>;
type PalletId = AssetConversionPalletId;
type MaxSwapPathLength = ConstU32<4>;
type MaxSwapPathLength = ConstU32<3>;
type MintMinLiquidity = ConstU128<100>;
type WeightInfo = weights::pallet_asset_conversion::WeightInfo<Runtime>;
#[cfg(feature = "runtime-benchmarks")]
Expand Down

0 comments on commit 220a28c

Please sign in to comment.