-
Notifications
You must be signed in to change notification settings - Fork 138
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
Track resources with atree.ID instead of StorageID #2627
Closed
fxamacker
wants to merge
15
commits into
fxamacker/use-updated-atree-array-and-map-get
from
fxamacker/use-atree-id-for-tracking
Closed
Track resources with atree.ID instead of StorageID #2627
fxamacker
wants to merge
15
commits into
fxamacker/use-updated-atree-array-and-map-get
from
fxamacker/use-atree-id-for-tracking
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
Currently, Cadence ArrayValue, CompositeValue, and DictionaryValue creates atree.Storable directly from StorageID of its Atree values. In the future, some Atree values can be inlined so they don't have StorageID, and Atree values need to handle Storable depending on maxInlineSize and other factors. This commit delegates Cadence composite values' Storable() to its internal Atree values. So future changes to Atree values and their storables don't break Cadence.
Currently, storage address is derived from StorageID(). In the future, some Atree values can be inlined so they don't have StorageID and address needs be derived differently. This commit delegates storage address to its internal Atree values, by calling Address().
Currently, Array.StorageID() and OrderedMap.StorageID() are used as identifier to track resources, etc because storage IDs are guaranteed to unique. However, atree storage ID should be only used to retrieve slabs (registers) from storage. Also, when Atree register inlining is implemented in the future, some resources may not be stored in separate slabs, so they will not have storage IDs anymore. This commit uses Array.ID() and OrderedMap.ID() to uniquely identify resources.
…type-test Fix data race in sema/type_test.go
…site-storable-to-atree Delegate Cadence composite `Storable()` to Atree
…atree-storage-id Delegate storage address to Atree
SupunS
approved these changes
Jul 6, 2023
Closing this PR without merging because atree was updated to newer API and this PR is outdated. I will open a new PR to replace this. |
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.
Updates onflow/atree#292
More details at onflow/atree#321
Description
Currently,
Array.StorageID()
andOrderedMap.StorageID()
are used as identifier to track resources, etc because storage IDs are guaranteed to unique. However, atree storage ID should be only used to retrieve slabs (registers) from storage.Also, when Atree register inlining is implemented in the future, some resources may not be stored in separate slabs, so they will not have storage IDs anymore.
This commit uses
Array.ID()
andOrderedMap.ID()
to uniquely identify resources.master
branchFiles changed
in the Github PR explorer