-
Notifications
You must be signed in to change notification settings - Fork 137
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
[Account Storage Maps] Refactor storage into V1 and V2 #3678
[Account Storage Maps] Refactor storage into V1 and V2 #3678
Conversation
…ap) into separate type
…to bastian/refactor-account-storage
…' into bastian/refactor-account-storage
Cadence Benchstat comparisonThis branch with compared with the base branch onflow:feature/combine-domain-payloads-and-domain-storage-maps commit 0abfa9a Collapsed results for better readability
|
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.
Nice! Since this is DRAFT, I only left one comment about how V1 and V2 are used.
By changing how V1 and V2 are used, we can have consistent account format for existing accounts regardless of StorageFormatV2Enabled
settings.
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.
I mostly reviewed for general Go code. LGTM!
TestRuntimeStorageForUnmigratedAccount
seems to be failing though.
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.
Nice! Thanks for incorporating feedback and also for adding tests for feature flag.
I left a comment about extra register reads we can avoid for new account when createIfNotExists
is false and V2 is enabled.
@SupunS As mentioned in the description, that and the other test related to the migration are not yet adjusted, but in the follow-up PR, #3680. @fxamacker Some of your suggestions actually already exist in #3680 – should I maybe just merge #3680 into this PR, and then we can address everything here? (I initially tried to keep the PRs small) |
@turbolent Yes. I started reviewing PR 3680. I can review the differences here after you merge. |
Co-authored-by: Faye Amacker <33205765+fxamacker@users.noreply.github.com>
@fxamacker @SupunS Merged the migration-related follow-up PR #3680 into this, so everything is now in one PR. Can you please take another look? Sorry for the inconvenience |
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.
Nice! 👍 I just reviewed updates and new commits from PR #3680.
To confirm my understanding of the current implementation of feature flag & migration:
-
With feature flag disabled, all accounts are assumed as in V1 format and continue to be in V1 format. Register reads & writes are consistent with deployed code.
-
With feature flag enabled,
-
V1 accounts (with write ops) continue to be stored in V1 unless
storage.ScheduleV2MigrationForModifiedAccounts()
is called beforestorage.Commit()
. -
New accounts are stored in V2 format automatically without
storage.ScheduleV2MigrationForModifiedAccounts()
.
-
Co-authored-by: Faye Amacker <33205765+fxamacker@users.noreply.github.com>
Co-authored-by: Faye Amacker <33205765+fxamacker@users.noreply.github.com>
@fxamacker exactly, great summary 👍 |
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.
Nice! I left a minor suggestion.
BTW, what are your thoughts about reducing register reads for new accounts when createIfNotExists
is false:
I think we can avoid reading all domain registers for the scenario that doesn't need that.
@fxamacker Sorry, I had missed the comment reply due to the follow-up commits, I'll reply there |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feature/combine-domain-payloads-and-domain-storage-maps #3678 +/- ##
==========================================================================================
Coverage ? 80.20%
==========================================================================================
Files ? 419
Lines ? 96907
Branches ? 0
==========================================================================================
Hits ? 77728
Misses ? 16441
Partials ? 2738
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
caaf254
into
feature/combine-domain-payloads-and-domain-storage-maps
Description
Refactor the existing mixed V1/V2 code into separate files. This simplifies the logic, and more easily allows it to be feature-flagged
We can simply sort the new indices at commit time.
Put the V2 format behind a feature flag, and ensure that the behaviour with the flag disabled is exactly the same as it is currently. This allows us to perform a rolling/non-HCU deployment
Expose functions in storage to schedule accounts to be migrated to V2.
We'll discus which accounts and when to migrate in the upcoming sync with the Execution team.
master
branchFiles changed
in the Github PR explorer