-
Notifications
You must be signed in to change notification settings - Fork 140
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
Add reproducer as test for Cadence 1.0 migration issue #3288 #3314
Add reproducer as test for Cadence 1.0 migration issue #3288 #3314
Conversation
The problem was initially detected in testnet migration of atree inlined data with Cadence 1.0 migration. The bug happened with 5 nested levels of data while this reproducer is simplified to use 3 nested levels. More info at: #3288
Cadence Benchstat comparisonThis branch with compared with the base branch onflow:feature/atree-register-inlining-v1.0 commit fac39f8 Collapsed results for better readability
|
This commit fixes Cadence 1.0 migration when using atree inlined data. See issue: #3288 Previously, MigrateNestedValue() migrates dictionary by using readonly iterator and migrating values in place. This commit migrates keys first using readonly iterator and then migrates values using mutable iterator.
Fix Cadence 1.0 migration of dictionary values when using atree inlined data
…er/add-reproducer-for-issue-3288
…d-reproducer-for-issue-3288
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.
Great work! 👏
6d49c8c
into
feature/atree-register-inlining-v1.0
Closes #3288
This PR adds 2 tests with a reproducer for Cadence 1.0 migration (using atree inlined data) issue #3288.
TestMigrateNestedValue()
(reproducer that currently fails until issue Testnet state migration preview.22 health check after migration error #3288 is fixed)TestMigrateNestedComposite()
(test that currently passes using slightly different data structure)TestMigrateNestedValue()
is a reproducer that uses data structure similar to testnet account:TestMigrateNestedComposite()
passes and it uses a slightly different data structure:The bug happened with testnet data on 5 nested levels. This reproducer is simplified to use 3 nested levels.
I think the problem is with dictionary using ReadOnly iterator to migrate element in-place. If you change this line https://github.com/onflow/cadence/blob/feature/atree-register-inlining-v1.0/migrations/migration.go#L325 from dictionary.IterateReadOnly to dictionary.Iterate, then TestMigrateNestedValue passes. However, other migration tests will then fail.
Discord 🧵 https://discord.com/channels/613813861610684416/1235939015958593578/1236039340816072754
master
branchFiles changed
in the Github PR explorer