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

Replace weight argument in xtokens::transfer with max_fee #838

Closed
sander2 opened this issue Nov 11, 2022 · 1 comment · Fixed by #841
Closed

Replace weight argument in xtokens::transfer with max_fee #838

sander2 opened this issue Nov 11, 2022 · 1 comment · Fixed by #841

Comments

@sander2
Copy link
Contributor

sander2 commented Nov 11, 2022

Related to #656.

In practice, I believe people just put some arbitrary high amount for the weight in xtokens::transfer. To me it does make sense to have this as an argument at all. Users do not care how much weight is used on the destination chain - it is simply a representation of computation time on the remote chain. As such, it makes more sense to me to either have the weight argument be optional, or to remove it altogether. If not supplied, the code would set the limit to Unlimited.

If anything, users may care about how many fees they pay. So we could consider adding an optional max_fee argument to xtokens::transfer. Note that the BuyExecution instruction takes both a max_fee and a max_weight argument. However, even the use max_fee is dubious. If the fee is insufficient, presumably the transferred tokens get trapped and the user can then recover them using a ClaimAsset instruction. However, the user would still end up paying the fees to pay for execution of this new message..

Interested in hearing your thoughts about this.

@shaunxw
Copy link
Member

shaunxw commented Nov 13, 2022

Agreed. The weight parameter was designed when there was no way to specify it as unlimited. I think it's time to move on and make it an optional weight_limit. For most cases, front-end apps can pass none to indicate unlimited. In the case similar to limited_reserve_transfer_assets in pallet-xcm, some weight limit can be provided.

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

Successfully merging a pull request may close this issue.

2 participants