-
Notifications
You must be signed in to change notification settings - Fork 246
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. |
@NingLin-P what is the endgame solution here? Are you going to add a trait upstream or are we changing our code to move the need to store ID in hold identifiers on our end? |
I have spent some time thinking about this issue. There are actually 2 separate issues here:
This is more about the semantic or readability of the code because all we want is just to change the name
This is what I'm more concerned about because this value controls how many holds an account can create and once the limit is met the operation (see the PR description) that requires creating a hold will fail, no matter what the value of Remove the ID from the identifier can fix the issue (and also remove the need to rename to Another solution is to define a limit for the operation that requires creating a hold and setting the |
While not ideal, I think shared hold is what we are supposed to be doing by design |
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: