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: upgrade1020 misc 2 #1532

Merged
merged 8 commits into from
Sep 6, 2023
Merged

Conversation

mustermeiszer
Copy link
Collaborator

Description

Miscellaneous changes for the upgrade. Details see changes

Changes and Descriptions

  • new EnsureAccoutOrRootOr struct - allows to define an admin account for certain calls
    • we need that to block the gatway logic faster than council could do (temporary only until we reach stability on the Centrifuge and Soidity side)
  • Bumb Development version to 10.21
  • Adapt weights of pallets

Checklist:

  • I have added Rust doc comments to structs, enums, traits and functions
  • I have made corresponding changes to the documentation
  • I have performed a self-review of my code
  • I have added tests that prove my fix is effective or that my feature works

@mustermeiszer mustermeiszer changed the base branch from main to upgrade1020 September 5, 2023 14:40
@mustermeiszer
Copy link
Collaborator Author

This builds with --release and with --release --features runtime-benchmarks. I will trigger the benchmarks from this branch here as it contains all the latest changes and we must not wait for benchmarks then tomorrow.

@mustermeiszer
Copy link
Collaborator Author

/benchmark centrifuge

@mustermeiszer
Copy link
Collaborator Author

/benchmark altair

@github-actions
Copy link

github-actions bot commented Sep 5, 2023

✅ Uploaded benchmarks for: centrifuge
Find the artifact here: https://github.com/centrifuge/centrifuge-chain/actions/runs/6089663515

@mustermeiszer
Copy link
Collaborator Author

/benchmark development

@github-actions
Copy link

github-actions bot commented Sep 5, 2023

✅ Uploaded benchmarks for: altair
Find the artifact here: https://github.com/centrifuge/centrifuge-chain/actions/runs/6089664744

Copy link
Contributor

@wischli wischli left a comment

Choose a reason for hiding this comment

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

LGTM! 🚀 Of course, tests need to be fixed.

Comment on lines 433 to 436
pub type EnsureAccountOrRootOr<Account, O> = EitherOfDiverse<
EitherOfDiverse<EnsureSignedBy<AdminOnly<Account>, AccountId>, EnsureRoot<AccountId>>,
O,
>;
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Couldn't we simplify this?

Suggested change
pub type EnsureAccountOrRootOr<Account, O> = EitherOfDiverse<
EitherOfDiverse<EnsureSignedBy<AdminOnly<Account>, AccountId>, EnsureRoot<AccountId>>,
O,
>;
pub type EnsureAccountOrRootOr<Account, O> = EitherOfDiverse<
EnsureAccountOrRoot<Account>,
O,
>;

Comment on lines +92 to +98
Weight::from_parts(78_019_565, 19974)
.saturating_add(Weight::from_ref_time(38_884_782).saturating_mul(N))
.saturating_add(RocksDbWeight::get().reads(8))
.saturating_add(RocksDbWeight::get().reads((7_u64).saturating_mul(N)))
.saturating_add(RocksDbWeight::get().writes(8))
.saturating_add(RocksDbWeight::get().writes((6_u64).saturating_mul(N)))
.saturating_add(Weight::from_proof_size(17774).saturating_mul(N))
Copy link
Contributor

@wischli wischli Sep 6, 2023

Choose a reason for hiding this comment

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

Note: I made sure this default weight and PoV size for liquidity pool extrinsics is still executable. It is.

I do believe though we should increase it when we introduce foreign investments or did you factor that in already?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I did too ^^

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, I think we should increase it.

@mustermeiszer
Copy link
Collaborator Author

Integration tests and test go through locally I will merge that now. We can run final CI on feature branch then.

@mustermeiszer mustermeiszer merged commit 518572f into upgrade1020 Sep 6, 2023
11 checks passed
mustermeiszer added a commit that referenced this pull request Sep 6, 2023
* wip xcm v3 asset-registry migrations

* fix: xcm v3 altair, centrifuge

* feat: add defensive SafeCallFilter for transact

* clean up asset addition for catalyst & centrifuge

* add Altair + Algol migration

* Add Liquidity Pools related pallets to centrifuge runtime (#1523)

* 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

* 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

* feat: safe XCM version migration + extend SafeCallFilter (#1526)

* 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]>

* Feat/upgrade1020 misc 1 (#1529)

* fix: asset metadata xcm v3 migration cleanup other migrations (#1528)

* 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]>

* fmt

* fixup

* Upgrade1020 gateway changes (#1531)

* 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: upgrade1020 misc 2 (#1532)

* 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: bump weights for 1020 (#1533)

* chore: update centrifuge, altair weights

* feat: bump and improve dev weights

* fix: transfer_allowlist weights

* feat: normalize SafeCallFilter across runtimes

* fix: native asset key in migration

---------

Co-authored-by: William Freudenberger <[email protected]>
Co-authored-by: Cosmin Damian <[email protected]>
Co-authored-by: Frederik Gartenmeister <[email protected]>
Co-authored-by: nuno <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants