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: LP v2 migrations #1966

Merged
merged 7 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
9 changes: 5 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.14.0"
version = "0.14.2"

[workspace.dependencies]
hex-literal = { version = "0.4.1" }
Expand Down
2 changes: 1 addition & 1 deletion pallets/liquidity-pools-gateway/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ mod tests;
pub mod pallet {
use super::*;

const STORAGE_VERSION: StorageVersion = StorageVersion::new(1);
const STORAGE_VERSION: StorageVersion = StorageVersion::new(2);

#[pallet::pallet]
#[pallet::storage_version(STORAGE_VERSION)]
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 @@ -164,7 +164,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("altair"),
impl_name: create_runtime_str!("altair"),
authoring_version: 1,
spec_version: 1401,
spec_version: 1402,
impl_version: 1,
apis: RUNTIME_API_VERSIONS,
transaction_version: 2,
Expand Down Expand Up @@ -2009,7 +2009,7 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPalletsWithSystem,
migrations::UpgradeAltair1401,
migrations::UpgradeAltair1402,
>;

// Frame Order in this block dictates the index of each one in the metadata
Expand Down
14 changes: 12 additions & 2 deletions runtime/altair/src/migrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,22 @@ use crate::Runtime;

/// The migration set for Altair @ Kusama.
/// It includes all the migrations that have to be applied on that chain.
pub type UpgradeAltair1401 = (
pub type UpgradeAltair1402 = (
// Clear OutboundMessageNonceStore
frame_support::migrations::VersionedMigration<
0,
1,
runtime_common::migrations::liquidity_pools_gateway::Migration<Runtime>,
runtime_common::migrations::liquidity_pools_gateway::clear_outbound_nonce::Migration<
Runtime,
>,
pallet_liquidity_pools_gateway::Pallet<Runtime>,
<Runtime as frame_system::Config>::DbWeight,
>,
// Remove deprecated DomainRouters entries
frame_support::migrations::VersionedMigration<
1,
2,
runtime_common::migrations::liquidity_pools_gateway::clear_deprecated_domain_router_entries::Migration<Runtime>,
pallet_liquidity_pools_gateway::Pallet<Runtime>,
<Runtime as frame_system::Config>::DbWeight,
>,
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 @@ -162,7 +162,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("centrifuge"),
impl_name: create_runtime_str!("centrifuge"),
authoring_version: 1,
spec_version: 1401,
spec_version: 1402,
impl_version: 1,
apis: RUNTIME_API_VERSIONS,
transaction_version: 2,
Expand Down Expand Up @@ -2023,7 +2023,7 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPalletsWithSystem,
migrations::UpgradeCentrifuge1401,
migrations::UpgradeCentrifuge1402,
>;

// Frame Order in this block dictates the index of each one in the metadata
Expand Down
14 changes: 12 additions & 2 deletions runtime/centrifuge/src/migrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,22 @@ use crate::Runtime;

/// The migration set for Centrifuge @ Polkadot.
/// It includes all the migrations that have to be applied on that chain.
pub type UpgradeCentrifuge1401 = (
pub type UpgradeCentrifuge1402 = (
// Clear OutboundMessageNonceStore
frame_support::migrations::VersionedMigration<
0,
1,
runtime_common::migrations::liquidity_pools_gateway::Migration<Runtime>,
runtime_common::migrations::liquidity_pools_gateway::clear_outbound_nonce::Migration<
Runtime,
>,
pallet_liquidity_pools_gateway::Pallet<Runtime>,
<Runtime as frame_system::Config>::DbWeight,
>,
// Remove deprecated DomainRouters entries
frame_support::migrations::VersionedMigration<
1,
2,
runtime_common::migrations::liquidity_pools_gateway::clear_deprecated_domain_router_entries::Migration<Runtime>,
pallet_liquidity_pools_gateway::Pallet<Runtime>,
<Runtime as frame_system::Config>::DbWeight,
>,
wischli marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
4 changes: 4 additions & 0 deletions runtime/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ cumulus-pallet-aura-ext = { workspace = true }
cumulus-pallet-parachain-system = { workspace = true }
cumulus-pallet-xcm = { workspace = true }
cumulus-pallet-xcmp-queue = { workspace = true }
liquidity-pools-gateway-routers = { workspace = true }
orml-asset-registry = { workspace = true }
orml-tokens = { workspace = true }
orml-xcm = { workspace = true }
Expand Down Expand Up @@ -207,6 +208,7 @@ std = [
"pallet-keystore/std",
"pallet-liquidity-pools/std",
"pallet-liquidity-pools-gateway/std",
"liquidity-pools-gateway-routers/std",
"pallet-liquidity-rewards/std",
"pallet-loans/std",
"pallet-membership/std",
Expand Down Expand Up @@ -284,6 +286,7 @@ runtime-benchmarks = [
"pallet-keystore/runtime-benchmarks",
"pallet-liquidity-pools/runtime-benchmarks",
"pallet-liquidity-pools-gateway/runtime-benchmarks",
"liquidity-pools-gateway-routers/runtime-benchmarks",
"pallet-liquidity-rewards/runtime-benchmarks",
"pallet-loans/runtime-benchmarks",
"pallet-membership/runtime-benchmarks",
Expand Down Expand Up @@ -357,6 +360,7 @@ try-runtime = [
"pallet-keystore/try-runtime",
"pallet-liquidity-pools/try-runtime",
"pallet-liquidity-pools-gateway/try-runtime",
"liquidity-pools-gateway-routers/try-runtime",
"pallet-liquidity-rewards/try-runtime",
"pallet-loans/try-runtime",
"pallet-membership/try-runtime",
Expand Down
3 changes: 3 additions & 0 deletions runtime/common/src/evm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,12 @@ mod tests {
}

pub mod utils {
#[cfg(feature = "std")]
use sp_core::H160;
#[cfg(feature = "std")]
use sp_std::collections::btree_map::BTreeMap;

#[cfg(feature = "std")]
use crate::evm::precompile::H160Addresses;

#[cfg(feature = "std")]
Expand Down
Loading