Skip to content

Commit

Permalink
Add migration to fix coretime state (#458)
Browse files Browse the repository at this point in the history
The `LeaseOffset` was not taken into consideration in the [Polkadot
migration](https://github.com/polkadot-fellows/runtimes/blob/e6b9132701df4311e7d6331e3a9e051ae8de0104/relay/polkadot/src/lib.rs#L1965)
that ran when [ref 1143](https://polkadot.subsquare.io/referenda/1143)
enacted and upgraded the relay chain, so the end timeslices of the
leases are short by about 64 days.

This PR adds a migration to fix the Coretime state, which currently
includes end timeslices which are incorrect.

Full notes and plan here: https://hackmd.io/kurv6rTXTF6yvaUJ9uSNoQ for
work to continue while I'm OOO

try-runtime tests are included in the PR and the HackMD linked above
includes steps to manually test the upgrade with chopsticks.

---------

Co-authored-by: Tsvetomir Dimitrov <tsvetomir@parity.io>
Co-authored-by: eskimor <eskimor@no-such-url.com>
Co-authored-by: eskimor <eskimor@users.noreply.github.com>
Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: fellowship-merge-bot[bot] <151052383+fellowship-merge-bot[bot]@users.noreply.github.com>
  • Loading branch information
6 people authored Oct 1, 2024
1 parent f542af4 commit afc36ca
Show file tree
Hide file tree
Showing 6 changed files with 565 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/runtimes-matrix.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"name": "coretime-polkadot",
"package": "coretime-polkadot-runtime",
"path": "system-parachains/coretime/coretime-polkadot",
"uri": "wss://polkadot-coretime-rpc.polkadot.io:443",
"is_relay": false
},
{
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Fixed

- Chain-spec generator: propagate the `on_chain_release_build` feature to the chain-spec generator. Without this the live/genesis chain-specs contain a wrongly-configured WASM blob ([polkadot-fellows/runtimes#450](https://github.com/polkadot-fellows/runtimes/pull/450)).
- Adds a migration to the Polkadot Coretime chain to fix an issue from the initial Coretime migration. ([polkadot-fellows/runtimes#458](https://github.com/polkadot-fellows/runtimes/pull/458))

### Added

Expand All @@ -25,7 +26,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### Fixed

- Kusama: Revert accidental changes to inflation formula ([polkadot-fellows/runtimes#445](tps://github.com/polkadot-fellows/runtimes/pull/445)).
- Kusama: Revert accidental changes to inflation formula ([polkadot-fellows/runtimes#445](https://github.com/polkadot-fellows/runtimes/pull/445)).

## [1.3.1] 23.08.2024

Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions system-parachains/coretime/coretime-polkadot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ pallet-transaction-payment = { workspace = true }
pallet-transaction-payment-rpc-runtime-api = { workspace = true }
pallet-utility = { workspace = true }
sp-api = { workspace = true }
sp-arithmetic = { workspace = true }
sp-block-builder = { workspace = true }
sp-consensus-aura = { workspace = true }
sp-core = { workspace = true }
Expand Down Expand Up @@ -131,6 +132,7 @@ std = [
"serde",
"serde_json/std",
"sp-api/std",
"sp-arithmetic/std",
"sp-block-builder/std",
"sp-consensus-aura/std",
"sp-core/std",
Expand Down
4 changes: 3 additions & 1 deletion system-parachains/coretime/coretime-polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));

mod coretime;
mod migrations;
// Genesis preset configurations.
pub mod genesis_config_presets;
#[cfg(test)]
Expand Down Expand Up @@ -117,6 +118,7 @@ pub type UncheckedExtrinsic =
pub type Migrations = (
// permanent
pallet_xcm::migration::MigrateToLatestXcmVersion<Runtime>,
migrations::FixMigration,
);

/// Executive: handles dispatch to the various modules.
Expand All @@ -140,7 +142,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("coretime-polkadot"),
impl_name: create_runtime_str!("coretime-polkadot"),
authoring_version: 1,
spec_version: 1_003_000,
spec_version: 1_003_003,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 0,
Expand Down
Loading

0 comments on commit afc36ca

Please sign in to comment.