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

[P-K Bridge] AssetHubs - create wrapped/derivate representations for KSM/DOT #2401

Closed
3 tasks
Tracked by #2455
bkontur opened this issue Jul 18, 2023 · 6 comments
Closed
3 tasks
Tracked by #2455
Assignees

Comments

@bkontur
Copy link
Contributor

bkontur commented Jul 18, 2023

We need to create ForeignAssets for wrappedKSM on AssetHubPolkadot and wrappedDOT on AssetHubKusama.

Options: (lets consider wrappedDOT on AssetHubKusama)

  1. use pallet_assets::force_create on Kusama/AssethubKusama governance call
    force_create(
        MultiLocation(parents: 2, X1(GlobalConsensus(Polkadot))),
        SOVEREIGN_ACCOUNT,
        is_sufficient=false,
        min_balance=?
    )
    
  • what SOVEREIGN_ACCOUNT -> SA_OF_ASSET_HUB_POLKADOT(MultiLocation(parents: 2, X2(GlobalConsensus(Polkadot), Parachain(1000))) or SA_OF_POLKADOT(MultiLocation(parents: 2, X1(GlobalConsensus(Polkadot))))
  • what min_balance ?
  1. use pallet_assets::create from Polkadot relaychain
    create(
        MultiLocation(parents: 2, X1(GlobalConsensus(Polkadot))),
        ADMIN_ACCOUNT,
        min_balance=?
    )
    
  • what ADMIN_ACCOUNT: SA of Polkadot relay chain or SA of AssetHubPolkadot?
  • what min_balance ?
  • this means to extend/add XCM bridge routing to polkadot runtime
  1. option: anything else because ForeignCreators wont work for MultiLocation::parent() and AssetHubPolkadot

TODOs

  • resolve what option
  • prepare governance calls and referenda/proposals - for ForeignAssets
  • prepare governance calls and referenda/proposals - for HRMP and/or other stuff
@bkontur
Copy link
Contributor Author

bkontur commented Jul 18, 2023

@joepetrowski Joe, could you please, help with this?

@joepetrowski
Copy link

Yeah, HRMP channels should all be set up now.

I think we'd go the force_create route and actually set is_sufficient = true, at least for DOT on Kusama and perhaps also for KSM on Polkadot. min_balance can be lower on Kusama, perhaps Polkadot's Asset Hub's ED on Kusama (0.1 DOT), but we should find a similar value of Polkadot's ED for KSM on AHP.

@bkontur
Copy link
Contributor Author

bkontur commented Jul 18, 2023

if we go with isSufficient=true on both sides, then we dont need (for KSM<>DOT) any hacks and customization for pallet_xcm like we tried here paritytech/polkadot#7456

the only thing we need to fix is Trader and allow to pay fees from ForeignAssets instance, because now we allow only for TrustBased/Local instance:

type Trader = (
		UsingComponents<WeightToFee, KsmLocation, AccountId, Balances, ToStakingPot<Runtime>>,
		cumulus_primitives_utility::TakeFirstAssetTrader<
			AccountId,
			AssetFeeAsExistentialDepositMultiplierFeeCharger,
			TrustBackedAssetsConvertedConcreteId,
			Assets,
			cumulus_primitives_utility::XcmFeesTo32ByteAccount<
				FungiblesTransactor,
				AccountId,
				XcmAssetFeesReceiver,
			>,
		>,
	);

@joepetrowski
Copy link

Bonus then. We should use SwapFirstAssetTrader which solves this problem anyway paritytech/cumulus#2854

@joepetrowski
Copy link

joepetrowski commented Jul 18, 2023

what SOVEREIGN_ACCOUNT ->

  • SA_OF_ASSET_HUB_POLKADOT(MultiLocation(parents: 2, X2(GlobalConsensus(Polkadot), Parachain(1000))) or
  • SA_OF_POLKADOT(MultiLocation(parents: 2, X1(GlobalConsensus(Polkadot))))

This sounds more like a bridge implementation question. What would the bridge pass over as its origin? Since on Polkadot's local Asset Hub we call DOT { parents: 1, interior: Here }, IMO the second option is better.

Edit: Yes, let's go with the second option. As this is used for things like freeze, set_metadata, set_min_balance, etc., these calls should come from the governance location, not the reserve location, of the asset.

@acatangiu
Copy link
Collaborator

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

No branches or pull requests

3 participants