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: configure MajorUpgradeToV3 to use test chain id #4090

Merged
merged 5 commits into from
Dec 16, 2024

Conversation

rootulp
Copy link
Collaborator

@rootulp rootulp commented Dec 6, 2024

Closes #4074

Testing

I verified this e2e test now uses the test chain ID by using Lens to access one of the validators that was running for the test:

val0-j5kmm:~$ celestia-appd status
{"NodeInfo":{"protocol_version":{"p2p":"8","block":"11","app":"2"},"id":"31848789dd20c3cc5578c436127b7a3c7d4d2f87","listen_addr":"tcp://10.41.26.23:26656","network":"test","version":"","channels":"40202122233038606100","moniker":"val0","other":{"tx_index":"on","rpc_address":"tcp://0.0.0.0:26657"}},"SyncInfo":{"latest_block_hash":"4E9D64776C02BE5E5ECB54134AC1B7E9CD86B466E8019A747C806DED40E0CE3C","latest_app_hash":"6F6739F8DB4F17581CA65BCA253A2F6F55FC66BC0DE85C0F0AC4A4B534596CB3","latest_block_height":"4","latest_block_time":"2024-12-06T18:04:55.390600175Z","earliest_block_hash":"06A5DC2061B918549D8F377241432D0D633C3631C979B9557BF604C8FC78D6C1","earliest_app_hash":"E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855","earliest_block_height":"1","earliest_block_time":"2024-12-06T18:03:57.114194Z","catching_up":false},"ValidatorInfo":{"Address":"BC6BF11290F5C747EC0CFAC983691FB9965F4273","PubKey":{"type":"tendermint/PubKeyEd25519","value":"uKkXe+jSDL79IZ0WHEp7GqbrN45XK8TlGHstz1+2pUI="},"VotingPower":"5"}}

Specifically: "network":"test". Note: the test still doesn't pass even after I waited for ~45 blocks. I think the test needs to be refactored to be more reliable.

@rootulp rootulp marked this pull request as ready for review December 13, 2024 15:16
@rootulp rootulp requested a review from a team as a code owner December 13, 2024 15:16
@rootulp rootulp requested review from cmwaters, rach-id and evan-forbes and removed request for a team and rach-id December 13, 2024 15:16
Copy link
Contributor

coderabbitai bot commented Dec 13, 2024

📝 Walkthrough

Walkthrough

The pull request modifies the MajorUpgradeToV3 function in the test/e2e/major_upgrade_v3.go file by adding a ChainID field to the testnet.Options struct. This change specifies the ChainID as appconsts.TestChainID, which was previously unset. The overall structure of the function remains intact, including testnet setup, genesis node creation, and upgrade processes. The upgrade schedule and error handling are also unchanged, with added checks for block durations and timeout settings.

Changes

File Change Summary
test/e2e/major_upgrade_v3.go Added ChainID field to testnet.Options struct; modified initialization to use appconsts.TestChainID.

Assessment against linked issues

Objective Addressed Explanation
Ensure e2e test uses "test" chain ID (#4074)

Possibly related PRs

Suggested labels

WS: V3 3️⃣, required

Suggested reviewers

  • cmwaters
  • evan-forbes
  • ninabarbakadze

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:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. 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 testing code 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Experiment)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bd4f91a and ea210d9.

📒 Files selected for processing (1)
  • test/e2e/major_upgrade_v3.go (1 hunks)

Comment on lines +37 to +39
testNet, err := testnet.New(logger, kn, testnet.Options{
ChainID: appconsts.TestChainID,
})
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Test failure is likely due to timeout commit mismatch during version transition

The test failure after 45 blocks appears to be caused by a significant change in TimeoutCommit values between v2 (11 seconds) and v3 (4.2 seconds). The test verifies block durations against version-specific timeout commits, and the transition at height 40 could trigger timing validation failures.

Key findings:

  • v2 TimeoutCommit: 11 seconds
  • v3 TimeoutCommit: 4.2 seconds
  • Test checks if block duration is within version-specific timeout commit bounds
  • Upgrade happens at height 40, test fails around 45
🔗 Analysis chain

LGTM! The change correctly configures the test chain ID.

The addition of ChainID: appconsts.TestChainID aligns with the PR objective to configure MajorUpgradeToV3 to use the test chain ID.

Since the PR description mentions test failures after 45 blocks, let's analyze the block production:


Let me analyze the timing-related findings to verify the test failure root cause.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Analyze block production patterns and timing in the test
# Look for any patterns in block production or timing issues that might cause test failures

# Search for block time related constants
rg -A 2 "TimeoutCommit|BlockTime" 

# Search for upgrade height related configurations
rg -A 2 "upgradeHeight|Version"

# Look for any timing related test configurations
ast-grep --pattern 'time.Duration|time.Second|time.Minute'

Length of output: 80610


Script:

#!/bin/bash
# Search for timeout commit values in v2 and v3 versions
rg -A 2 "TimeoutCommit.*=.*" pkg/appconsts/v2/ pkg/appconsts/v3/

# Look for block timing checks in the test file
rg -A 5 "blockDur|blockTime" test/e2e/major_upgrade_v3.go

# Search for upgrade height configurations
rg -A 2 "UpgradeHeightDelay.*=.*" pkg/appconsts/

Length of output: 1851

@rootulp rootulp enabled auto-merge (squash) December 13, 2024 15:28
@rootulp rootulp merged commit 60aadba into celestiaorg:main Dec 16, 2024
27 of 28 checks passed
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.

Ensure e2e test uses "test" chain ID
3 participants