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

Fix storage map key conversion in atree migration #5605

Merged
merged 1 commit into from
Apr 1, 2024

Conversation

fxamacker
Copy link
Member

Currently storage map key is assumed to be StringAtreeValue type. However, storage domain cap_con uses Uint64AtreeValue as storage map key.

This PR supports both map key types during atree migration and Cadence value validation.

This problem was found by using latest testnet data for atree migration + Cadence v0.42. Prior tests using mainnet data did not encounter this issue.

Currently storage map key is assumed to be StringAtreeValue type.
However, storage domain cap_con uses Uint64AtreeValue as storage map key.

This commit supports both map key types during atree migration and
Cadence value validation.
@fxamacker fxamacker requested review from a team March 29, 2024 14:53
@fxamacker fxamacker self-assigned this Mar 29, 2024
@fxamacker
Copy link
Member Author

@janezpodhostnik @turbolent PTAL 🙏

@codecov-commenter
Copy link

codecov-commenter commented Mar 29, 2024

Codecov Report

Attention: Patch coverage is 55.00000% with 9 lines in your changes are missing coverage. Please review.

Project coverage is 55.63%. Comparing base (5922cda) to head (660216a).

Files Patch % Lines
...util/ledger/migrations/atree_register_migration.go 44.44% 5 Missing ⚠️
...util/ledger/migrations/cadence_value_validation.go 63.63% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5605      +/-   ##
==========================================
- Coverage   55.65%   55.63%   -0.03%     
==========================================
  Files        1037     1037              
  Lines      101377   101384       +7     
==========================================
- Hits        56424    56405      -19     
- Misses      40613    40636      +23     
- Partials     4340     4343       +3     
Flag Coverage Δ
unittests 55.63% <55.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@turbolent turbolent left a comment

Choose a reason for hiding this comment

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

@fxamacker fxamacker added this pull request to the merge queue Apr 1, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 1, 2024
@fxamacker fxamacker added this pull request to the merge queue Apr 1, 2024
Merged via the queue into master with commit 10c1048 Apr 1, 2024
55 checks passed
@fxamacker fxamacker deleted the fxamacker/fix-atree-migration-storagemapkey branch April 1, 2024 18:38
This pull request was closed.
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.

4 participants