Skip to content
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 state migration for new Cadence storage format v4 #638

Merged
merged 3 commits into from
Apr 22, 2021

Conversation

turbolent
Copy link
Member

@turbolent turbolent commented Apr 17, 2021

Closes dapperlabs/flow-go#5422

The next Cadence release will introduce a new storage format, which means the whole execution state needs to be migrated from an old format (there are multiple older versions) to the new format.

Implement a state migration function which decodes all Cadence values using the old decoder and encodes them using the new encoder.

As a sanity check, the newly encoded data is re-decoded, and the resulting value is compared to the value which was initially decoded from the original data using the old decoder.

@turbolent turbolent self-assigned this Apr 19, 2021
@turbolent turbolent marked this pull request as ready for review April 19, 2021 23:06
error
})

workerCount := runtime.NumCPU()
Copy link
Member

@ramtinms ramtinms Apr 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this work on GCP virtual machine env?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess so, do you have any concerns why it would not?

Copy link
Member

@ramtinms ramtinms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, though I don't have the full context to verify that rencodeValueV4 is inclusive.

@turbolent turbolent force-pushed the bastian/cadence-storage-format-v4-state-migration branch from dca2a5e to 4b76e41 Compare April 21, 2021 22:22
@turbolent
Copy link
Member Author

@ramtinms What do you mean with "rencodeValueV4 is inclusive"?

@turbolent
Copy link
Member Author

No idea why the unit test is failing here. @ramtinms @m4ksio any ideas?

@m4ksio
Copy link
Contributor

m4ksio commented Apr 22, 2021

No idea why the unit test is failing here. @ramtinms @m4ksio any ideas?

Its a flaky test which should be fixed by #4230

@turbolent
Copy link
Member Author

Ah, OK, thank you! I'll re-run CI

@turbolent turbolent merged commit 0d90114 into master Apr 22, 2021
@turbolent turbolent deleted the bastian/cadence-storage-format-v4-state-migration branch April 22, 2021 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants