Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Open Gov for Development and Altair Runtimes #1828

Merged
merged 28 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
bb5c278
chore: add OpenGov pallets to root toml
wischli May 13, 2024
74acbd3
feat: add OpenGov tracks to runtime common
wischli May 3, 2024
bfb36ae
feat: add technical committee migration
wischli May 3, 2024
f530ee5
refactor: move origins from primitives to common
wischli May 13, 2024
5a3e4ba
feat: add OpenGov to Development
wischli May 3, 2024
7ef53e8
feat: add OpenGov to Altair
wischli May 3, 2024
4d78c10
feat: add OpenGov to Centrifuge chain
wischli Apr 17, 2024
dd7884c
Revert "feat: add OpenGov to Centrifuge chain"
wischli May 13, 2024
d369536
fix: clippy
wischli May 13, 2024
bc41393
tests: fix CouncilCollective import path
wischli May 14, 2024
8d4a231
fix: technical committee migrations
wischli May 14, 2024
dc39024
altair: configure tc migration (incomplete)
wischli May 14, 2024
c7b1f18
dev: configure tc migration
wischli May 14, 2024
9a4950a
chore: cleanup altair dep diff
wischli May 21, 2024
bc2ae52
chore: remove unused getrandom crate from runtimes
wischli May 21, 2024
a98666b
chore: add missing Altair TC members
wischli May 21, 2024
c7be7f9
refactor: move to_ppm and to_percent to utils
wischli May 21, 2024
27ea745
Merge remote-tracking branch 'origin/main' into feat/open-gov-2
wischli May 21, 2024
7175fe9
Merge remote-tracking branch 'origin/main' into feat/open-gov-2
wischli Jun 25, 2024
4beb919
Merge remote-tracking branch 'origin/main' into feat/open-gov-2
wischli Jun 25, 2024
aef53a3
fix: issues after rebasing
wischli Jun 25, 2024
9c50dd4
fmt
wischli Jun 25, 2024
dd97b2a
Merge remote-tracking branch 'origin/main' into feat/open-gov-2
wischli Jun 25, 2024
cb9bb3b
Merge remote-tracking branch 'origin/main' into feat/open-gov-2
wischli Jun 26, 2024
05c50aa
fix: imports
wischli Jun 26, 2024
230651d
Merge remote-tracking branch 'origin/main' into feat/open-gov-2
wischli Jun 28, 2024
6b11298
feat: v0.12.0 for altair RU
wischli Jun 28, 2024
c4c78a2
Merge remote-tracking branch 'origin/main' into feat/open-gov-2
wischli Jun 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 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 Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ license = "LGPL-3.0"
homepage = "https://centrifuge.io/"
repository = "https://github.com/centrifuge/centrifuge-chain"
documentation = "https://reference.centrifuge.io/centrifuge_chain/index.html"
version = "0.11.3"
version = "0.12.0"

[workspace.dependencies]
hex-literal = { version = "0.4.1" }
Expand Down
4 changes: 2 additions & 2 deletions runtime/altair/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("altair"),
impl_name: create_runtime_str!("altair"),
authoring_version: 1,
spec_version: 1103,
spec_version: 1200,
Copy link
Contributor Author

@wischli wischli Jun 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: Bumping to 1200 here and removing outdated migrations for all runtimes so I can use this as RC for Altair.

impl_version: 1,
apis: RUNTIME_API_VERSIONS,
transaction_version: 2,
Expand Down Expand Up @@ -2072,7 +2072,7 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPalletsWithSystem,
migrations::UpgradeAltair1103,
migrations::UpgradeAltair1200,
>;

// Frame Order in this block dictates the index of each one in the metadata
Expand Down
2 changes: 1 addition & 1 deletion runtime/altair/src/migrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ parameter_types! {

/// The migration set for Altair @ Kusama.
/// It includes all the migrations that have to be applied on that chain.
pub type UpgradeAltair1103 = (
pub type UpgradeAltair1200 = (
runtime_common::migrations::increase_storage_version::Migration<OraclePriceFeed, 0, 1>,
runtime_common::migrations::increase_storage_version::Migration<OraclePriceCollection, 0, 1>,
runtime_common::migrations::increase_storage_version::Migration<OrderBook, 0, 1>,
Expand Down
4 changes: 2 additions & 2 deletions runtime/centrifuge/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("centrifuge"),
impl_name: create_runtime_str!("centrifuge"),
authoring_version: 1,
spec_version: 1103,
spec_version: 1200,
impl_version: 1,
apis: RUNTIME_API_VERSIONS,
transaction_version: 2,
Expand Down Expand Up @@ -2083,7 +2083,7 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPalletsWithSystem,
migrations::UpgradeCentrifuge1103,
migrations::UpgradeCentrifuge1200,
>;

// Frame Order in this block dictates the index of each one in the metadata
Expand Down
41 changes: 1 addition & 40 deletions runtime/centrifuge/src/migrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,45 +10,6 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

use cfg_primitives::AccountId;
use frame_support::parameter_types;
use sp_std::{vec, vec::Vec};

use crate::{OraclePriceCollection, OraclePriceFeed};

// Number of identities on Centrifuge Chain on 29.05.2024 was 34
const IDENTITY_MIGRATION_KEY_LIMIT: u64 = 1000;

parameter_types! {
// Address used by Anemoy to withdraw in AssetHub
// 4dTeMxuPJCK7zQGhFcgCivSJqBs9Wo2SuMSQeYCCuVJ9xrE2 --> 5CSfibAR9HHEwKpXbdsDHguAmLgKS6yKat2joTLA75DZ152L
pub AccountMap: Vec<(AccountId, AccountId)> = vec![
(
AccountId::new(hex_literal::hex!("5dbb2cec05b6bda775f7945827b887b0e7b5245eae8b4ef266c60820c9377185")),
AccountId::new(hex_literal::hex!("10c03288a534d77418e3c19e745dfbc952423e179e1e3baa89e287092fc7802f"))
)
];
}

/// The migration set for Centrifuge @ Polkadot.
/// It includes all the migrations that have to be applied on that chain.
pub type UpgradeCentrifuge1103 = (
runtime_common::migrations::increase_storage_version::Migration<OraclePriceFeed, 0, 1>,
runtime_common::migrations::increase_storage_version::Migration<OraclePriceCollection, 0, 1>,
pallet_collator_selection::migration::v1::MigrateToV1<crate::Runtime>,
pallet_collator_selection::migration::v2::MigrationToV2<crate::Runtime>,
runtime_common::migrations::loans::AddWithLinearPricing<crate::Runtime>,
runtime_common::migrations::hold_reason::MigrateTransferAllowListHolds<
crate::Runtime,
crate::RuntimeHoldReason,
>,
// Migrations below this comment originate from Polkadot SDK
pallet_xcm::migration::MigrateToLatestXcmVersion<crate::Runtime>,
cumulus_pallet_xcmp_queue::migration::v4::MigrationToV4<crate::Runtime>,
pallet_identity::migration::versioned::V0ToV1<crate::Runtime, IDENTITY_MIGRATION_KEY_LIMIT>,
pallet_uniques::migration::MigrateV0ToV1<crate::Runtime, ()>,
runtime_common::migrations::restricted_location::MigrateRestrictedTransferLocation<
crate::Runtime,
AccountMap,
>,
);
pub type UpgradeCentrifuge1200 = ();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, we need to be sure we use the 1103 as RU to apply the previous migrations 👍🏻

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes but since 1103 is already proposed to Council, that shouldnt be an issue.

4 changes: 2 additions & 2 deletions runtime/development/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("centrifuge-devel"),
impl_name: create_runtime_str!("centrifuge-devel"),
authoring_version: 1,
spec_version: 1103,
spec_version: 1200,
impl_version: 1,
apis: RUNTIME_API_VERSIONS,
transaction_version: 2,
Expand Down Expand Up @@ -2172,7 +2172,7 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPalletsWithSystem,
crate::migrations::UpgradeDevelopment1103,
crate::migrations::UpgradeDevelopment1200,
>;

// Frame Order in this block dictates the index of each one in the metadata
Expand Down
2 changes: 1 addition & 1 deletion runtime/development/src/migrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ parameter_types! {

/// The migration set for Development & Demo.
/// It includes all the migrations that have to be applied on that chain.
pub type UpgradeDevelopment1100 = (
pub type UpgradeDevelopment1200 = (
// Initialize OpenGov Technical Committee with Alice
runtime_common::migrations::technical_comittee::InitMigration<crate::Runtime, InitialTcMembers>,
runtime_common::migrations::increase_storage_version::Migration<crate::Referenda, 0, 1>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, a pallet just added to the runtime, does not contain the latest version?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently! I have to admit that I did not dig deeper into this but try-runtime complained about it. It really surprised me!

Expand Down