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: correctly set app version in e2e genesis #3211

Merged
merged 11 commits into from
Mar 27, 2024
Merged

Conversation

cmwaters
Copy link
Contributor

@cmwaters cmwaters commented Mar 25, 2024

After modifying the default genesis params to use the latest, TestMajorUpgradeToV2 began to fail because it required that the network first start at v1 and then upgrade to v2. This PR allows the app version at genesis to be set.

This also does some refactoring by removing the duplicate genesis creation function i.e. MakeGenesis and instead imports the genesis test util package.

@rootulp
Copy link
Collaborator

rootulp commented Mar 25, 2024

CI tests is failing in new and interesting ways

Copy link
Collaborator

@rootulp rootulp left a comment

Choose a reason for hiding this comment

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

Code LGTM but CI test is failing

evan-forbes
evan-forbes previously approved these changes Mar 26, 2024
Base automatically changed from cal/knuu-metrics to main March 26, 2024 11:48
@cmwaters cmwaters dismissed evan-forbes’s stale review March 26, 2024 11:48

The base branch was changed.

@celestia-bot celestia-bot requested a review from a team March 27, 2024 09:20
Copy link
Contributor

coderabbitai bot commented Mar 27, 2024

Walkthrough

Walkthrough

The recent updates aim to enhance key management and genesis configuration in an end-to-end testing framework. Changes include replacing account keys with public keys, introducing a keyring for mnemonic generation, revising the genesis document creation process, and refining account and validator setup. These modifications streamline setup and configuration processes, improve security through better key management, and simplify the codebase by removing unused imports and updating import paths.

Changes

Files Summary
test/e2e/node.go, test/e2e/setup.go, test/e2e/simple_test.go, test/e2e/testnet.go, test/e2e/upgrade_test.go Introduced keyring for key management, updated genesis document creation, streamlined imports, and updated import paths.
test/e2e/testnet.go Enhanced Testnet struct for improved genesis configuration and keyring operations, added methods for consensus parameters and genesis validators.
test/util/genesis/accounts.go Added PubKey field, introduced NewAccountsFromPubKeys function, and updated ValidateBasic method for account handling.
test/util/genesis/document.go Updated Document function to work with Account struct, adjusted accountsToSDKTypes function for Account slice.
test/util/genesis/files.go Improved error handling in InitFiles function by wrapping errors with additional context using fmt.Errorf.
test/testground/network/leader.go Updated account handling in GenesisEvent method.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

Note: Auto-reply has been disabled for this repository by the repository owner. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

@@ -69,7 +69,7 @@ func TestE2ESimple(t *testing.T) {

totalTxs := 0
for _, block := range blockchain {
require.Equal(t, v1.Version, block.Version.App)
require.Equal(t, appconsts.LatestVersion, block.Version.App)
Copy link
Collaborator

Choose a reason for hiding this comment

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

[no change needed] we can probably close #3201 if this PR merges

@cmwaters cmwaters merged commit 9440dea into main Mar 27, 2024
33 checks passed
@cmwaters cmwaters deleted the cal/e2e-app-version branch March 27, 2024 15:04
ninabarbakadze pushed a commit to ninabarbakadze/celestia-app that referenced this pull request Apr 2, 2024
After modifying the default genesis params to use the latest,
`TestMajorUpgradeToV2` began to fail because it required that the
network first start at v1 and then upgrade to v2. This PR allows the app
version at genesis to be set.

This also does some refactoring by removing the duplicate genesis
creation function i.e. `MakeGenesis` and instead imports the genesis
test util package.
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