Skip to content

Commit

Permalink
Merge branch 'main' into root-signaller-track
Browse files Browse the repository at this point in the history
  • Loading branch information
ggwpez authored Feb 22, 2024
2 parents d706b4e + a8d5239 commit ebe666e
Show file tree
Hide file tree
Showing 20 changed files with 192 additions and 114 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/integration-tests-matrix.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"name": "asset-hub-kusama",
"package": "asset-hub-kusama-integration-tests"
},
{
"name": "asset-hub-polkadot",
"package": "asset-hub-polkadot-integration-tests"
}
]
148 changes: 142 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,39 @@ concurrency:
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-22.04
runtime-matrix:
runs-on: ubuntu-latest
outputs:
runtime: ${{ steps.runtime.outputs.runtime }}
name: Extract runtimes from matrix
steps:
- uses: actions/checkout@v2
- id: runtime
run: |
TASKS=$(echo $(cat .github/workflows/runtimes-matrix.json) | sed 's/ //g' )
echo $TASKS
echo "runtime=$TASKS" >> $GITHUB_OUTPUT
integration-test-matrix:
runs-on: ubuntu-latest
outputs:
itest: ${{ steps.itest.outputs.itest }}
name: Extract integration tests from matrix
steps:
- uses: actions/checkout@v2
- id: itest
run: |
TASKS=$(echo $(cat .github/workflows/integration-tests-matrix.json) | sed 's/ //g' )
echo $TASKS
echo "itest=$TASKS" >> $GITHUB_OUTPUT
runtime-test:
needs: [ runtime-matrix ]
continue-on-error: true
runs-on: ubuntu-22.04
strategy:
matrix:
runtime: ${{ fromJSON(needs.runtime-matrix.outputs.runtime) }}
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # v0.11.0
Expand Down Expand Up @@ -58,13 +88,119 @@ jobs:
with:
shared-key: "fellowship-cache-tests"

- name: Test
run: cargo test --workspace --release --locked -q --features=runtime-metrics,try-runtime
- name: Test ${{ matrix.runtime.name }}
run: cargo test -p ${{ matrix.runtime.package }} --release --locked -q --features=try-runtime
env:
RUSTFLAGS: "-C debug-assertions -D warnings"

- name: Test all features
run: cargo test --workspace --release --locked -q --features=runtime-benchmarks,runtime-metrics,try-runtime
- name: Test all features ${{ matrix.runtime.name }}
run: cargo test -p ${{ matrix.runtime.package }} --release --locked -q --features=runtime-benchmarks,try-runtime
env:
RUSTFLAGS: "-C debug-assertions -D warnings"
SKIP_WASM_BUILD: 1

integration-test:
needs: [ integration-test-matrix ]
continue-on-error: true
runs-on: ubuntu-22.04
strategy:
matrix:
itest: ${{ fromJSON(needs.integration-test-matrix.outputs.itest) }}
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # v0.11.0
with:
access_token: ${{ github.token }}

- name: Install updates and protobuf-compiler
run: sudo apt update && sudo apt install --assume-yes cmake protobuf-compiler

- name: Free space on the runner
run: |
df -h
sudo apt -y autoremove --purge
sudo apt -y autoclean
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
df -h
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: wasm32-unknown-unknown
components: rust-src

- name: Install nightly toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
target: wasm32-unknown-unknown

- name: Checkout
uses: actions/checkout@v3

- name: Fetch cache
uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0
with:
shared-key: "fellowship-cache-tests"

- name: Test ${{ matrix.itest.name }}
run: cargo test -p ${{ matrix.itest.package }} --release --locked -q
env:
RUSTFLAGS: "-C debug-assertions -D warnings"

build-chain-spec-generator:
runs-on: ubuntu-latest
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # v0.11.0
with:
access_token: ${{ github.token }}

- name: Install updates and protobuf-compiler
run: sudo apt update && sudo apt install --assume-yes cmake protobuf-compiler

- name: Free space on the runner
run: |
df -h
sudo apt -y autoremove --purge
sudo apt -y autoclean
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
df -h
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: wasm32-unknown-unknown
components: rust-src

- name: Install nightly toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
target: wasm32-unknown-unknown

- name: Checkout
uses: actions/checkout@v3

- name: Fetch cache
uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0
with:
shared-key: "fellowship-cache-tests"

- name: Build
run: cargo test -p chain-spec-generator --release --locked -q --features=runtime-benchmarks
env:
RUSTFLAGS: "-C debug-assertions -D warnings"
SKIP_WASM_BUILD: 1
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Fixed the lowering of Asset Hub existential deposits.
- 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)

### Removed

Expand Down
14 changes: 6 additions & 8 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion docs/removing-migrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ For some chain runtime `spec_version: a_bcd_efg,` (e.g. `spec_version: 1_000_001
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`,
4. Now `git checkout main` and apply your patch `git am -3 remove-migrations.patch` or `git apply -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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,11 @@ pallet-xcm = { version = "6.0.0" }
# Cumulus
parachains-common = { version = "6.0.0" }
xcm-emulator = { version = "0.4.0" }
asset-test-utils = { version = "6.0.0" }
asset-test-utils = { version = "6.0.1" }

# Local
emulated-chains = { path = "../../chains" }
integration-tests-common = { path = "../../common" }
asset-hub-kusama-runtime = { path = "../../../../system-parachains/asset-hubs/asset-hub-kusama" }
kusama-runtime = { package = "staging-kusama-runtime", path = "../../../../relay/kusama" }
system-parachains-constants = { path = "../../../../system-parachains/constants" }

[features]
runtime-benchmarks = []
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,11 @@ pallet-xcm = { version = "6.0.0" }
# Cumulus
parachains-common = { version = "6.0.0" }
xcm-emulator = { version = "0.4.0" }
asset-test-utils = { version = "6.0.0" }
asset-test-utils = { version = "6.0.1" }

# Local
emulated-chains = { path = "../../chains" }
integration-tests-common = { path = "../../common" }
asset-hub-polkadot-runtime = { path = "../../../../system-parachains/asset-hubs/asset-hub-polkadot" }
polkadot-runtime = { path = "../../../../relay/polkadot" }
system-parachains-constants = { path = "../../../../system-parachains/constants" }

[features]
runtime-benchmarks = []
system-parachains-constants = { path = "../../../../system-parachains/constants" }
5 changes: 0 additions & 5 deletions integration-tests/emulated/chains/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,3 @@ bridge-hub-polkadot-runtime = { path = "../../../system-parachains/bridge-hubs/b
bridge-hub-kusama-runtime = { path = "../../../system-parachains/bridge-hubs/bridge-hub-kusama" }
# TODO: replace with `emulated-integration-tests-common@X.Y.Z` from `polkadot-sdk`
integration-tests-common = { path = "../common" }

[features]
runtime-benchmarks = [
"penpal-runtime/runtime-benchmarks",
]
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
2 changes: 1 addition & 1 deletion integration-tests/emulated/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ cumulus-primitives-core = { version = "0.6.0" }
xcm-emulator = { version = "0.4.0" }
cumulus-pallet-xcmp-queue = { version = "0.6.0" }
cumulus-pallet-parachain-system = { features = ["parameterized-consensus-hook",] , version = "0.6.0" }
asset-test-utils = { version = "6.0.0" }
asset-test-utils = { version = "6.0.1" }
cumulus-pallet-dmp-queue = { version = "0.6.0" }

# Bridges
Expand Down
20 changes: 11 additions & 9 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 @@ -1671,8 +1671,6 @@ pub mod migrations {

/// Unreleased migrations. Add new ones here:
pub type Unreleased = (
pallet_nomination_pools::migration::versioned::V5toV6<Runtime>,
pallet_nomination_pools::migration::versioned::V6ToV7<Runtime>,
pallet_nomination_pools::migration::versioned::V7ToV8<Runtime>,
pallet_staking::migrations::v14::MigrateToV14<Runtime>,
parachains_configuration::migration::v10::MigrateToV10<Runtime>,
Expand Down Expand Up @@ -1823,7 +1821,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 @@ -1970,6 +1968,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
2 changes: 2 additions & 0 deletions relay/polkadot/constants/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ pub mod xcm {
// The bodies corresponding to the Polkadot OpenGov Origins.
pub const FELLOWSHIP_ADMIN_INDEX: u32 = 1;
// The body corresponding to the Treasurer OpenGov track.
#[deprecated = "Will be removed after August 2024; Use `xcm::latest::BodyId::Treasury` \
instead"]
pub const TREASURER_INDEX: u32 = 2;
}
}
Expand Down
Loading

0 comments on commit ebe666e

Please sign in to comment.