-
Notifications
You must be signed in to change notification settings - Fork 337
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
Allow to use evm foreign assets to pay XCM fees #2908
Conversation
WASM runtime size check:Compared to target branchMoonbase runtime: 2192 KB (no changes) ✅ Moonbeam runtime: 2144 KB (no changes) ✅ Moonriver runtime: 2140 KB (no changes) ✅ Compared to latest release (runtime-3102)Moonbase runtime: 2192 KB (+252 KB compared to latest release) Moonbeam runtime: 2144 KB (+244 KB compared to latest release) Moonriver runtime: 2140 KB (+240 KB compared to latest release) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes are great, also good coverage! I left some comments, maybe we could add a missing test (even though there are many), other than that LGTM.
runtime/common/src/migrations.rs
Outdated
|
||
//***** Start mutate storage *****// | ||
|
||
// Write asset metadat in new pallet_xcm_weight_trader |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Write asset metadat in new pallet_xcm_weight_trader | |
// Write asset metadata in new pallet_xcm_weight_trader |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some remarks
ts dev-tests suceed locally, there is something wrong with the dev-test CI job |
There are still 2 todos!() in the migrations file. |
Apart from the |
The zombienet tests are failing with: ERROR tokio-runtime-worker pallet_migrations::pallet: [🌗] Migration MM_MigrateXcmFeesAssetsMetadata consumed more weight than it was given! (Weight(ref_time: 18446744073709551615, proof_size: 18446744073709551615) > Weight(ref_time: 1999918717000, proof_size: 5242880)) |
This log make no sense anymore since we pause xcm and extrinsics at the block that execute migrations, so we do'nt care how many weights the migration consume as long as if fit in a block. That's why the migration return |
What does it do?
Create a new pallet that register all supported asset for XCM fees with their price relative to the native asset (MOVR or GLMR).
This PR completes several goals at once:
The way to add/edit/remove XCM fees support for a given asset has changed.
New way to register an asset price (formerly units per second)
Call:
xcmWeightTrader.addAsset(location, relative_price)
Allowed origins: GeneralAdmin, 5/9 of OpenTechCommittee, Root
Parameters
location: Location
scale encoded xcm v4 location of asset reserve relative to moonbeamrelative_price: u128
18 decimals balance needed to equal 1 unit of native asset (MOVR for moonriver and GLMR for moonbeam). For example, if the asset price is twice as low as the GLMR price, enter500_000_000_000_000_000
.Substrate event
xcmWeightTrader.SupportedAssetAdded(location, relativePrice)
New way to update an asset price (formerly units per second)
Call:
xcmWeightTrader.editAsset(location, relative_price)
Allowed origins: FastGeneralAdmin, 5/9 of OpenTechCommittee, Root
Parameters
location: Location
scale encoded xcm v4 location of asset reserve relative to moonbeamrelative_price: u128
18 decimals balance needed to equal 1 unit of native asset (MOVR for moonriver and GLMR for moonbeam). For example, if the asset price is twice as low as the GLMR price, enter500_000_000_000_000_000
.Substrate event
xcmWeightTrader.SupportedAssetEdited(location, relativePrice)
New feature: pause fee support for a given asset
Call:
xcmWeightTrader.pauseAssetSupport(location)
Allowed origins: FastGeneralAdmin, 5/9 of OpenTechCommittee, Root
Parameters
location: Location
scale encoded xcm v4 location of asset reserve relative to moonbeamSubstrate event
xcmWeightTrader.PauseAssetSupport(location)
New feature: resume fee support for a given asset
Call:
xcmWeightTrader.resumeAssetSupport(location)
Allowed origins: 5/9 of OpenTechCommittee, Root_
Parameters
location: Location
scale encoded xcm v4 location of asset reserve relative to moonbeamSubstrate event
xcmWeightTrader.ResumeAssetSupport(location)
New way to remove fee support for a given asset
Call:
xcmWeightTrader.removeAsset(location)
Allowed origins: 5/9 of OpenTechCommittee, Root_
Parameters
location: Location
scale encoded xcm v4 location of asset reserve relative to moonbeamSubstrate event
xcmWeightTrader.SupportedAssetRemoved(location)
What important points reviewers should know?
TODO