-
Notifications
You must be signed in to change notification settings - Fork 243
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
Proper value for the HoldIdentifier::VARIANT_COUNT
#2674
Comments
You didn't describe the most crucial thing:
|
I don't think it is related to whether we are using |
I disagree here. There is a trait, it describes the intended contract. I can imagine how in future version of Substrate something will change and they will start relying on that constant for something that will break when contract is violated. This is a technical debt and ticking bomb waiting to explode at some unknown point in future as far as I'm concerned. |
I think the source of conflict is paritytech/polkadot-sdk#2657, which replaces pub enum HoldReason {
SlashForContinueMigrate,
SlashForMigrateCustomTop,
SlashForMigrateCustomChild,
} but it is not general enough to cover our usage where the number of the hold enum instance is unbounded due to the pub enum HoldIdentifier {
Staked(Id)
} |
Agree, can you create an issue about this upstream? Then update PR with TODO and link to that issue everywhere we violate defined contract. |
HoldIdentifier::VARIANT_COUNT
is used as the max number of holds an account can create, currently the following operation will create a hold on the caller account:ChannelReserveFee
DomainInstantiationDeposit
which means
HoldIdentifier::VARIANT_COUNT
serves as a limit of the combination number of the above operation. After the limit is met any of the above operations will fail (i.e. an account can nominate but later fail to withdraw due to this limit).Ideally, we should define limits for each of the above operations separately and set
HoldIdentifier::VARIANT_COUNT
toStaking * 2 + OpenXDMChannel + InstantiateDomain
.cc @jfrank-summit @dariolina
The text was updated successfully, but these errors were encountered: