Skip to content

Commit

Permalink
Merge branch 'main' into region-transfers
Browse files Browse the repository at this point in the history
  • Loading branch information
Szegoo authored Oct 21, 2024
2 parents bc8bdfc + 91a4498 commit e26d34c
Show file tree
Hide file tree
Showing 36 changed files with 389 additions and 167 deletions.
6 changes: 3 additions & 3 deletions .github/env
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
RUST_STABLE_VERSION=1.77.0
RUST_NIGHTLY_VERSION=2024-04-14
TAPLO_VERSION=0.8.1
RUST_STABLE_VERSION=1.81.0
RUST_NIGHTLY_VERSION=2024-09-11
TAPLO_VERSION=0.9.3
55 changes: 46 additions & 9 deletions .github/workflows/check-migrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v4

- name: Build EXTRA_ARGS
- name: Build EXTRA_FLAGS
run: |
# When running on relay, we don't need weight checks.
EXTRA_FLAGS=""
EXTRA_FLAGS="${{ matrix.runtime.extra_args }}"
if [[ "${{ matrix.runtime.is_relay }}" == "true" ]]; then
EXTRA_FLAGS+="--no-weight-warnings"
echo "Disabling weight checks since we are on a relay"
Expand All @@ -70,6 +70,8 @@ jobs:
CHECKS="all"
fi
EXTRA_FLAGS+=" --blocktime ${{ matrix.runtime.blocktime }} "
# Disable the spec version check when we dont want to release.
# The program prints either `1` or `0`.
if [ "$(.github/changelog-processor.py CHANGELOG.md --should-release)" = "0" ]; then
Expand All @@ -82,16 +84,51 @@ jobs:
echo "Flags: $EXTRA_FLAGS"
echo "Checks: $CHECKS"
echo "EXTRA_ARGS=$EXTRA_FLAGS" >> $GITHUB_ENV
echo "EXTRA_FLAGS=$EXTRA_FLAGS" >> $GITHUB_ENV
echo "CHECKS=$CHECKS" >> $GITHUB_ENV
- name: Run ${{ matrix.runtime.name }} Runtime Checks
uses: "paritytech/[email protected]"
- name: Install Protoc
uses: arduino/[email protected]
with:
runtime-package: ${{ matrix.runtime.package }}
node-uri: ${{ matrix.runtime.uri }}
checks: ${{ env.CHECKS }}
extra-args: ${{ env.EXTRA_ARGS }}
version: "3.6.1"

- name: Add wasm32-unknown-unknown target
run: rustup target add wasm32-unknown-unknown
shell: bash

- name: Add rust-src component
run: rustup component add rust-src
shell: bash

- name: Run ${{ matrix.runtime.name }} Runtime Checks
#uses: "paritytech/[email protected]"
env:
EXTRA_FLAGS: ${{ env.EXTRA_FLAGS }}
CHECKS: ${{ env.CHECKS }}
run: |
cargo install -q --git https://github.com/paritytech/try-runtime-cli --tag v0.8.0 --locked && try-runtime --version
cargo build --profile production -p ${{ matrix.runtime.package }} --features try-runtime -q --locked
PACKAGE_NAME=${{ matrix.runtime.package }}
RUNTIME_BLOB_NAME=$(echo $PACKAGE_NAME | sed 's/-/_/g').compact.compressed.wasm
RUNTIME_BLOB_PATH=./target/production/wbuild/$PACKAGE_NAME/$RUNTIME_BLOB_NAME
export RUST_LOG=remote-ext=debug,runtime=debug
echo "Extra args: $EXTRA_FLAGS"
# Store the command in a variable so we can log it
COMMAND="try-runtime \
--runtime $RUNTIME_BLOB_PATH \
on-runtime-upgrade --checks=$CHECKS \
$EXTRA_FLAGS \
live --uri ${{ matrix.runtime.uri }}"

# Echo the command before running it, for debugging purposes
echo "Running command:"
echo "$COMMAND"
eval "$COMMAND"


# This will only run if all the tests in its "needs" array passed.
# Add this as your required job, becuase if the matrix changes size (new things get added)
Expand Down
42 changes: 28 additions & 14 deletions .github/workflows/runtimes-matrix.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,89 +4,103 @@
"package": "polkadot-runtime",
"path": "relay/polkadot",
"uri": "wss://try-runtime.polkadot.io:443",
"is_relay": true
"is_relay": true,
"blocktime": 6000
},
{
"name": "kusama",
"package": "staging-kusama-runtime",
"path": "relay/kusama",
"uri": "wss://try-runtime-kusama.polkadot.io:443",
"is_relay": true
"is_relay": true,
"blocktime": 6000
},
{
"name": "glutton-kusama",
"package": "glutton-kusama-runtime",
"path": "system-parachains/gluttons/glutton-kusama",
"is_relay": false
"is_relay": false,
"blocktime": 12000
},
{
"name": "asset-hub-kusama",
"package": "asset-hub-kusama-runtime",
"path": "system-parachains/asset-hubs/asset-hub-kusama",
"uri": "wss://kusama-asset-hub-rpc.polkadot.io:443",
"is_relay": false
"is_relay": false,
"blocktime": 12000
},
{
"name": "asset-hub-polkadot",
"package": "asset-hub-polkadot-runtime",
"path": "system-parachains/asset-hubs/asset-hub-polkadot",
"uri": "wss://polkadot-asset-hub-rpc.polkadot.io:443",
"is_relay": false
"is_relay": false,
"blocktime": 12000
},
{
"name": "bridge-hub-kusama",
"package": "bridge-hub-kusama-runtime",
"path": "system-parachains/bridge-hubs/bridge-hub-kusama",
"uri": "wss://kusama-bridge-hub-rpc.polkadot.io:443",
"is_relay": false
"is_relay": false,
"blocktime": 12000
},
{
"name": "bridge-hub-polkadot",
"package": "bridge-hub-polkadot-runtime",
"path": "system-parachains/bridge-hubs/bridge-hub-polkadot",
"uri": "wss://polkadot-bridge-hub-rpc.polkadot.io:443",
"is_relay": false
"is_relay": false,
"blocktime": 12000
},
{
"name": "collectives-polkadot",
"package": "collectives-polkadot-runtime",
"path": "system-parachains/collectives/collectives-polkadot",
"uri": "wss://polkadot-collectives-rpc.polkadot.io:443",
"is_relay": false
"is_relay": false,
"blocktime": 12000
},
{
"name": "coretime-kusama",
"package": "coretime-kusama-runtime",
"path": "system-parachains/coretime/coretime-kusama",
"uri": "wss://kusama-coretime-rpc.polkadot.io:443",
"is_relay": false
"is_relay": false,
"blocktime": 12000
},
{
"name": "coretime-polkadot",
"package": "coretime-polkadot-runtime",
"path": "system-parachains/coretime/coretime-polkadot",
"uri": "wss://polkadot-coretime-rpc.polkadot.io:443",
"is_relay": false
"is_relay": false,
"blocktime": 12000,
"uri": "wss://polkadot-coretime-rpc.polkadot.io:443"
},
{
"name": "people-kusama",
"package": "people-kusama-runtime",
"path": "system-parachains/people/people-kusama",
"uri": "wss://kusama-people-rpc.polkadot.io:443",
"is_relay": false
"is_relay": false,
"blocktime": 6000
},
{
"name": "people-polkadot",
"package": "people-polkadot-runtime",
"path": "system-parachains/people/people-polkadot",
"uri": "wss://polkadot-people-rpc.polkadot.io:443",
"is_relay": false
"is_relay": false,
"blocktime": 12000
},
{
"name": "encointer-kusama",
"package": "encointer-kusama-runtime",
"path": "system-parachains/encointer",
"uri": "wss://kusama.api.encointer.org:443",
"is_relay": false
"is_relay": false,
"blocktime": 12000,
"extra_args": "--disable-mbm-checks"
}
]
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ Changelog for the runtimes governed by the Polkadot Fellowship.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [Unreleased]

### Changed

Change Polkadot inflation to 120M DOT per year ([polkadot-fellows/runtimes#471](https://github.com/polkadot-fellows/runtimes/pull/471))

## [1.3.3] 01.10.2024

### Changed
Expand Down
17 changes: 13 additions & 4 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ license = "GPL-3.0-only" # TODO <https://

[workspace.dependencies]
assert_matches = { version = "1.5.0" }
approx = { version = "0.5.1" }
asset-hub-kusama-emulated-chain = { path = "integration-tests/emulated/chains/parachains/assets/asset-hub-kusama" }
asset-hub-kusama-runtime = { path = "system-parachains/asset-hubs/asset-hub-kusama" }
asset-hub-polkadot-emulated-chain = { path = "integration-tests/emulated/chains/parachains/assets/asset-hub-polkadot" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,9 @@ fn limited_teleport_native_assets_from_system_para_to_relay_fails() {
let delivery_fees = AssetHubKusama::execute_with(|| {
xcm_helpers::teleport_assets_delivery_fees::<
<AssetHubKusamaXcmConfig as xcm_executor::Config>::XcmSender,
>(test.args.assets.clone(), 0, test.args.weight_limit, test.args.beneficiary, test.args.dest)
>(
test.args.assets.clone(), 0, test.args.weight_limit, test.args.beneficiary, test.args.dest
)
});

// Sender's balance is reduced
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,9 @@ fn limited_teleport_native_assets_from_system_para_to_relay_fails() {
let delivery_fees = AssetHubPolkadot::execute_with(|| {
xcm_helpers::teleport_assets_delivery_fees::<
<AssetHubPolkadotXcmConfig as xcm_executor::Config>::XcmSender,
>(test.args.assets.clone(), 0, test.args.weight_limit, test.args.beneficiary, test.args.dest)
>(
test.args.assets.clone(), 0, test.args.weight_limit, test.args.beneficiary, test.args.dest
)
});

// Sender's balance is reduced
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ fn limited_teleport_native_assets_from_system_para_to_relay_fails() {
let delivery_fees = PeopleKusama::execute_with(|| {
xcm_helpers::teleport_assets_delivery_fees::<
<PeopleKusamaXcmConfig as xcm_executor::Config>::XcmSender,
>(test.args.assets.clone(), 0, test.args.weight_limit, test.args.beneficiary, test.args.dest)
>(
test.args.assets.clone(), 0, test.args.weight_limit, test.args.beneficiary, test.args.dest
)
});

// Sender's balance is reduced
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ fn limited_teleport_native_assets_from_system_para_to_relay_fails() {
let delivery_fees = PeoplePolkadot::execute_with(|| {
xcm_helpers::teleport_assets_delivery_fees::<
<PeoplePolkadotXcmConfig as xcm_executor::Config>::XcmSender,
>(test.args.assets.clone(), 0, test.args.weight_limit, test.args.beneficiary, test.args.dest)
>(
test.args.assets.clone(), 0, test.args.weight_limit, test.args.beneficiary, test.args.dest
)
});

// Sender's balance is reduced
Expand Down
1 change: 1 addition & 0 deletions relay/kusama/src/governance/origins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
pub use pallet_custom_origins::*;

#[allow(unreachable_patterns)]
#[frame_support::pallet]
pub mod pallet_custom_origins {
use crate::{Balance, GRAND, QUID};
Expand Down
18 changes: 10 additions & 8 deletions relay/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1213,7 +1213,8 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
matches!(
c,
RuntimeCall::Staking(..) |
RuntimeCall::Session(..) | RuntimeCall::Utility(..) |
RuntimeCall::Session(..) |
RuntimeCall::Utility(..) |
RuntimeCall::FastUnstake(..) |
RuntimeCall::VoterList(..) |
RuntimeCall::NominationPools(..)
Expand Down Expand Up @@ -1617,8 +1618,10 @@ impl pallet_nomination_pools::Config for Runtime {
}

/// The [frame_support::traits::tokens::ConversionFromAssetBalance] implementation provided by the
/// `AssetRate` pallet instance, with additional decoration to identify different IDs/locations of
/// native asset and provide a one-to-one balance conversion for them.
/// `AssetRate` pallet instance.
///
/// With additional decoration to identify different IDs/locations of native asset and provide a
/// one-to-one balance conversion for them.
pub type AssetRateWithNative = UnityOrOuterConversion<
ContainsLocationParts<
FromContains<
Expand Down Expand Up @@ -1828,10 +1831,10 @@ pub mod migrations {
///
/// It consists of:
/// * Call into `pallet_staking::Pallet::<T>::restore_ledger` with:
/// * Root origin;
/// * Default `None` paramters.
/// * Root origin;
/// * Default `None` paramters.
/// * Forces unstake of recovered ledger if the final restored ledger has higher stake than the
/// stash's free balance.
/// stash's free balance.
///
/// The stashes associated with corrupted ledgers that will be "migrated" are set in
/// [`CorruptedStashes`].
Expand Down Expand Up @@ -1914,14 +1917,13 @@ pub(crate) mod restore_corrupted_ledgers {
stash_account.clone(),
slashing_spans,
)
.map_err(|err| {
.inspect_err(|err| {
log::error!(
target: LOG_TARGET,
"migrations::corrupted_ledgers: error force unstaking ledger, unexpected. {:?}",
err
);
err_migration += 1;
err
});

log::info!(
Expand Down
1 change: 1 addition & 0 deletions relay/polkadot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ sp-debug-derive = { workspace = true }
polkadot-parachain-primitives = { workspace = true }

[dev-dependencies]
approx = { workspace = true }
sp-keyring = { workspace = true }
sp-trie = { workspace = true }
separator = { workspace = true }
Expand Down
1 change: 1 addition & 0 deletions relay/polkadot/src/governance/origins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
pub use pallet_custom_origins::*;

#[allow(unreachable_patterns)]
#[frame_support::pallet]
pub mod pallet_custom_origins {
use crate::{Balance, DOLLARS, GRAND};
Expand Down
Loading

0 comments on commit e26d34c

Please sign in to comment.