-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Allow locking to bump consumer without limits #9176
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
Merged
kianenigma
merged 22 commits into
master
from
kiz-currency-lock-consumer-demonstration-simple-fix
Jul 20, 2025
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
abc5a9a
demonstration of the issue
kianenigma 517822e
simple fix, just using inc_consumer_without_limits
kianenigma da446f6
finalize the branch
kianenigma 3e2d33f
fmt
kianenigma 348d841
bring back debug_assert
kianenigma f9e5f9b
better error handling + demonstrate freeze is the same
kianenigma 9b87180
better API and tests + try-state checks
kianenigma 437f14a
Merge branch 'master' into kiz-currency-lock-consumer-demonstration-s…
kianenigma 0571f66
fix test
kianenigma 4b028e0
Master.into()
kianenigma 2b1d298
Merge branch 'master' into kiz-currency-lock-consumer-demonstration-s…
Ank4n 6232516
Update substrate/frame/balances/src/lib.rs
kianenigma deac4f9
Merge branch 'master' into kiz-currency-lock-consumer-demonstration-s…
kianenigma 2bec55d
Master.into()
kianenigma 80eb490
fmt
kianenigma 40adcc9
Update from github-actions[bot] running command 'prdoc --bump patch'
github-actions[bot] 9630461
clippy
kianenigma c096e68
Merge branch 'kiz-currency-lock-consumer-demonstration-simple-fix' of…
kianenigma 244b317
fix PRDoc
kianenigma d37fdd2
Merge branch 'master' into kiz-currency-lock-consumer-demonstration-s…
kianenigma 9574dc6
Merge branch 'master' into kiz-currency-lock-consumer-demonstration-s…
kianenigma 05fa44f
fix prdoc
kianenigma File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| title: Allow locking to bump consumer without limits | ||
| doc: | ||
| - audience: Runtime Dev | ||
| description: |- | ||
| Locking is a system-level operation, and can only increment the consumer limit at most once. Therefore, it should use `inc_consumer_without_limits`. This behavior is optional, and is only used in the call path of `LockableCurrency`. Reserves, Holds and Freezes (and other operations like transfer etc.) have the ability to return `DispatchResult` and don't need this bypass. This is demonstrated in the unit tests added. | ||
| crates: | ||
| - name: pallet-balances | ||
| bump: major | ||
| - name: frame-support | ||
| bump: patch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
personally, I would always go with
inc_consumers_without_limit. adding an extra option introduces some complexity without fully eliminating the chance of the consumer ref count exceeding its maximum (+1 only). also, we already useinc_consumers_without_limitin other parts of the codebase.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm good point, I wasn't sure about the usage of this.
Reserveand so oninc_consumers_without_limit.I am happy to go either way (making everything
inc_consumers_without_limitwill simplify the PR indeed), and will spend a bit more time seeing what other pallets are doing before merging.