Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Can't make XCM from Bridge Hubs to relaychain - Problem with weights. #2758

Open
stepanLav opened this issue Jun 19, 2023 · 7 comments
Open

Comments

@stepanLav
Copy link

Hello!
In Nova Wallet we faced with problem to make XCM from Polkadot\Kusama Bridge Hubs to relaychain, the same for Polkadot Collectives.

Error:
1010: Invalid Transaction: Transaction would exhaust the block limits

Example for Kusama Bridge Hub:
https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fksm-rpc.stakeworld.io%2Fbridgehub#/extrinsics/decode

0x850284007a28037947ecebe0dd86dc0e910911cb33185fd0714b37b75943f67dcf9b6e7c014edd1421ac8139bf113dbde0353cab56ba6e7f2ee4ed9ebc16e1db6adae43a63979cae46fa6588c79278b7fdf53000c96f41df2f5d16ecf88d11dcf26230d886350000001f0801010001000101007a28037947ecebe0dd86dc0e910911cb33185fd0714b37b75943f67dcf9b6e7c0104000100000366fbc4420000000000
const sender ='5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY';

await api.tx("0x850284007a28037947ecebe0dd86dc0e910911cb33185fd0714b37b75943f67dcf9b6e7c014edd1421ac8139bf113dbde0353cab56ba6e7f2ee4ed9ebc16e1db6adae43a63979cae46fa6588c79278b7fdf53000c96f41df2f5d16ecf88d11dcf26230d886350000001f0801010001000101007a28037947ecebe0dd86dc0e910911cb33185fd0714b37b75943f67dcf9b6e7c0104000100000366fbc4420000000000").paymentInfo(sender).then(info => {
  console.log(info.weight.refTime.toHuman())
}) 

output:
18,446,744,073,709,551,615

Screen Screenshot 2023-06-19 at 21 35 24 Screenshot 2023-06-19 at 21 42 03

Same transaction on Statemine show much smaller numbers:

0x91028400589ac66941bf18d23d0c07837db939ae6c3ff58a4733ecce14c2986b2361071a011a9a886d78894f5e484d3eb500e2609d21621d83ae19bae122692178cfb3723a5e7d24fda1e7111920fcf615781d7ab8320f148becb677d0fa492db0f625f08154000000001f09030100030001010103589ac66941bf18d23d0c07837db939ae6c3ff58a4733ecce14c2986b2361071a0304000100000700da2e09020000000000
Screen Screenshot 2023-06-19 at 21 34 56 Screenshot 2023-06-19 at 21 40 55
@joepetrowski
Copy link
Contributor

For collectives, this is simple: You cannot reserve transfer assets to the Relay Chain because of the XCM config anyway, you must use teleport.

See:

impl xcm_executor::Config for XcmConfig {
	// ...
	// Collectives does not recognize a reserve location for any asset. Users must teleport DOT
	// where allowed (e.g. with the Relay Chain).
	type IsReserve = ();
	/// Only allow teleportation of DOT.
	type IsTeleporter = ConcreteNativeAssetFrom<DotLocation>;
	// ...
}

For the Bridge Hubs things are a bit more complicated. The Bridge Hubs themselves are set up to accept teleports of DOT from the Relay Chain, however the Relays do not recognize the Bridge Hub as a trusted teleporter. This currently makes teleportation of DOT to Bridge Hub a one-way street (that being said, there are very few reasons to have any asset on Bridge Hub in the first place, basically only if you want to be a collator and you need some DOT for transaction fees). IIRC, when setting up the Bridge Hub, we weren't sure at genesis if it should be a Trusted Teleporter or not. In one sense, it is a system chain and is trusted by its local Relay. In another, it's the gateway to "all other consensus systems", and other system chains may want to treat it as a reserve knowing that it will have forwarded its messages to (and relay messages from) untrusted locations. Now that we're further along in implementation, perhaps @acatangiu or @bkontur have an update on how the Relay Chain should be configured to see Bridge Hub.

@joepetrowski
Copy link
Contributor

In Nova Wallet we faced with problem to make XCM from Polkadot\Kusama Bridge Hubs to relaychain

I am a bit curious why you want to do this? There's generally no reason a user should interact with a Bridge Hub directly.

@valentunn
Copy link

valentunn commented Jun 21, 2023

Thanks for detailed reply! Should've looked at xcm config at the first place

In Nova Wallet we faced with problem to make XCM from Polkadot\Kusama Bridge Hubs to relaychain

I am a bit curious why you want to do this? There's generally no reason a user should interact with a Bridge Hub directly.

We basically wanted to provide two-way transfers between relay-chain and new system parachains. We thought it might be useful for felowwship members (for Collectives) and collators (for BridgeHub)

@joepetrowski
Copy link
Contributor

We basically wanted to provide two-way transfers between relay-chain and new system parachains. We thought it might be useful for felowwship members (for Collectives) and collators (for BridgeHub)

Yeah, OK. So for Bridge Hub, at least at the moment, it should probably be from the Relay or Asset Hub interface that allows you to teleport DOT/KSM to Bridge Hub, but with a very prominent warning like "At the moment, you cannot get your DOT off Bridge Hub, only send there if you have a specific reason (e.g. collation) to send DOT to Bridge Hub."

For Collectives, it does support DOT teleports both ways, so there's no need to do reserve transfers. People sending DOT using reserve transfers (i.e. to other parachains) should do it from Asset Hub anyway, so probably don't need to support that from Collectives. I think a lot of Fellows will appreciate a better UX on sending DOT there and participating in Fellowship governance :). As a side note, have you seen https://hackmd.io/33pI3HvlSkycp-1dQjRLZA ?

@bkontur
Copy link
Contributor

bkontur commented Jun 21, 2023

here is the PR which enables teleports of DOTs/KSMs back to the relay chain for BridgeHub

@joepetrowski
I guess, maybe there should be a possibility to teleport between relaychain and any system parachain back and forth,
and also between any two system parachains,
e.g. in the end, it should be possible to teleport DOTs from relaychain to BridgeHub, then teleport same DOTs from BridgeHub to Collectives, then teleport same DOTs from Collectives to AssetHub and so on

@antonkhvorov
Copy link

In Nova Wallet we faced with problem to make XCM from Polkadot\Kusama Bridge Hubs to relaychain

I am a bit curious why you want to do this? There's generally no reason a user should interact with a Bridge Hub directly.

We have received requests from number of community collators since there was no UI/convenient way to transfer tokens, therefore we have decided to jump in and help.

@joepetrowski
Copy link
Contributor

joepetrowski commented Jun 21, 2023

We have received requests from number of community collators since there was no UI/convenient way to transfer tokens, therefore we have decided to jump in and help.

Cool, as long as it's clear that this functionality is for a very niche group, then it's OK. But remember that as of now, the Bridge Hub has no bridges in its runtime, so we don't want people to think that sending assets there is a step toward bridging (this will not be done from Bridge Hub, but primarily from Asset Hub, which will handle interactions with Bridge Hub).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants