Skip to content

Commit

Permalink
Merge branch 'main' into dismiss-reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
Bullrich authored Jan 3, 2024
2 parents 004a281 + 30e0dbf commit 77a7bbc
Show file tree
Hide file tree
Showing 24 changed files with 880 additions and 127 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,14 @@ jobs:
- name: Fetch cache
uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0

- name: Test
run: cargo test --workspace --release --locked -q --features=runtime-metrics,try-runtime
env:
RUSTFLAGS: "-C debug-assertions -D warnings"
SKIP_WASM_BUILD: 1

- name: Test all features
run: cargo test --workspace --release --locked -q --features=runtime-benchmarks,runtime-metrics,try-runtime
env:
RUSTFLAGS: "-C debug-assertions -D warnings"
SKIP_WASM_BUILD: 1
SKIP_WASM_BUILD: 1
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Remove `experimental` feature flag for `pallet-society`, `pallet-xcm`, and `runtime-common` crates imports ([polkadot-fellows/runtimes#56](https://github.com/polkadot-fellows/runtimes/pull/56))
- Election provider: use a geometric deposit base calculation for EPM signed submissions in Polkadot and Kusama ([polkadot-fellows/runtimes#56](https://github.com/polkadot-fellows/runtimes/pull/56))
- Make `IdentityInfo` generic in `pallet-identity` ([polkadot-fellows/runtimes#87](https://github.com/polkadot-fellows/runtimes/pull/87)). Context: https://github.com/paritytech/polkadot-sdk/pull/1661
- Whitelist `force_default_xcm_version` in XCM call filter ([polkadot-fellows/runtimes#45](https://github.com/polkadot-fellows/runtimes/pull/45))

### Added

Expand All @@ -21,13 +22,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- XCM transport fees are now exponential and are sent to a treasury account ([polkadot-fellows/runtimes#87](https://github.com/polkadot-fellows/runtimes/pull/87)). Context: https://github.com/paritytech/polkadot-sdk/pull/1234
- System parachains are now trusted teleporters of each other ([polkadot-fellows/runtimes#87](https://github.com/polkadot-fellows/runtimes/pull/87)). Context: https://github.com/paritytech/polkadot-sdk/pull/1368
- Treasury is able to spend various asset kinds ([polkadot-fellows/runtimes#87](https://github.com/polkadot-fellows/runtimes/pull/87))
- Add BEEFY to Polkadot ([polkadot-fellows/runtimes#65](https://github.com/polkadot-fellows/runtimes/pull/65))
- Fellowship Treasury pallet on Polkadot Collectives ([polkadot-fellows/runtimes#109](https://github.com/polkadot-fellows/runtimes/pull/109))

### Fixed

- Add missing weight functions for `runtime_parachains_hrmp` and `preimage` pallets ([polkadot-fellows/runtimes#56](https://github.com/polkadot-fellows/runtimes/pull/56))
- Fix for Reward Deficit in the pool ([polkadot-fellows/runtimes#87](https://github.com/polkadot-fellows/runtimes/pull/87)). Context: https://github.com/paritytech/polkadot-sdk/pull/1255

## [1.0.1] 22.10.2023
## [1.0.1] 14.11.2023

### Changed

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

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

25 changes: 25 additions & 0 deletions docs/removing-migrations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Process for removing runtime migrations

We want to keep the `migrations` lists in the runtimes nice and tidy, without keeping around a lot of migration code once we know it's no longer needed - meaning once it's been enacted on-chain.

The following is a quick guide/process for removing applied migrations while making sure you don't remove migrations not yet applied.

## Prerequisites

For some chain runtime `spec_version: a_bcd_efg,` (e.g. `spec_version: 1_000_001`):
- has been officially released on https://github.com/polkadot-fellows/runtimes/releases/ as part of `Runtimes X.Y.Z` release/tag.
- the **on-chain** runtime version has been upgraded to spec version `a_bcd_efg` (using wasm blob released above).

## Steps

1. Sync tags: `git pull upstream main --tags`,
2. Check-out **the released** code: `git checkout vX.Y.Z`,
- This is required to make sure you are not accidentally removing yet unreleased migrations (PRs merged between `X.Y.Z` release and when you are doing this).
3. Create patch with your changes: `git diff --patch > remove-migrations.patch`,
4. Now `git checkout main` and apply your patch `git am -3 remove-migrations.patch`,
- thus ensuring you are not removing any migrations merged to main after the release.
5. `git checkout -b <PR-branch-bla>`, `git push --set-upstream origin <PR-branch-bla>`, then open PR.

## Automation

Currently, all of the above is done manually, but (at least parts of) it could be automated. Prerequisites can definitely be automated, so could the branches/patches dance. Code changes would easily be done manually and that's it.
2 changes: 1 addition & 1 deletion relay/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ impl pallet_staking::EraPayout<Balance> for EraPayout {
// all para-ids that are currently active.
let auctioned_slots = Paras::parachains()
.into_iter()
// all active para-ids that do not belong to a system or common good chain is the number
// all active para-ids that do not belong to a system chain is the number
// of parachains that we should take into account for inflation.
.filter(|i| *i >= LOWEST_PUBLIC_ID)
.count() as u64;
Expand Down
8 changes: 8 additions & 0 deletions relay/kusama/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,3 +175,11 @@ fn check_whitelist() {
// XcmPallet SafeXcmVersion
assert!(whitelist.contains("1405f2411d0af5a7ff397e7c9dc68d196323ae84c43568be0d1394d5d0d522c4"));
}

#[test]
fn check_treasury_pallet_id() {
assert_eq!(
<Treasury as frame_support::traits::PalletInfoAccess>::index() as u8,
kusama_runtime_constants::TREASURY_PALLET_ID
);
}
10 changes: 6 additions & 4 deletions relay/kusama/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ use xcm::latest::prelude::*;
use xcm_builder::{
AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses,
AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, ChildParachainAsNative,
ChildParachainConvertsVia, ChildSystemParachainAsSuperuser,
CurrencyAdapter as XcmCurrencyAdapter, IsChildSystemParachain, IsConcrete, MintLocation,
ChildParachainConvertsVia, CurrencyAdapter as XcmCurrencyAdapter, DescribeAllTerminal,
DescribeFamily, HashedDescription, IsChildSystemParachain, IsConcrete, MintLocation,
OriginToPluralityVoice, SignedAccountId32AsNative, SignedToAccountId32,
SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId, UsingComponents,
WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, XcmFeesToAccount,
Expand Down Expand Up @@ -72,6 +72,8 @@ pub type SovereignAccountOf = (
ChildParachainConvertsVia<ParaId, AccountId>,
// We can directly alias an `AccountId32` into a local account.
AccountId32Aliases<ThisNetwork, AccountId>,
// Foreign locations alias into accounts according to a hash of their standard description.
HashedDescription<AccountId, DescribeFamily<DescribeAllTerminal>>,
);

/// Our asset transactor. This is what allows us to interest with the runtime facilities from the
Expand Down Expand Up @@ -99,8 +101,6 @@ type LocalOriginConverter = (
ChildParachainAsNative<parachains_origin::Origin, RuntimeOrigin>,
// The AccountId32 location type can be expressed natively as a `Signed` origin.
SignedAccountId32AsNative<ThisNetwork, RuntimeOrigin>,
// A system child parachain, expressed as a Superuser, converts to the `Root` origin.
ChildSystemParachainAsSuperuser<ParaId, RuntimeOrigin>,
);

parameter_types! {
Expand Down Expand Up @@ -135,6 +135,8 @@ parameter_types! {
pub const KsmForBridgeHub: (MultiAssetFilter, MultiLocation) = (Ksm::get(), BridgeHubLocation::get());
pub const MaxAssetsIntoHolding: u32 = 64;
}

/// Kusama Relay recognizes/respects AssetHub, Encointer, and BridgeHub chains as teleporters.
pub type TrustedTeleporters = (
xcm_builder::Case<KsmForAssetHub>,
xcm_builder::Case<KsmForEncointer>,
Expand Down
14 changes: 14 additions & 0 deletions relay/polkadot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ smallvec = "1.8.0"
authority-discovery-primitives = { package = "sp-authority-discovery", default-features = false , version = "23.0.0" }
babe-primitives = { package = "sp-consensus-babe", default-features = false , version = "0.29.0" }
beefy-primitives = { package = "sp-consensus-beefy", default-features = false , version = "10.0.0" }
binary-merkle-tree = { default-features = false , version = "10.0.0" }
block-builder-api = { package = "sp-block-builder", default-features = false , version = "23.0.0" }
inherents = { package = "sp-inherents", default-features = false , version = "23.0.0" }
offchain-primitives = { package = "sp-offchain", default-features = false , version = "23.0.0" }
Expand All @@ -29,6 +30,7 @@ sp-arithmetic = { default-features = false , version = "20.0.0" }
sp-api = { default-features = false , version = "23.0.0" }
sp-genesis-builder = { default-features = false , version = "0.4.0" }
sp-std = { default-features = false , version = "12.0.0" }
sp-application-crypto = { default-features = false , version = "27.0.0" }
sp-io = { default-features = false , version = "27.0.0" }
sp-mmr-primitives = { default-features = false , version = "23.0.0" }
sp-runtime = { default-features = false , version = "28.0.0" }
Expand All @@ -45,6 +47,8 @@ pallet-authorship = { default-features = false , version = "25.0.0" }
pallet-babe = { default-features = false , version = "25.0.0" }
pallet-bags-list = { default-features = false , version = "24.0.0" }
pallet-balances = { default-features = false , version = "25.0.0" }
pallet-beefy = { default-features = false , version = "25.0.0" }
pallet-beefy-mmr = { default-features = false , version = "25.0.0" }
pallet-bounties = { default-features = false , version = "24.0.0" }
pallet-child-bounties = { default-features = false , version = "24.0.0" }
pallet-transaction-payment = { default-features = false , version = "25.0.0" }
Expand All @@ -62,6 +66,7 @@ pallet-im-online = { default-features = false , version = "24.0.0" }
pallet-indices = { default-features = false , version = "25.0.0" }
pallet-membership = { default-features = false , version = "25.0.0" }
pallet-message-queue = { default-features = false , version = "28.0.0" }
pallet-mmr = { default-features = false , version = "24.0.0" }
pallet-multisig = { default-features = false , version = "25.0.0" }
pallet-nomination-pools = { default-features = false , version = "22.0.0" }
pallet-nomination-pools-runtime-api = { default-features = false , version = "20.0.0" }
Expand Down Expand Up @@ -128,6 +133,7 @@ std = [
"authority-discovery-primitives/std",
"babe-primitives/std",
"beefy-primitives/std",
"binary-merkle-tree/std",
"bitvec/std",
"block-builder-api/std",
"frame-benchmarking?/std",
Expand All @@ -147,6 +153,8 @@ std = [
"pallet-babe/std",
"pallet-bags-list/std",
"pallet-balances/std",
"pallet-beefy/std",
"pallet-beefy-mmr/std",
"pallet-bounties/std",
"pallet-child-bounties/std",
"pallet-collective/std",
Expand All @@ -162,6 +170,7 @@ std = [
"pallet-indices/std",
"pallet-membership/std",
"pallet-message-queue/std",
"pallet-mmr/std",
"pallet-multisig/std",
"pallet-nomination-pools-benchmarking?/std",
"pallet-nomination-pools-runtime-api/std",
Expand Down Expand Up @@ -197,6 +206,7 @@ std = [
"serde/std",
"serde_derive",
"sp-api/std",
"sp-application-crypto/std",
"sp-arithmetic/std",
"sp-core/std",
"sp-genesis-builder/std",
Expand Down Expand Up @@ -241,6 +251,7 @@ runtime-benchmarks = [
"pallet-indices/runtime-benchmarks",
"pallet-membership/runtime-benchmarks",
"pallet-message-queue/runtime-benchmarks",
"pallet-mmr/runtime-benchmarks",
"pallet-multisig/runtime-benchmarks",
"pallet-nomination-pools-benchmarking/runtime-benchmarks",
"pallet-nomination-pools/runtime-benchmarks",
Expand Down Expand Up @@ -281,6 +292,8 @@ try-runtime = [
"pallet-babe/try-runtime",
"pallet-bags-list/try-runtime",
"pallet-balances/try-runtime",
"pallet-beefy-mmr/try-runtime",
"pallet-beefy/try-runtime",
"pallet-bounties/try-runtime",
"pallet-child-bounties/try-runtime",
"pallet-collective/try-runtime",
Expand All @@ -295,6 +308,7 @@ try-runtime = [
"pallet-indices/try-runtime",
"pallet-membership/try-runtime",
"pallet-message-queue/try-runtime",
"pallet-mmr/try-runtime",
"pallet-multisig/try-runtime",
"pallet-nomination-pools/try-runtime",
"pallet-offences/try-runtime",
Expand Down
2 changes: 2 additions & 0 deletions relay/polkadot/constants/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ pub mod xcm {
const ROOT_INDEX: u32 = 0;
// The bodies corresponding to the Polkadot OpenGov Origins.
pub const FELLOWSHIP_ADMIN_INDEX: u32 = 1;
// The body corresponding to the Treasurer OpenGov track.
pub const TREASURER_INDEX: u32 = 2;
}
}

Expand Down
Loading

0 comments on commit 77a7bbc

Please sign in to comment.