-
Notifications
You must be signed in to change notification settings - Fork 170
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 command to diff states #5970
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5970 +/- ##
==========================================
- Coverage 55.83% 55.80% -0.04%
==========================================
Files 1129 1131 +2
Lines 89297 89758 +461
==========================================
+ Hits 49858 50085 +227
- Misses 34686 34895 +209
- Partials 4753 4778 +25
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@fxamacker Any idea why I'd get errors like Getting this when running the command on
It's only reported for some of the accounts:
|
@turbolent The error message "data has invalid flag" is only present in |
@fxamacker Oh, right, good catch! I need to build the binary on top of the atree inlining branch 👍 |
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.
Nice! I focused on reviewing non-test code and left some comments.
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.
Nice! Thanks for updating PR! I left a few more comments for your consideration.
@@ -209,10 +209,22 @@ func (m *CadenceBaseMigration) MigrateAccount( | |||
m.nWorkers, | |||
) | |||
|
|||
owner := string(address[:]) |
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.
Maybe use AddressToRegisterOwner
to be consistent for global registers.
owner := string(address[:]) | |
owner := AddressToRegisterOwner(address) |
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.
I changed it in 9a2541a, but is it even required? We call this in MigrateAccount
, which is only called for accounts, and not for global registers?
Co-authored-by: Faye Amacker <33205765+fxamacker@users.noreply.github.com>
@onflow/cadence PTAL |
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.
Took a brief pass over the PR. There aren't really any algorithmic changes on the trie, so no concerns from my end. Though, don't have a lot of context on the other details.
Add a new command,
diff-states
, to the util, which allows diffing two states. The states may be either given in the form of a snapshot directory / state commitment, or a payloads file. The command generates a report of differences in the states on either a low "raw" level, or on a high Cadence-level.This essentially exposes the existing state loading and Cadence value diffing functionality of the migration.
While at it, optimize how the traces (paths in the object structure) are generated.