Skip to content

Commit

Permalink
Merge branch 'donal-coretime-polkadot' into donal-coretime-chain-specs
Browse files Browse the repository at this point in the history
  • Loading branch information
seadanda committed Aug 13, 2024
2 parents 9cfdad7 + 5fa7629 commit 66b2095
Show file tree
Hide file tree
Showing 18 changed files with 35 additions and 95 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ jobs:
app-id: ${{ secrets.MERGE_APP_ID }}
private-key: ${{ secrets.MERGE_APP_KEY }}
- name: Set auto merge
uses: paritytech/auto-merge-bot@v1.0.1
uses: paritytech/auto-merge-bot@v1.1.0
with:
GITHUB_TOKEN: ${{ steps.merge_token.outputs.token }}
MERGE_METHOD: "SQUASH"
ALLOWLIST: ${{ steps.fellows.outputs.github-handles }}
UPDATE_BEFORE_MERGE: true
12 changes: 10 additions & 2 deletions .github/workflows/check-migrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,14 @@ jobs:
if [[ "${{ matrix.runtime.is_relay }}" == "true" ]]; then
EXTRA_FLAGS+="--no-weight-warnings"
echo "Disabling weight checks since we are on a relay"
echo "Disabling try-state checks on the relay"
CHECKS="pre-and-post"
else
echo "Enabling weight checks since we are not on a relay"
echo "Enabling try-state checks on the non-relay"
CHECKS="all"
fi
# Disable the spec version check when we dont want to release.
Expand All @@ -74,15 +80,17 @@ jobs:
fi
echo "Flags: $EXTRA_FLAGS"
echo "Checks: $CHECKS"
echo "EXTRA_ARGS=$EXTRA_FLAGS" >> $GITHUB_ENV
echo "CHECKS=$CHECKS" >> $GITHUB_ENV
- name: Run ${{ matrix.runtime.name }} Runtime Checks
uses: "paritytech/try-runtime-gha@v0.1.0"
uses: "paritytech/try-runtime-gha@v0.2.0"
with:
runtime-package: ${{ matrix.runtime.package }}
node-uri: ${{ matrix.runtime.uri }}
checks: "pre-and-post"
checks: ${{ env.CHECKS }}
extra-args: ${{ env.EXTRA_ARGS }}

# This will only run if all the tests in its "needs" array passed.
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Pallet-xcm: add new extrinsic for asset transfers using explicit reserve ([SDK v1.11 #3695](https://github.com/paritytech/polkadot-sdk/pull/3695)).
- Ranked collective introduce `Add` and `Remove` origins ([SDK v1.8 #3212](https://github.com/paritytech/polkadot-sdk/pull/3212)).
- Runtime apis to help with delegate-stake based Nomination Pools ([SDK v1.13 #4537](https://github.com/paritytech/polkadot-sdk/pull/4537)).
- Kusama system chains: enable PoV-reclaim.

### Added

Expand All @@ -54,6 +53,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Polkadot chains: allow arbitrary XCM execution ([polkadot-fellows/runtimes#345](https://github.com/polkadot-fellows/runtimes/pull/345)).
- Bounties: Remove payout delay ([polkadot-fellows/runtimes#386](https://github.com/polkadot-fellows/runtimes/pull/386)).
- Polkadot System Chains: Reduce the base transaction fee by half ([polkadot-fellows/runtimes#398](https://github.com/polkadot-fellows/runtimes/pull/398)).
- Asset Hubs: setup auto incremented asset id to 50_000_000 for trust backed assets ([polkadot-fellows/runtimes#414](https://github.com/polkadot-fellows/runtimes/pull/414)).

#### From [#322](https://github.com/polkadot-fellows/runtimes/pull/322):

Expand Down
23 changes: 0 additions & 23 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ cumulus-pallet-xcmp-queue = { version = "0.15.0", default-features = false }
cumulus-primitives-aura = { version = "0.14.0", default-features = false }
cumulus-primitives-core = { version = "0.14.0", default-features = false }
cumulus-primitives-utility = { version = "0.15.0", default-features = false }
cumulus-primitives-storage-weight-reclaim = { version = "6.0.0", default-features = false }
emulated-integration-tests-common = { version = "11.0.0" }
encointer-balances-tx-payment = { version = "~13.1.0", default-features = false }
encointer-balances-tx-payment-rpc-runtime-api = { version = "~13.1.0", default-features = false }
Expand Down
2 changes: 0 additions & 2 deletions system-parachains/asset-hubs/asset-hub-kusama/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ cumulus-pallet-xcm = { workspace = true }
cumulus-pallet-xcmp-queue = { features = ["bridging"], workspace = true }
cumulus-primitives-aura = { workspace = true }
cumulus-primitives-core = { workspace = true }
cumulus-primitives-storage-weight-reclaim = { workspace = true }
cumulus-primitives-utility = { workspace = true }
pallet-collator-selection = { workspace = true }
parachain-info = { workspace = true }
Expand Down Expand Up @@ -211,7 +210,6 @@ std = [
"cumulus-pallet-xcmp-queue/std",
"cumulus-primitives-aura/std",
"cumulus-primitives-core/std",
"cumulus-primitives-storage-weight-reclaim/std",
"cumulus-primitives-utility/std",
"frame-benchmarking?/std",
"frame-executive/std",
Expand Down
35 changes: 9 additions & 26 deletions system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ use frame_support::{
ord_parameter_types, parameter_types,
traits::{
fungible, fungibles, tokens::imbalance::ResolveAssetTo, AsEnsureOriginWithArg, ConstBool,
ConstU128, ConstU32, ConstU64, ConstU8, EitherOfDiverse, EnsureOrigin, EnsureOriginWithArg,
Equals, InstanceFilter, TransformOrigin, WithdrawReasons,
ConstU128, ConstU32, ConstU64, ConstU8, EitherOfDiverse, Equals, InstanceFilter,
TransformOrigin, WithdrawReasons,
},
weights::{ConstantMultiplier, Weight, WeightToFee as _},
BoundedVec, PalletId,
Expand Down Expand Up @@ -297,27 +297,6 @@ parameter_types! {
/// We allow root to execute privileged asset operations.
pub type AssetsForceOrigin = EnsureRoot<AccountId>;

/// Ensure that the proposed asset id is less than `50_000_000` and origin is signed.
pub struct EnsureLessThanAutoIncrement;
impl EnsureOriginWithArg<RuntimeOrigin, AssetIdForTrustBackedAssets>
for EnsureLessThanAutoIncrement
{
type Success = AccountId;
fn try_origin(
o: RuntimeOrigin,
a: &AssetIdForTrustBackedAssets,
) -> Result<Self::Success, RuntimeOrigin> {
if *a >= 50_000_000 {
return Err(o);
}
<EnsureSigned<AccountId> as EnsureOrigin<RuntimeOrigin>>::try_origin(o)
}
#[cfg(feature = "runtime-benchmarks")]
fn try_successful_origin(_a: &AssetIdForTrustBackedAssets) -> Result<RuntimeOrigin, ()> {
<EnsureSigned<AccountId> as EnsureOrigin<RuntimeOrigin>>::try_successful_origin()
}
}

// Called "Trust Backed" assets because these are generally registered by some account, and users of
// the asset assume it has some claimed backing. The pallet is called `Assets` in
// `construct_runtime` to avoid breaking changes on storage reads.
Expand All @@ -329,7 +308,7 @@ impl pallet_assets::Config<TrustBackedAssetsInstance> for Runtime {
type AssetId = AssetIdForTrustBackedAssets;
type AssetIdParameter = codec::Compact<AssetIdForTrustBackedAssets>;
type Currency = Balances;
type CreateOrigin = EnsureLessThanAutoIncrement;
type CreateOrigin = AsEnsureOriginWithArg<EnsureSigned<AccountId>>;
type ForceOrigin = AssetsForceOrigin;
type AssetDeposit = AssetDeposit;
type MetadataDepositBase = MetadataDepositBase;
Expand All @@ -339,7 +318,7 @@ impl pallet_assets::Config<TrustBackedAssetsInstance> for Runtime {
type Freezer = ();
type Extra = ();
type WeightInfo = weights::pallet_assets_local::WeightInfo<Runtime>;
type CallbackHandle = ();
type CallbackHandle = pallet_assets::AutoIncAssetId<Runtime, TrustBackedAssetsInstance>;
type AssetAccountDeposit = AssetAccountDeposit;
type RemoveItemsLimit = frame_support::traits::ConstU32<1000>;
#[cfg(feature = "runtime-benchmarks")]
Expand Down Expand Up @@ -1065,7 +1044,6 @@ pub type SignedExtra = (
frame_system::CheckWeight<Runtime>,
pallet_asset_conversion_tx_payment::ChargeAssetTxPayment<Runtime>,
frame_metadata_hash_extension::CheckMetadataHash<Runtime>,
cumulus_primitives_storage_weight_reclaim::StorageWeightReclaim<Runtime>,
);
/// Unchecked extrinsic type as expected by this runtime.
pub type UncheckedExtrinsic =
Expand All @@ -1080,6 +1058,11 @@ pub type Migrations = (
frame_support::migrations::RemovePallet<DmpQueueName, RocksDbWeight>,
pallet_collator_selection::migration::v2::MigrationToV2<Runtime>,
cumulus_pallet_xcmp_queue::migration::v5::MigrateV4ToV5<Runtime>,
pallet_assets::migration::next_asset_id::SetNextAssetId<
ConstU32<50_000_000>,
Runtime,
TrustBackedAssetsInstance,
>,
// permanent
pallet_xcm::migration::MigrateToLatestXcmVersion<Runtime>,
);
Expand Down
34 changes: 9 additions & 25 deletions system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ use frame_support::{
parameter_types,
traits::{
fungible, fungibles, tokens::imbalance::ResolveAssetTo, AsEnsureOriginWithArg, ConstBool,
ConstU32, ConstU64, ConstU8, EitherOfDiverse, EnsureOrigin, EnsureOriginWithArg, Equals,
InstanceFilter, NeverEnsureOrigin, TransformOrigin, WithdrawReasons,
ConstU32, ConstU64, ConstU8, EitherOfDiverse, Equals, InstanceFilter, NeverEnsureOrigin,
TransformOrigin, WithdrawReasons,
},
weights::{ConstantMultiplier, Weight, WeightToFee as _},
PalletId,
Expand Down Expand Up @@ -315,27 +315,6 @@ parameter_types! {
/// We allow root to execute privileged asset operations.
pub type AssetsForceOrigin = EnsureRoot<AccountId>;

/// Ensure that the proposed asset id is less than `50_000_000` and origin is signed.
pub struct EnsureLessThanAutoIncrement;
impl EnsureOriginWithArg<RuntimeOrigin, AssetIdForTrustBackedAssets>
for EnsureLessThanAutoIncrement
{
type Success = AccountId;
fn try_origin(
o: RuntimeOrigin,
a: &AssetIdForTrustBackedAssets,
) -> Result<Self::Success, RuntimeOrigin> {
if *a >= 50_000_000 {
return Err(o);
}
<EnsureSigned<AccountId> as EnsureOrigin<RuntimeOrigin>>::try_origin(o)
}
#[cfg(feature = "runtime-benchmarks")]
fn try_successful_origin(_a: &AssetIdForTrustBackedAssets) -> Result<RuntimeOrigin, ()> {
<EnsureSigned<AccountId> as EnsureOrigin<RuntimeOrigin>>::try_successful_origin()
}
}

// Called "Trust Backed" assets because these are generally registered by some account, and users of
// the asset assume it has some claimed backing. The pallet is called `Assets` in
// `construct_runtime` to avoid breaking changes on storage reads.
Expand All @@ -347,7 +326,7 @@ impl pallet_assets::Config<TrustBackedAssetsInstance> for Runtime {
type AssetId = AssetIdForTrustBackedAssets;
type AssetIdParameter = codec::Compact<AssetIdForTrustBackedAssets>;
type Currency = Balances;
type CreateOrigin = EnsureLessThanAutoIncrement;
type CreateOrigin = AsEnsureOriginWithArg<EnsureSigned<AccountId>>;
type ForceOrigin = AssetsForceOrigin;
type AssetDeposit = AssetDeposit;
type MetadataDepositBase = MetadataDepositBase;
Expand All @@ -357,7 +336,7 @@ impl pallet_assets::Config<TrustBackedAssetsInstance> for Runtime {
type Freezer = ();
type Extra = ();
type WeightInfo = weights::pallet_assets_local::WeightInfo<Runtime>;
type CallbackHandle = ();
type CallbackHandle = pallet_assets::AutoIncAssetId<Runtime, TrustBackedAssetsInstance>;
type AssetAccountDeposit = AssetAccountDeposit;
type RemoveItemsLimit = frame_support::traits::ConstU32<1000>;
#[cfg(feature = "runtime-benchmarks")]
Expand Down Expand Up @@ -1061,6 +1040,11 @@ pub type Migrations = (
cumulus_pallet_xcmp_queue::migration::v4::MigrationToV4<Runtime>,
pallet_collator_selection::migration::v2::MigrationToV2<Runtime>,
cumulus_pallet_xcmp_queue::migration::v5::MigrateV4ToV5<Runtime>,
pallet_assets::migration::next_asset_id::SetNextAssetId<
ConstU32<50_000_000>,
Runtime,
TrustBackedAssetsInstance,
>,
// permanent
pallet_xcm::migration::MigrateToLatestXcmVersion<Runtime>,
);
Expand Down
2 changes: 0 additions & 2 deletions system-parachains/bridge-hubs/bridge-hub-kusama/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ cumulus-pallet-xcm = { workspace = true }
cumulus-pallet-xcmp-queue = { features = ["bridging"], workspace = true }
cumulus-primitives-aura = { workspace = true }
cumulus-primitives-core = { workspace = true }
cumulus-primitives-storage-weight-reclaim = { workspace = true }
cumulus-primitives-utility = { workspace = true }
pallet-collator-selection = { workspace = true }
parachain-info = { workspace = true }
Expand Down Expand Up @@ -154,7 +153,6 @@ std = [
"cumulus-pallet-xcmp-queue/std",
"cumulus-primitives-aura/std",
"cumulus-primitives-core/std",
"cumulus-primitives-storage-weight-reclaim/std",
"cumulus-primitives-utility/std",
"frame-benchmarking?/std",
"frame-executive/std",
Expand Down
1 change: 0 additions & 1 deletion system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ pub type SignedExtra = (
BridgeRejectObsoleteHeadersAndMessages,
bridge_to_polkadot_config::RefundBridgeHubPolkadotMessages,
frame_metadata_hash_extension::CheckMetadataHash<Runtime>,
cumulus_primitives_storage_weight_reclaim::StorageWeightReclaim<Runtime>,
);

bridge_runtime_common::generate_bridge_reject_obsolete_headers_and_messages! {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@ fn construct_extrinsic(
BridgeRejectObsoleteHeadersAndMessages,
(RefundBridgeHubPolkadotMessages::default()),
frame_metadata_hash_extension::CheckMetadataHash::<Runtime>::new(false),
cumulus_primitives_storage_weight_reclaim::StorageWeightReclaim::<Runtime>::new(),
);
let payload = SignedPayload::new(call.clone(), extra.clone()).unwrap();
let signature = payload.using_encoded(|e| sender.sign(e));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ fn construct_extrinsic(
BridgeRejectObsoleteHeadersAndMessages,
(RefundBridgeHubPolkadotMessages::default()),
frame_metadata_hash_extension::CheckMetadataHash::<Runtime>::new(false),
cumulus_primitives_storage_weight_reclaim::StorageWeightReclaim::<Runtime>::new(),
);
let payload = SignedPayload::new(call.clone(), extra.clone()).unwrap();
let signature = payload.using_encoded(|e| sender.sign(e));
Expand Down
2 changes: 0 additions & 2 deletions system-parachains/coretime/coretime-kusama/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ cumulus-pallet-xcm = { workspace = true }
cumulus-pallet-xcmp-queue = { workspace = true }
cumulus-primitives-aura = { workspace = true }
cumulus-primitives-core = { workspace = true }
cumulus-primitives-storage-weight-reclaim = { workspace = true }
cumulus-primitives-utility = { workspace = true }
pallet-collator-selection = { workspace = true }
parachain-info = { workspace = true }
Expand All @@ -97,7 +96,6 @@ std = [
"cumulus-pallet-xcmp-queue/std",
"cumulus-primitives-aura/std",
"cumulus-primitives-core/std",
"cumulus-primitives-storage-weight-reclaim/std",
"cumulus-primitives-utility/std",
"frame-benchmarking?/std",
"frame-executive/std",
Expand Down
1 change: 0 additions & 1 deletion system-parachains/coretime/coretime-kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ pub type SignedExtra = (
frame_system::CheckWeight<Runtime>,
pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
frame_metadata_hash_extension::CheckMetadataHash<Runtime>,
cumulus_primitives_storage_weight_reclaim::StorageWeightReclaim<Runtime>,
);

/// Unchecked extrinsic type as expected by this runtime.
Expand Down
2 changes: 0 additions & 2 deletions system-parachains/coretime/coretime-polkadot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ cumulus-pallet-xcm = { workspace = true }
cumulus-pallet-xcmp-queue = { workspace = true }
cumulus-primitives-aura = { workspace = true }
cumulus-primitives-core = { workspace = true }
cumulus-primitives-storage-weight-reclaim = { workspace = true }
cumulus-primitives-utility = { workspace = true }
pallet-collator-selection = { workspace = true }
parachain-info = { workspace = true }
Expand All @@ -97,7 +96,6 @@ std = [
"cumulus-pallet-xcmp-queue/std",
"cumulus-primitives-aura/std",
"cumulus-primitives-core/std",
"cumulus-primitives-storage-weight-reclaim/std",
"cumulus-primitives-utility/std",
"frame-benchmarking?/std",
"frame-executive/std",
Expand Down
5 changes: 4 additions & 1 deletion system-parachains/coretime/coretime-polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@ pub type UncheckedExtrinsic =
generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, SignedExtra>;

/// Migrations to apply on runtime upgrade.
pub type Migrations = (pallet_xcm::migration::MigrateToLatestXcmVersion<Runtime>,);
pub type Migrations = (
// permanent
pallet_xcm::migration::MigrateToLatestXcmVersion<Runtime>,
);

/// Executive: handles dispatch to the various modules.
pub type Executive = frame_executive::Executive<
Expand Down
Loading

0 comments on commit 66b2095

Please sign in to comment.