-
Notifications
You must be signed in to change notification settings - Fork 180
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
Fix storage health check in Cadence 1.0 migration #5622
Fix storage health check in Cadence 1.0 migration #5622
Conversation
Currently, storage health check always fails with "slabs not referenced from account storage" because storage maps are not loaded in Cadence runtime storage even though payloads are loaded. This commit fixes this problem by loading storage map explicitly after loading payloads in storage.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feature/stable-cadence #5622 +/- ##
==========================================================
+ Coverage 56.95% 57.33% +0.37%
==========================================================
Files 390 817 +427
Lines 43837 83101 +39264
==========================================================
+ Hits 24968 47644 +22676
- Misses 16782 31709 +14927
- Partials 2087 3748 +1661
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
Thanks!
Do you have a concrete error from the logs where this occurs?
Why would we need this in addition to already loading all payloads before?
Yes, this storage check error happens before migration starts when I run locally modified atree migration. For context, in my local copy, I am adding storage health check in atree migration and testing it with testnet data. Most of the storage health check code are the same with the storage health check in Cadence 1.0 migration.
In Cadence runtime https://github.com/onflow/cadence/blob/master/runtime/storage.go#L330-L351 |
@fxamacker Ah, thank you for the explanation, I see now! |
Currently, storage health check always fails with "slabs not referenced from account storage" in pre-migration because storage maps are not loaded in Cadence runtime storage even though payloads are loaded.
This PR fixes this problem by loading storage map explicitly after loading payloads in storage.
Updates onflow/cadence#3192
cc: @turbolent