-
Notifications
You must be signed in to change notification settings - Fork 137
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
Migration problems #3366
Comments
Hey @turbolent yes, the two migrations were run on the same TN state taken May 8 (devnet49-execution-snapshot-for-migration-6-may-8 snapshot - note needs DL GCP account to access). |
I think key here is not migrated, because contract is not staged.
Those are strangely wrong migrated in the old version somehow, maybe some caching bug there. |
You mean |
validate that we can traverse the migrated TN state from June 5 migration. bucket: gs://flow_hosting_exec_state_storage/crescendo-migration-testnet-jun5-preview26/ |
@j1010001 That state is inlined, right? |
@turbolent yes, I re-run C1.0 migration with preview 26 build, using the existing payloads from the atree inlining done May 29. |
@turbolent I opened #3407 to track the last issue - I think this can be closed. |
See https://discord.com/channels/613813861610684416/1108479699732152503/1241110592153063619
We recently created two migration results:
migrationtestnet1-may8-inlined-preview20
: migrated with an older, unoptimized version of Cadence/flow-gomigrationtestnet1-may8-inlined-preview23
: migrated with the latest, optimized version of Cadence/flow-goThese results were both generated from the same TN snapshot (right, @j1010001?), but produced different state commitments.
As a result, I developed a flow-go util command to compare two states.
The diffing uncovered several reasons for the different state commitments, but also uncovered several problems:
Some capabilities using
LockedTokens.TokenAdmin
have different authorizations:This is because a new entitlement was added to the
LockedTokenManager
contract, see https://github.com/onflow/flow-core-contracts/pull/429/files#diff-a200545fac9017d8d015d11d56aa104f41e0a09088a2fb5f8eabb7006001528dR85Nothing wrong here, just explains the reason the results are different.
Diffing calls
interpreter.Value.String()
which indirectly might callinterpreter.Value.MeteredString
, which is not implemented for legacy values, likePathCapabilityValue
We just need to implement the function. Fixed by Fix string formatting for values #3370
StorageCapabilityControllerValue.RecursiveString
accidentally has the arguments swappedWe just need to fix the argument order here. Fixed by Fix string formatting for values #3370
Migrated capability has different borrow type, e.g. FT and NFT:
Caused by incorrect caching in entitlements migration. Fixed by Remove incorrect caching from migrations #3375
Some links are no longer migrated?
Likely caused by incorrect caching in entitlements migration (see above). Should be fixed by Remove incorrect caching from migrations #3375
Capability controller / ID creation might have different order, migrated capability values might get different IDsMaybe look into making this deterministic, if possible.As some links fail to be migrated (see above), the resulting IDs are offset. Should be fixed by Remove incorrect caching from migrations #3375
Iteration fails to load key:
This is a bug we need to fix. It is unlikely a result of the optimization of the migration code, but rather uncovered by walking over the whole migrated state.
We should maybe extend the tests in the Cadence migration to walk the migrated state.
We previously had a problem in the migration when using a mutating iterator on old values on the atree inlining branch.
The error here seems similar – but why would we still have an old unmigrated key?
The text was updated successfully, but these errors were encountered: