Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into enable-async-backin…
Browse files Browse the repository at this point in the history
…g-system-parachains
  • Loading branch information
s0me0ne-unkn0wn committed Apr 19, 2024
2 parents a536437 + 31ba262 commit 2f905db
Show file tree
Hide file tree
Showing 13 changed files with 610 additions and 25 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,20 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [Unreleased]

### Added

- Add `pallet-vesting` to Asset Hubs ([polkadot-fellows/runtimes#269](https://github.com/polkadot-fellows/runtimes/pull/269))

### Changed

- Enable async backing for system parachains ([polkadot-fellows/runtimes#266](https://github.com/polkadot-fellows/runtimes/pull/266))

## [1.2.1] 09.04.2024

### Changed

- Modify runtimes for phase two of People Chain launch (Kusama) ([polkadot-fellows/runtimes#246](https://github.com/polkadot-fellows/runtimes/pull/246))

## [1.2.0] 28.03.2024

### Added
Expand Down
2 changes: 2 additions & 0 deletions Cargo.lock

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

Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,7 @@ fn assert_reap_id_relay(total_deposit: Balance, id: &Identity) {

assert_ok!(KusamaIdentityMigrator::reap_identity(
// Note: Root for launch testing, Signed once we open migrations.
KusamaOrigin::root(),
// KusamaOrigin::signed(KusamaRelaySender::get()),
KusamaOrigin::signed(KusamaRelaySender::get()),
KusamaRelaySender::get()
));

Expand Down
7 changes: 3 additions & 4 deletions relay/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ use frame_support::{
weights::{ConstantMultiplier, WeightMeter},
PalletId,
};
use frame_system::EnsureRoot;
use frame_system::{EnsureRoot, EnsureSigned};
use pallet_grandpa::{fg_primitives, AuthorityId as GrandpaId};
use pallet_identity::legacy::IdentityInfo;
use pallet_session::historical as session_historical;
Expand Down Expand Up @@ -160,7 +160,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("kusama"),
impl_name: create_runtime_str!("parity-kusama"),
authoring_version: 2,
spec_version: 1_002_000,
spec_version: 1_002_001,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 25,
Expand Down Expand Up @@ -1000,8 +1000,7 @@ impl pallet_identity::Config for Runtime {

impl identity_migrator::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
// To be updated to `EnsureSigned` once the parachain is producing blocks.
type Reaper = EnsureRoot<AccountId>;
type Reaper = EnsureSigned<AccountId>;
type ReapIdentityHandler = impls::ToParachainIdentityReaper<Runtime, Self::AccountId>;
type WeightInfo = weights::runtime_common_identity_migrator::WeightInfo<Runtime>;
}
Expand Down
4 changes: 4 additions & 0 deletions system-parachains/asset-hubs/asset-hub-kusama/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ pallet-transaction-payment = { workspace = true }
pallet-transaction-payment-rpc-runtime-api = { workspace = true }
pallet-uniques = { workspace = true }
pallet-utility = { workspace = true }
pallet-vesting = { workspace = true }
sp-api = { workspace = true }
sp-block-builder = { workspace = true }
sp-consensus-aura = { workspace = true }
Expand Down Expand Up @@ -138,6 +139,7 @@ runtime-benchmarks = [
"pallet-timestamp/runtime-benchmarks",
"pallet-uniques/runtime-benchmarks",
"pallet-utility/runtime-benchmarks",
"pallet-vesting/runtime-benchmarks",
"pallet-xcm-benchmarks/runtime-benchmarks",
"pallet-xcm-bridge-hub-router/runtime-benchmarks",
"pallet-xcm/runtime-benchmarks",
Expand Down Expand Up @@ -178,6 +180,7 @@ try-runtime = [
"pallet-transaction-payment/try-runtime",
"pallet-uniques/try-runtime",
"pallet-utility/try-runtime",
"pallet-vesting/try-runtime",
"pallet-xcm-bridge-hub-router/try-runtime",
"pallet-xcm/try-runtime",
"parachain-info/try-runtime",
Expand Down Expand Up @@ -229,6 +232,7 @@ std = [
"pallet-transaction-payment/std",
"pallet-uniques/std",
"pallet-utility/std",
"pallet-vesting/std",
"pallet-xcm-benchmarks?/std",
"pallet-xcm-bridge-hub-router/std",
"pallet-xcm/std",
Expand Down
33 changes: 30 additions & 3 deletions system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ use sp_api::impl_runtime_apis;
use sp_core::{crypto::KeyTypeId, OpaqueMetadata};
use sp_runtime::{
create_runtime_str, generic, impl_opaque_keys,
traits::{AccountIdConversion, AccountIdLookup, BlakeTwo256, Block as BlockT, Verify},
traits::{
AccountIdConversion, AccountIdLookup, BlakeTwo256, Block as BlockT, ConvertInto, Verify,
},
transaction_validity::{TransactionSource, TransactionValidity},
ApplyExtrinsicResult, Perbill, Permill,
};
Expand All @@ -58,7 +60,7 @@ use frame_support::{
traits::{
fungible, fungibles, tokens::imbalance::ResolveAssetTo, AsEnsureOriginWithArg, ConstBool,
ConstU128, ConstU32, ConstU64, ConstU8, EitherOfDiverse, Equals, InstanceFilter,
TransformOrigin,
TransformOrigin, WithdrawReasons,
},
weights::{ConstantMultiplier, Weight},
BoundedVec, PalletId,
Expand Down Expand Up @@ -229,6 +231,26 @@ impl pallet_balances::Config for Runtime {
type MaxFreezes = ConstU32<0>;
}

parameter_types! {
pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons =
WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE);
}

impl pallet_vesting::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type BlockNumberToBalance = ConvertInto;
type MinVestedTransfer = ExistentialDeposit;
type WeightInfo = weights::pallet_vesting::WeightInfo<Runtime>;
type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons;
/// Note for wallets and implementers: This means that vesting schedules are evaluated with the
/// block number of the Relay Chain, not the parachain. This is because with Coretime and Async
/// Backing, parachain block numbers may not be a good proxy for time. Vesting schedules should
/// be set accordingly.
type BlockNumberProvider = cumulus_pallet_parachain_system::RelaychainDataProvider<Runtime>;
const MAX_VESTING_SCHEDULES: u32 = 28;
}

parameter_types! {
/// Relay Chain `TransactionByteFee` / 10
pub const TransactionByteFee: Balance = system_parachains_constants::kusama::fee::TRANSACTION_BYTE_FEE;
Expand Down Expand Up @@ -507,7 +529,10 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
RuntimeCall::Assets { .. } |
RuntimeCall::NftFractionalization { .. } |
RuntimeCall::Nfts { .. } |
RuntimeCall::Uniques { .. }
RuntimeCall::Uniques { .. } |
// We allow calling `vest` and merging vesting schedules, but obviously not
// vested transfers.
RuntimeCall::Vesting(pallet_vesting::Call::vested_transfer { .. })
),
ProxyType::CancelProxy => matches!(
c,
Expand Down Expand Up @@ -934,6 +959,7 @@ construct_runtime!(
Balances: pallet_balances = 10,
TransactionPayment: pallet_transaction_payment = 11,
AssetTxPayment: pallet_asset_conversion_tx_payment = 13,
Vesting: pallet_vesting = 14,

// Collator support. the order of these 5 are important and shall not change.
Authorship: pallet_authorship = 20,
Expand Down Expand Up @@ -1029,6 +1055,7 @@ mod benches {
[pallet_session, SessionBench::<Runtime>]
[pallet_uniques, Uniques]
[pallet_utility, Utility]
[pallet_vesting, Vesting]
[pallet_timestamp, Timestamp]
[pallet_collator_selection, CollatorSelection]
[cumulus_pallet_parachain_system, ParachainSystem]
Expand Down

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

Loading

0 comments on commit 2f905db

Please sign in to comment.