-
Notifications
You must be signed in to change notification settings - Fork 358
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
Limit the max number of assets weighable in XCM #2215
Conversation
Just to be clear on what this PR does: if I withdraw 15 assets (nothing prevents me today from doing that) I will be charged as if I was withdrawing 10. Is this the behavior we want? I see statemint applies 100 so I just want to be sure we are doing what we want here: |
Good point, the limit applied in the weigher should be equal the the limit applied by the executor, so |
* XCM: Limit the max number of assets weighable * apply a more reasonable limit for max assets * MAX_ASSETS should be equal to MaxAssetsIntoHolding
What does it do?
To prevent unreasonably high count values from overweighing related XCM instructions, we should have an upper limit on how many assets we would weight during the weight calculation of XCM and we should apply this limit to all *Counted variants.
This PR also apply the same limit for
MAX_ASSETS
andMaxAssetsIntoHolding
.The maximum number of "weighable" assets has been reduced from 100 to 64.
This means that if you try to send an XCM message that tries to handle more than 64 assets at the same time, it will still fail as before, but the weigher will charge less.
What important points reviewers should know?
Is there something left for follow-up PRs?
What alternative implementations were considered?
Are there relevant PRs or issues in other repositories (Substrate, Polkadot, Frontier, Cumulus)?
What value does it bring to the blockchain users?