-
Notifications
You must be signed in to change notification settings - Fork 180
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
Optimize migration by adding ability to read or extract payloads from state #5386
Merged
fxamacker
merged 14 commits into
master
from
fxamacker/extract-payloads-from-state-extraction
Feb 22, 2024
Merged
Changes from 4 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
85527b8
Add ability to read or extract payloads from state
fxamacker 9b1fc05
Add t.Parallel() to test
fxamacker 5d5eb09
Remove t.Parallel() to clean output dir correctly
fxamacker 34d325c
Merge branch 'master' into fxamacker/extract-payloads-from-state-extr…
fxamacker 392b842
Refactor & add flags for payloads in state extraction
fxamacker 7477666
Optimize payload filtering in state extraction
fxamacker 67ec2e2
Add tests for payload file related functionality
fxamacker 48edc60
Add utility to extract payloads by addresses
fxamacker 75e1099
Refactor to use named magic number for CBOR data
fxamacker 27e9dc0
Merge pull request #5389 from onflow/fxamacker/extract-payloads-by-ad…
fxamacker b2934fb
Merge branch 'master' into fxamacker/extract-payloads-from-state-extr…
fxamacker ee2ca4c
Add suggested comments from feedback
fxamacker 23beb88
Merge branch 'master' into fxamacker/extract-payloads-from-state-extr…
fxamacker 3c2d313
Use latest NewCompactor API
fxamacker File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
We break the state extraction into 2 steps, the first step to output all payloads into a file after the first migration, and the second step to read all the payloads from the output file and continue running the remaining migrations and extract state.
I wonder how can we make the process verifiable in case someone is trying to reproduce the same process, and try to validate each intermediate steps? Basically we need a way to guarantee and prove that the payloads did not change when reading it back and continue with the remaining migrations and state extraction.
One idea I had is to compute some hash (or checksum) of all the payloads before writing them to disk, and validate it after reading and decode the payloads.
Thoughts?
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.
Making this verifiable "in case someone is trying to reproduce the same process" is not the primary use case now (this PR is to help speed up development/testing) but it makes sense to add a hash for other use cases. 👍
Due to parallelism, the payloads within the output file may not be in the same sequence each time this program is used. In practice payload file would still produce the same checkpoint when used as input (as long as sequence of payloads inside is the only thing that changed and the contents of all payloads are unchanged).
I'll merge this PR and open a separate PR to address the "reproduce the same process" use case by: