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

[Cadence 1.0] Improve migrations #5533

Merged
merged 9 commits into from
Mar 12, 2024

Conversation

turbolent
Copy link
Member

@turbolent turbolent commented Mar 11, 2024

Depends on #5539
Work towards onflow/cadence#3162

  • Remove "known problematic accounts"
  • Improve logging
  • Test that migrated values may refer to types of core contracts
  • Optimize contract lookup: Instead of gathering all contracts when migrating each account, gather all contracts once, after updating/deploying contracts and before running the value migrations
  • Add migration to filter accounts by max size


// NewContractsExtractionMigration returns a migration that extracts the code for contracts from the payloads.
// The given contracts map must be allocated, and gets populated with the code for the contracts found in the payloads.
func NewContractsExtractionMigration(
Copy link
Member

Choose a reason for hiding this comment

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

Nice idea! 👌

Base automatically changed from bastian/improve-migration-2 to feature/stable-cadence March 11, 2024 23:58
@codecov-commenter
Copy link

codecov-commenter commented Mar 12, 2024

Codecov Report

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

Project coverage is 55.92%. Comparing base (8aebe84) to head (cf34d51).

Files Patch % Lines
...ledger/migrations/account_size_filter_migration.go 0.00% 67 Missing ⚠️
cmd/util/ledger/migrations/cadence.go 65.11% 14 Missing and 1 partial ⚠️
cmd/util/ledger/migrations/contracts.go 77.77% 4 Missing and 2 partials ⚠️
ledger/complete/ledger.go 0.00% 3 Missing ⚠️
...execution-state-extract/execution_state_extract.go 50.00% 2 Missing ⚠️
...util/ledger/migrations/cadence_values_migration.go 33.33% 2 Missing ⚠️
Additional details and impacted files
@@                    Coverage Diff                     @@
##           feature/stable-cadence    #5533      +/-   ##
==========================================================
- Coverage                   55.97%   55.92%   -0.06%     
==========================================================
  Files                        1045     1047       +2     
  Lines                      102968   103037      +69     
==========================================================
- Hits                        57639    57624      -15     
- Misses                      40936    41024      +88     
+ Partials                     4393     4389       -4     
Flag Coverage Δ
unittests 55.92% <38.31%> (-0.06%) ⬇️

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.

MetadataViews.ResolverCollection needs to get converted to ViewResolver.ResolverCollection
@turbolent turbolent merged commit a0b44e9 into feature/stable-cadence Mar 12, 2024
51 checks passed
@turbolent turbolent deleted the bastian/improve-migrations-3 branch March 12, 2024 01:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants