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

Fees for statemine transfers #881

Open
sander2 opened this issue Jan 18, 2023 · 3 comments
Open

Fees for statemine transfers #881

sander2 opened this issue Jan 18, 2023 · 3 comments

Comments

@sander2
Copy link
Contributor

sander2 commented Jan 18, 2023

I've been looking at transfers from parachains to statemine/t. The effects on bookkeeping are:

  • Parachain.user balance decreases by user_fee
  • Relaychain.ParaSovereign decreases by user_fee - MinXcmFee
  • Relaychain.StatemintSovereign increases by user_fee - MinXcmFee - RelayFees
  • Statemint.ParaSovereign gets a deposit from the teleport of user_fee - MinXcmFee - RelayFees - StatemintFeesForTeleportMsg.
  • Statemint.ParaSovereign withdraws MinXcmFee

I'm wondering about the correctness of the first two items. Every time you do a do a transfer, the imbalance between Relaychain.ParaSovereign and the total issuance on the parachain increases by MinXcmFee, essentially leaving the sovereign account with more balance than users on the parachain can withdraw. Is there a reason for this, or is this a bug?

@shaunxw
Copy link
Member

shaunxw commented Jan 19, 2023

This is due to the cross-chain transfer to statemine support #698 , which no better solution was found other than sending fees separately to Kusama and Statemine. The gap amount MinXcmFee between parachain sovereign account and parachain issuance goes to Statemin. It should be fine as Statemine.ParaSovereign + Kusama.ParaSovereign is still balanced with parachain total issuance.

@sander2
Copy link
Contributor Author

sander2 commented Jan 19, 2023

It should be fine as Statemine.ParaSovereign + Kusama.ParaSovereign is still balanced with parachain total issuance.

This would be the case if the destination of the teleport of the first message were to the user account, but that is not the case - the teleport is to Statemine.ParaSovereign. The amount teleported is supposed to be enough such that after the two messages, there is not a net decrease in Statemine.ParaSovereign.

Consider the case where Statemine.ParaSovereign is 0 before the xtokens call. Obviously it can not decrease further. The call will still succeed if the user is teleporting sufficient fees, but after both xcm messages have been processed, the result is:

  • Kusama.ParaSovereign decrease by user_fee - MinXcmFee
  • Statemine.ParaSovereign does not decrease
  • Parachain.totalIssuance decreases by user_fee

So an imbalance of MinXcmFee is created

@xlc
Copy link
Member

xlc commented Jan 20, 2023

Yeah what we have currently is just a workaround. The fee mechanism on Statemine/t is just very poor DX. Feel free to propose alternative solution if you have.

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