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

Incorrect fee estimation for Kusama -> Statemine teleport #6374

Closed
michalisFr opened this issue Oct 22, 2021 · 9 comments
Closed

Incorrect fee estimation for Kusama -> Statemine teleport #6374

michalisFr opened this issue Oct 22, 2021 · 9 comments

Comments

@michalisFr
Copy link

The UI gives an estimate of about 8 microKSM when teleporting from Kusama to Statemine. However, the actual fee is 3 or 2 microKSM.

Statemine v500 (coming out soon) includes:
paritytech/cumulus#559
which will allow the UI to make a correct estimate of the fee.

@jacogr
Copy link
Member

jacogr commented Oct 22, 2021

The UI itself does not estimate. It calls the payment_queryInfo RPC and those are the values presented.

@jacogr jacogr added the invalid label Oct 22, 2021
@michalisFr
Copy link
Author

Sorry, still grasping my head around this so I may not be phrasing or understanding it correctly.

My understanding is that the call happens on Kusama, but since the fee is deducted on the receiving end, the fee estimation from the call doesn't provide any useful info.

So, from what I understand the solution would be:

  1. Either to make that call to Statemine from Kusama when v500 is released (Monday) that will include that RPC call
  2. Or estimate the fee based on the weight of the XCM that's being sent

Is either of these possible?

@jacogr
Copy link
Member

jacogr commented Oct 22, 2021

You cannot use payment_queryInfo for xcm estimation. There is an issue logged on Polkadot (by me), to actually allow retrieval/estimation for xcm. (i.e. an xcm variant of payment_queryInfo that returns fees and weights)

The reason why it is currently inaccurate - the weights are not (yet) properly applied, i.e. there is a constant hard-coded weight passed through. (Westend is different atm since it runs the experimental "apply-weights-to-xcm" version)

But basically, until there is a xcm fee estimator, nothing much that can be done in the current form, it will always be "wrong". The best guess atm is "weight_being_applied * destination_fee" but the weight actually used is less than supplied. (It is a max up-to value, always set to 3,000,000,000 in both directions)

What the payment_queryInfo on Statemine makes possible -

(a) sending will actually have transactions fees displayed
(b) multisig wil start working (since there is now a weight estimator available)

@michalisFr
Copy link
Author

michalisFr commented Oct 22, 2021

Thanks for explaining @jacogr.

If I understand correctly, this:

The best guess atm is "weight_being_applied * destination_fee" but the weight actually used is less than supplied. (It is a max up-to value, always set to 3,000,000,000 in both directions)

is applicable now but it will give the max fee, not an estimation of the actual fee, correct?

Perhaps it's better to display that (mentioning it's the max fee) instead of a very low estimation?

I tried two teleports of 0.001 KSM and couldn't figure out why it wasn't arriving. And it took a couple of people some time to figure out the fees were more than the amount I sent. So, I imagine users will be even more confused. That way users will have an idea of the max they may pay and paying less in the end is better than the other way around.

@jacogr
Copy link
Member

jacogr commented Oct 22, 2021

The amount shown should be the max. (Assuming the existential requirement is met)

@michalisFr
Copy link
Author

Currently it shows 8 micro
Screenshot 2021-10-22 at 7 17 11 PM

Is this the result of "weight_being_applied * destination_fee"?

but the weight actually used is less than supplied.

Sorry, did you mean that the weight the UI uses in the above calculation is actually less than the actual weight of the XCM (so the displayed fee is less than the actual destination fee)? Or that the weight used in practice will be less than "weight_being_applied * destination_fee"?

@jacogr
Copy link
Member

jacogr commented Oct 22, 2021

The weight in practice will be less than that. The above is via the max weight applied.

@polkadot-js-bot
Copy link

This issue has been open for 21 days with no activity and is not labelled as an enhancement. It will be closed in 7 days.

@polkadot-js-bot
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.

@polkadot-js polkadot-js locked as resolved and limited conversation to collaborators Nov 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants