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

Support shared hold id to have constant number of hold id #3013

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

NingLin-P
Copy link
Member

close #2674

This PR supports shared hold id that is used in staking, domain instantiation, and XDM channel, such that we can have a constant number of hold id variants and extrinsic that require creating hold won't fail due to the fixed hold id limit.

Because we also support the nomination of multiple different operators, opening multiple channel, and instantiating multiple domains so we have to add storage keep tracking of the hold balance.

Code contributor checklist:

Previously, we need to use withdraw_and_hold and then Currency::release

Signed-off-by: linning <[email protected]>
NOTE: we still need to keep track of the domain instantiation deposit in the state in
case the DomainInstantiationDeposit change in the future

Signed-off-by: linning <[email protected]>
@NingLin-P NingLin-P added the need to audit This change needs to be audited label Sep 11, 2024
NOTE: we still need to keep track of the channel reserve fee in the state in
case the ChannelReserveFee change in the future

Signed-off-by: linning <[email protected]>
Copy link
Contributor

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I don’t have enough context to fully review, but here are some small things I wasn’t sure about.

crates/pallet-domains/src/staking_epoch.rs Outdated Show resolved Hide resolved
domains/primitives/messenger/src/messages.rs Outdated Show resolved Hide resolved
Signed-off-by: linning <[email protected]>
Copy link
Member

@dastansam dastansam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, lgtm and not 100% familiar with the code to approve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need to audit This change needs to be audited
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proper value for the HoldIdentifier::VARIANT_COUNT
3 participants