-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[Framework] Add on-the-fly fungible store concurrency upgrade to general case #12348
Merged
igor-aptos
merged 2 commits into
aptos-labs:igor/concurrent_fungible_balance
from
alnoki:alnoki/concurrent-fungible-balance-suggestions
Mar 5, 2024
Merged
[Framework] Add on-the-fly fungible store concurrency upgrade to general case #12348
igor-aptos
merged 2 commits into
aptos-labs:igor/concurrent_fungible_balance
from
alnoki:alnoki/concurrent-fungible-balance-suggestions
Mar 5, 2024
Conversation
This file contains 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
⏱️ 1h 23m total CI duration on this PR
|
lightmark
approved these changes
Mar 4, 2024
igor-aptos
approved these changes
Mar 4, 2024
thanks for working on this, this should allow for the optimization to be more generally applicable! |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## igor/concurrent_fungible_balance #12348 +/- ##
===================================================================
Coverage ? 70.3%
===================================================================
Files ? 850
Lines ? 189123
Branches ? 0
===================================================================
Hits ? 132957
Misses ? 56166
Partials ? 0 ☔ View full report in Codecov by Sentry. |
igor-aptos
merged commit Mar 5, 2024
195429b
into
aptos-labs:igor/concurrent_fungible_balance
41 of 46 checks passed
igor-aptos
pushed a commit
that referenced
this pull request
Mar 5, 2024
…ral case (#12348) * Add on-the-fly concurrency upgrade to general case * Clarify helper func doc comment
igor-aptos
pushed a commit
that referenced
this pull request
Mar 8, 2024
…ral case (#12348) * Add on-the-fly concurrency upgrade to general case * Clarify helper func doc comment
igor-aptos
pushed a commit
that referenced
this pull request
Mar 27, 2024
…ral case (#12348) * Add on-the-fly concurrency upgrade to general case * Clarify helper func doc comment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
@igor-aptos @georgemitenkov @lightmark
#11183 enables voluntary upgrading of a fungible asset store to use a concurrent balance, via
fungible_asset::upgrade_store_to_concurrent
. However,fungible_asset::upgrade_store_to_concurrent
requires anExtendRef
and thus cannot be used in the general case, becausefungible_asset::create_store
does not by default store anExtendRef
anywhere (#11183 (comment)).Importantly, the
primary_fungible_store
module has no way of provisioning anExtendRef
, which means that the current iteration of #11183 blocks all of a user's existing primary fungible asset stores (essentially all assets held in their wallet) from upgrading to concurrent balances when the features roll out on mainnet: in practice this means that most primary fungible stores would be locked out from concurrency forever.This PR adds a simple inline function call inside
fungible_asset::withdraw_internal
andfungible_asset::deposit_internal
that automatically upgrades a fungible store to concurrent balance on the fly (e.g. whenever an amount is transferred in or out of it).Hence with this PR, simple transfers to or from the same wallet can all be parallelized, including for fungible stores that were initialized before the on-chain framework upgrade