-
Notifications
You must be signed in to change notification settings - Fork 766
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
Generalize VariantCount into InstanceCount #4033
Comments
Not sure what you mean by this. This was always "static". The only change this linked pr is bringing is that the number of locks is calculated automatically for you.
This looks problematic to me. Why is this unbounded? How does this works? What is ID? |
I asked Gav once on whether we should allow dynamically generated |
It is bounded by other logic to something like 100. In our usage in subspace, ID is the operator id, a nominator can nominate multiple operators at the same time and result in multiple different |
Why do you need one exclusive hold per operator/nominator? |
I guess it is convenient to do. Otherwise the list will have to be additionally maintained in another place with some reference counting of sorts. |
Yeah, it is convenient, so we don't need to keep track of how many balances are on hold for a particular operator and use |
Okay i guess just adding a new trait like |
this is designed to only have very limited and static number of reasons. I will suggest a new pallet or something for this requested feature, instead of modify the existing code because it breaks some of the original assumptions yeah it maybe possible to do it in such why that is still somewhat compatible, but it can’t scale, it can easily misused. we should aim for a proper solution instead |
Is there an existing issue?
Experiencing problems? Have you tried our Stack Exchange first?
Motivation
#2657 replaces
MaxHolds
withVariantCount::VARIANT_COUNT
it works fine with RuntimeHoldReason enum that has a static number of instances like:but it is not general enough to work fine with enums that have data attached to the variant like:
which still has 2 variants but can construct much more than 2 instances with different data, and at the end it still requires something similar to
MaxHolds
Request
To cover both use cases, generalize
VariantCount
intoInstanceCount
:for enum that has a static number of instances the
INSTANCE_COUNT
value will be the same asVariantCount:: VARIANT_COUNT
, while for enum that doesn't have a static number of instancesINSTANCE_COUNT
works similar toMaxHolds
Solution
No response
Are you willing to help with this request?
Yes!
The text was updated successfully, but these errors were encountered: