-
Notifications
You must be signed in to change notification settings - Fork 185
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
Cadence Account Storage Map Migration #6761
Conversation
…omain-payloads-and-domain-storage-maps
…ntV2Migration contract
@turbolent Thanks for working on this part of the integration! Do we want to create a feature branch and target this PR to the feature branch? |
@onflow/flow-cadence-execution is there a way to call |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6761 +/- ##
==========================================
- Coverage 43.29% 41.19% -2.10%
==========================================
Files 1558 2131 +573
Lines 139443 186566 +47123
==========================================
+ Hits 60366 76865 +16499
- Misses 74026 103264 +29238
- Partials 5051 6437 +1386
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@turbolent during bootstrapping you have access to the function When you want to run Let me know if that helps. |
@janezpodhostnik Thanks! It turned out that setting up the functions in the runtime won't work, because an environments chain ID might change (default config chain is MN, but then actual chain is e.g. Emulator). I refactored the code to be similar to the EVM setup, i.e. declaring the functions in the transaction invoker and in the script invoker. |
@fxamacker I fixed a few things and added a test in 8b597cb which demonstrates that the migration of the service account works. Next step is probably to write an integration test which does this using the system chunk transaction, but I'm very new to this. Maybe someone from @onflow/flow-cadence-execution can take this on or at least point me in the right direction? |
@turbolent Thanks for adding the test and other updates! Would you like me to start reviewing this PR or should I wait until integration test is added and DRAFT status is removed? No rush, just checking before I begin something needed next week. |
@fxamacker Feel free to already start reviewing it. We'll probably want to have the integration tests before we merge, but feedback is already appreciated, thanks! |
enable storage format v2 for all but mainnet
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 one minor comment about possibility of automatically disabling batch migration by adding and using something like a max address index.
…ion-startup-fix Add default fvm context to the epoch counter script
…ion-enable-mainnet Enable storage format v2 on mainnet
Implement the migration logic for onflow/cadence#3584
AccountV2Migration
, which is deployed to the service account during bootstrapping. ItsAdmin
resource is able to trigger the migration for the next batch of accounts to be migrated, by calling the injectedscheduleAccountV2Migration
functionfun scheduleAccountV2Migration(addressStartIndex: UInt64, count: UInt64): Bool
to the new contractAccountV2Migration
in the service account. It generates the addresses in the given range, and schedules the migration to the new account storage format V2. It essentially just calls the internal Go functionruntime.Storage.ScheduleV2Migration()
provided by Cadence.