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

test: add import data to e2e tests #2127

Merged
merged 18 commits into from
May 7, 2024
Merged

Conversation

kingpinXD
Copy link
Contributor

@kingpinXD kingpinXD commented May 7, 2024

Description

Adds a new test make start-e2e-import-mainnet-test , which does the following

  • download latest genesis data exported from mainnet
  • imports data into a genesis file
  • starts a network and runs e2e tests on it

Closes: #2067

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Include instructions and any relevant details so others can reproduce.

  • Tested CCTX in localnet
  • Tested in development environment
  • Go unit tests
  • Go integration tests
  • Tested via GitHub Actions

Checklist:

  • I have added unit tests that prove my fix feature works

lumtis and others added 4 commits April 29, 2024 19:52
* add skip header option

* use option for migration test

* move bitcoin addresses tests to advanced

* show cctx in logs

* update version

* fix verification flags error
@kingpinXD kingpinXD marked this pull request as ready for review May 7, 2024 05:44
Copy link
Member

@lumtis lumtis left a comment

Choose a reason for hiding this comment

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

Import Data might not be descriptive enough, what about export/import upgrade test?

If the test is good I think we can also work on the renaming on develop afterward

Unclear to me why do we keep the legacy genesis? Don't we export the genesis with the new binary?

contrib/localnet/scripts/start-zetaclientd.sh Show resolved Hide resolved
proto/crosschain/genesis.proto Outdated Show resolved Hide resolved
Copy link
Contributor

@skosito skosito left a comment

Choose a reason for hiding this comment

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

some minor comments, and +1 for adding more details on why legacy is needed

Makefile Outdated Show resolved Hide resolved
cmd/zetacored/parse_genesis.go Show resolved Hide resolved
cmd/zetacored/parse_genesis.go Outdated Show resolved Hide resolved
contrib/localnet/scripts/import-data.sh Show resolved Hide resolved
contrib/localnet/scripts/start-zetacored.sh Outdated Show resolved Hide resolved
@kingpinXD
Copy link
Contributor Author

kingpinXD commented May 7, 2024

Unclear to me why do we keep the legacy genesis? Don't we export the genesis with the new binary?

The import data test should ideally be run before an upgrade, so the export would be from the old binary, and the data would get imported to the current binary .
Existing state data from mainnet : https://snapshots.zetachain.com/latest-state-export

This pr does nothing around export though , we still use the standard export command to export genesis which is a separate process

@kingpinXD kingpinXD requested a review from a team as a code owner May 7, 2024 16:30
@github-actions github-actions bot added the ci Changes to CI pipeline or github actions label May 7, 2024
Copy link
Member

@lumtis lumtis left a comment

Choose a reason for hiding this comment

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

This is LGTM if we can create an issue to list the modification to make on develop -> removing legacy genesis from the module source code

@kingpinXD kingpinXD changed the base branch from v16.0.0-rc to release/v16 May 7, 2024 19:42
Copy link

github-actions bot commented May 7, 2024

!!!WARNING!!!
nosec detected in the following files: x/crosschain/keeper/grpc_query_cctx_rate_limit.go, x/crosschain/keeper/grpc_query_cctx_rate_limit_test.go

Be very careful about using #nosec in code. It can be a quick way to suppress security warnings and move forward with development, it should be employed with caution. Suppressing warnings with #nosec can hide potentially serious vulnerabilities. Only use #nosec when you're absolutely certain that the security issue is either a false positive or has been mitigated in another way.

Only suppress a single rule (or a specific set of rules) within a section of code, while continuing to scan for other problems. To do this, you can list the rule(s) to be suppressed within the #nosec annotation, e.g: /* #nosec G401 */ or //#nosec G201 G202 G203
Broad #nosec annotations should be avoided, as they can hide other vulnerabilities. The CI will block you from merging this PR until you remove #nosec annotations that do not target specific rules.

Pay extra attention to the way #nosec is being used in the files listed above.

@github-actions github-actions bot added the nosec label May 7, 2024
Copy link

codecov bot commented May 7, 2024

Codecov Report

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

Project coverage is 71.37%. Comparing base (181ba7f) to head (3690dba).

Additional details and impacted files

Impacted file tree graph

@@               Coverage Diff               @@
##           release/v16    #2127      +/-   ##
===============================================
- Coverage        71.48%   71.37%   -0.11%     
===============================================
  Files              252      252              
  Lines            14081    14102      +21     
===============================================
  Hits             10066    10066              
- Misses            3554     3575      +21     
  Partials           461      461              
Files Coverage Δ
x/fungible/keeper/deposits.go 95.00% <ø> (ø)
x/crosschain/types/genesis.go 63.15% <0.00%> (-14.27%) ⬇️
x/fungible/types/genesis.go 46.15% <0.00%> (-53.85%) ⬇️

@kingpinXD kingpinXD requested a review from gartnera May 7, 2024 19:50
@gzukel gzukel merged commit 76439ba into release/v16 May 7, 2024
29 of 30 checks passed
@gzukel gzukel deleted the v16.0.0-import-data-testing branch May 7, 2024 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking:cli breaking:proto ci Changes to CI pipeline or github actions nosec
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants