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

Upgrade 1020 #1522

Merged
merged 17 commits into from
Sep 6, 2023
Merged

Upgrade 1020 #1522

merged 17 commits into from
Sep 6, 2023

Conversation

mikiquantum
Copy link
Contributor

@mikiquantum mikiquantum commented Aug 31, 2023

Description

Last items to complete before code freeze:

  • XCM v3 Migration
    • Asset Registry (Migrate current registry location entry of CurrencyId::Native)
    • ...
  • Add Liquidity Pool Gateway Pallet to runtime PR
    • Dummy Liquidity Pool InboundQueue that triggers event with info (Runtime struct)
    • Include Liquidity Pools to runtime
      • NOT use LPs as InboundQueue
    • Wrapper OutboundQueue that LPs consumes
      • Only allow (AddCurrency, UpdateMember, AddPool, AddTranche, UpdateTrancheTokenPrice)
      • Uses gateway as real outbound
  • Custom LP XCM Converter to GatewayOrigin xcm origin converter gateway origin #1521
    NOTE: This one will be merged to main in order to allow upgrading DEV earlier
  • Adapt Liquidity Pools Weights PR
  • Bump versions

@wischli wischli added the D8-migration Pull request touches storage and needs migration code. label Aug 31, 2023
@@ -124,7 +123,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("altair"),
impl_name: create_runtime_str!("altair"),
authoring_version: 1,
spec_version: 1030,
spec_version: 1031,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Need to bump bc Algol is already in 30

/// that have to be applied on that chain, which includes migrations that have
/// already been executed on Algol (1028 & 1029).
#[cfg(not(feature = "testnet-runtime"))]
pub type UpgradeAltair1030 = (
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Needed to bump bc Algol was already in 1030

crate::NativeToken,
crate::ExistentialDeposit,
>,
pub type UpgradeAltair1031 = (
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Needed to bump bc Algol was already in 1031

Copy link
Contributor

Choose a reason for hiding this comment

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

NOTE: Algol is currently on 1030.

runtime/altair/src/migrations.rs Outdated Show resolved Hide resolved
@@ -181,57 +193,413 @@ mod asset_registry {
}
}

/// Register the LiquidityPools Wrapped Ethereum USDC
pub struct RegisterLpEthUSDC;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removing RegisterLpEthUSDC migration and adding it within the AssetRegistryMultilocationToXCMV3 one

ETHEREUM_USDC,
),
),
]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add here any current registered asset that is added between now and the upgrade.

}

let mut meta_count = orml_asset_registry::Metadata::<T>::iter_keys().count() as u32;
let is_centrifuge = meta_count == 6;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Bump number according to current number of assets on chain.

mikiquantum and others added 6 commits September 4, 2023 14:51
* centrifuge: Add liquidity pools pallets to runtime

* centrifuge: Add LP OutboundQueue wrapper to runtime

* taplo: Obey

* runtime: Move OutboundQueue import

* centrifuge: Allow both root and half of council as admin origins for LP pallets

* centrifuge: Add Axelar Gateway precompile

* centrifuge: Use correct HRMP encoder, update HRMP fee to 1 DOT, use XCM V3 imports

* centrifuge: Update error message for InboundQueue

* clippy: Fix warnings

* centrifuge: Rename outbound queue, fix migration import for orml asset registry
// TODO: Verify that these ones can be removed from Algol upgrade, since the first 2 fail
// runtime_common::migrations::nuke::Migration<crate::Loans, RocksDbWeight, 1>,
// runtime_common::migrations::nuke::Migration<crate::InterestAccrual, RocksDbWeight, 0>,
// runtime_common::migrations::nuke::Migration<crate::PoolSystem, RocksDbWeight, 0>,
Copy link
Contributor

Choose a reason for hiding this comment

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

This was added during re-base.

// runtime_common::migrations::nuke::Migration<crate::Loans, RocksDbWeight, 1>,
// runtime_common::migrations::nuke::Migration<crate::InterestAccrual, RocksDbWeight, 0>,
// runtime_common::migrations::nuke::Migration<crate::PoolSystem, RocksDbWeight, 0>,
// runtime_common::migrations::nuke::Migration<crate::Investments, RocksDbWeight, 0>,
Copy link
Contributor

Choose a reason for hiding this comment

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

This was added during re-base.

cdamian and others added 3 commits September 4, 2023 15:50
* centrifuge: Enable LP gateway XCM origin converter

* centrifuge: Update LP pallet config to use Quantity for BalanceRatio

* runtime: Update XCM origin converter, use Quantity in LP message, add OriginRecovery to LP gateway
* fix: allow gateway process msg for xcm

* feat: add safe xcm version migration

* fix: Allow process_msg for xcm transact

* refactor: remove spec_version check

* refactor: stricter SafeCallFilter

* Upgrade1020 LP follow-ups (#1525)

* centrifuge: Enable LP gateway XCM origin converter

* centrifuge: Update LP pallet config to use Quantity for BalanceRatio

* runtime: Update XCM origin converter, use Quantity in LP message, add OriginRecovery to LP gateway

* fix: rm OrderBook safe call cause missing

* fix: OrderBook missing in both runtimes

* fix: clippy

---------

Co-authored-by: Cosmin Damian <[email protected]>
wischli and others added 7 commits September 5, 2023 15:05
* fix: centrifuge asset migration

* Apply suggestions from code review

Co-authored-by: Frederik Gartenmeister <[email protected]>

* chore: append cfg assets to catalyst

* fix: asset registry migration improvements

* feat: apply asset metadata migration to altair runtime

* fix: cleanup altair/algol migrations

* fix: less aggressive nuke pre-upgrade

* fix: finalize migrations, add context

* fix: clippy + cleanup imports

* fix: native currency altair, algol

* fix: Algol native currency name

---------

Co-authored-by: Frederik Gartenmeister <[email protected]>
* gateway: Use BoundedVec instead of EVMChain enum

* gateway: Add Sender type to LP gateway config

* gateway: Rename EVM chain size const, emit event when submitting message, adjust gateway sender provider
* feat: account ensuring origin

* feat: bumb runtime version develpment

* fix: allow council to control gatway on Altair based chains

* fix: use EnsureSigned, make use of type and add admin

* feat: overestimated weights for lp logic

* fix: taplooo

* fix: tests and comment
* chore: update centrifuge, altair weights

* feat: bump and improve dev weights

* fix: transfer_allowlist weights

* feat: normalize SafeCallFilter across runtimes
@wischli wischli marked this pull request as ready for review September 6, 2023 08:37
@wischli wischli requested a review from lemunozm as a code owner September 6, 2023 08:37
@mustermeiszer mustermeiszer changed the title WIP - Ongoing feature/release branch Upgrade 1020 Sep 6, 2023
@wischli wischli added the I9-release A specific release. label Sep 6, 2023
Copy link
Collaborator

@mustermeiszer mustermeiszer left a comment

Choose a reason for hiding this comment

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

Re-approving!

@mustermeiszer mustermeiszer merged commit 56fe24a into main Sep 6, 2023
11 checks passed
@NunoAlexandre NunoAlexandre deleted the upgrade1020 branch September 6, 2023 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
D8-migration Pull request touches storage and needs migration code. I9-release A specific release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants