Skip to content
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

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

turbolent
Copy link
Member

@turbolent turbolent commented Nov 26, 2024

Start work on the migration logic for onflow/cadence#3584

  • Add a new system contract AccountV2Migration, which is deployed to the service account during bootstrapping. Its Admin resource is able to trigger the migration for the next batch of accounts to be migrated, by calling the injected scheduleAccountV2Migration function
  • Expose a new function fun scheduleAccountV2Migration(addressStartIndex: UInt64, count: UInt64): Bool to the new contract AccountV2Migration 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 function runtime.Storage.ScheduleV2Migration() provided by Cadence.

@turbolent turbolent requested review from fxamacker and a team November 26, 2024 00:29
@turbolent turbolent self-assigned this Nov 26, 2024
@fxamacker
Copy link
Member

@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?

@turbolent
Copy link
Member Author

@onflow/flow-cadence-execution is there a way to call accountV2Migration.DeclareScheduleAccountV2MigrationFunction during bootstrapping?

@codecov-commenter
Copy link

codecov-commenter commented Nov 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 43.14%. Comparing base (a164070) to head (2a04742).
Report is 3 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master    #6761       +/-   ##
===========================================
+ Coverage   39.71%   43.14%    +3.42%     
===========================================
  Files        1332       45     -1287     
  Lines      123050     3201   -119849     
===========================================
- Hits        48875     1381    -47494     
+ Misses      69986     1713    -68273     
+ Partials     4189      107     -4082     
Flag Coverage Δ
unittests 43.14% <ø> (+3.42%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants