Skip to content

Commit

Permalink
Fix storage health check in Cadence 1.0 migration
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
fxamacker committed Apr 3, 2024
1 parent c258474 commit be8b26d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/util/ledger/migrations/cadence_values_migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ func (m *CadenceBaseMigrator) MigrateAccount(
}
}

// Load storage map.
for _, domain := range domains {
_ = storage.GetStorageMap(address, domain, false)
}

storageHealthErrorBefore = storage.CheckHealth()
if storageHealthErrorBefore != nil {
m.log.Warn().
Expand Down

0 comments on commit be8b26d

Please sign in to comment.