A broken reference is a StorageID referencing a non-existent register. So far, only 10 registers in testnet (none on mainnet) were found to contain broken references.
Solution
Port from non-inlining version of the solution:
387
This PR adds a feature to enable migration programs in onflow/flow-go to fix broken references in maps.
FixLoadedBrokenReferences() traverses loaded slabs and replaces broken map (if any) with empty map having the same StorageID and also removes all slabs in the old map.
Limitations:
only fix broken references in map (this is intentional)
only traverse loaded slabs in deltas and cache
IMPORTANT: This should not be used to silently fix unknown problems. It should only be used by migration programs to fix known problems which were determined to be appropriate to fix in this manner.
TODO:
[ ] Add more tests and increase code coverage
[ ] Targeted PR against main branch
[x] Linked to Github issue with discussion and accepted design OR link to spec that describes this work
Updates #292 https://github.com/onflow/atree/issues/386
Problem
Broken references were found in testnet data and they seem to have resulted from a bug that was fixed 2 years ago by https://github.com/onflow/cadence/pull/1565.
A broken reference is a
StorageID
referencing a non-existent register. So far, only 10 registers in testnet (none on mainnet) were found to contain broken references.Solution
Port from non-inlining version of the solution:
387
This PR adds a feature to enable migration programs in onflow/flow-go to fix broken references in maps.
FixLoadedBrokenReferences()
traverses loaded slabs and replaces broken map (if any) with empty map having the sameStorageID
and also removes all slabs in the old map.Limitations:
IMPORTANT: This should not be used to silently fix unknown problems. It should only be used by migration programs to fix known problems which were determined to be appropriate to fix in this manner.
TODO:
main
branchFiles changed
in the Github PR explorer