-
Notifications
You must be signed in to change notification settings - Fork 490
Prep for Shiden AssetHub migration #1533
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
base: master
Are you sure you want to change the base?
Conversation
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.
Did we test it with chopsticks?
let default_backend = parachain_config.chain_spec.default_network_backend(); | ||
// If the network backend is unspecified, use the default for the given chain. | ||
let network_backend = parachain_config | ||
.network | ||
.network_backend | ||
.unwrap_or(default_backend); | ||
let network_backend = parachain_config.network.network_backend; |
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.
I didn't check the stable2412 patch releases diff, but is there any other noteworthy changes other than this?
primitives/src/xcm/mod.rs
Outdated
if reserve_location.parents == 1 | ||
&& !matches!(reserve_location.first_interior(), Some(Parachain(_))) | ||
{ | ||
// DOT/KSM token is not allowed to be migrated to sibling parachain as it will use relay as reserve | ||
// update this to `Some(Location::new(1, [Parachain(ASSET_HUB_PARA_ID)]))` when migration is done | ||
return None; |
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.
I maybe misunderstanding something, the "if" condition check for a parachain reserve not relay, why?
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.
I guess you miss the !
in !matches!(reserve_location.first_interior(), Some(Parachain(_)))
It checks that it is the relay token (parent:1 interior: None) and not some Parachain token
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.
Not sure I understand about the pallet calls that will be disabled though.
Checking the docs provided by Parity, it relates to reserve transfer which is only used for transferring tokens for which Astar/Shiden are reserve.
Also, about the solution/approach - perhaps a more sound one would be to disable relay chain as valid reserve via a dedicated call, i.e. by changing some value? My only concern is the requirement for timing the runtime upgrade.
primitives/src/xcm/mod.rs
Outdated
/// addition will convert self absolute location to relative location. | ||
/// This struct will ensure that during (and only during) asset migration, no DOT/KSM token will get stuck | ||
/// on relay chain. | ||
pub struct AbsoluteAndRelativeReserveProviderAssetHubMigration<AbsoluteLocation>( |
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.
Is this only for migration though?
Seems like something that will be used going forward, and the other one will be deprecated.
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.
This definition comment and the comment in lines below:
// DOT/KSM token is not allowed to be migrated to sibling parachain as it will use relay as reserve
// update this toSome(Location::new(1, [Parachain(ASSET_HUB_PARA_ID)]))
when migration is done
Are indeed opposite 👍
So I'll suffix it with Shiden
So it will be None
during migration and Para 1000
after migration
Then for Astar I'll use AbsoluteAndRelativeReserveProviderAstrar
and use it for None
When both Shiden and Astar are migrated I will use AbsoluteAndRelativeReserveProvider
back that send Para 1000 for KSM/DOT, and remove AbsoluteAndRelativeReserveProviderSiden
and AbsoluteAndRelativeReserveProviderAstar
temp structs
Yes the docs are not clear enough agree. But this message is more detailed. The issue is DOT/KSM transfers between 2 Paras. Also check this test
For Also during migration it will still be possible to use XCM using |
@ashutoshvarma I haven't specifically tested with chopsticks. However I've tested it with e2e-tests |
I see, but it's for the We should only need to block
I see, and your idea is fine. |
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.
Looking at the docs for migration, I think I can phrase my concern now properly. :)
Do we really need to apply these changes to the runtime?
Asking this since I thought the flow would be something like:
- apply runtime-1700
- AH migration happens
- disable relay chain as reserve (in some future runtime upgrade)
The rest should be handled offchain, by the UI & apps.
I might be missing something, but don't see the need to handle this via 2 separate runtime upgrades.
I haven't considered it might be unsuported. This simplify a lot of things. I'll revert the But it remains for Xtokens though. I also planned to have the flow as you described. It's because of the bug/issue that we need to have this intermediary runtime upgrade. |
Minimum allowed line rate is |
I understand your point, but still, even if this happens, it's because someone executed this call. Instead, can we adjust your solution so that the With that approach, both Shiden and Astar runtime code updates can be handled immediately. EDIT: This can also be tested using the integration testing. |
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.
Can you test this using integration test?
Also, since this new read has been introduced, we should account for the weight somewhere. Of course, it's not the end of the world if we ignore it since it's just one read and we'll remove it later, but in that case please add a comment somewhere that it's ignored on purpose.
primitives/src/xcm/mod.rs
Outdated
pub struct ReserveAssetFilter<T>(PhantomData<T>); | ||
impl<T> ContainsPair<Asset, Location> for ReserveAssetFilter<T> | ||
where | ||
T: pallet_xc_asset_config::Config, |
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.
I understand this is temporary, but we should avoid making the entire pallet a dependency here. Instead, it could be handled by a simpler trait, like Get<MigrationStep>
which the pallet can then implement.
primitives/src/xcm/mod.rs
Outdated
&& !matches!(reserve_location.first_interior(), Some(Parachain(_))); | ||
|
||
// KSM/DOT token is not allowed to be transferred to sibling parachain as it will use relay as reserve during migration | ||
if is_relay_token && asset_hub_migration_step == MigrationStep::Ongoing { |
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.
Just a suggestion, but you'd probably get better readability if you handle migration steps using match
.
Pull Request Summary
Ship 2, 3 and 4 described in this issue: #1532 :
EDIT: Not doing (3) this as transfer_assets is a blacklisted call:
3. Deactivate calls that can use Kusama as reserve: Throw error on transfer_assets and (limited)reserve_transfer_assets by using latest version on pallet_xcm (updated to latest commit of
stable2412
)_Note:
Because of this issue in yamux, I am using a patched version
EDIT: Aslo updated e2e-tests PR