-
Notifications
You must be signed in to change notification settings - Fork 318
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
Conversation
📝 WalkthroughWalkthroughThe pull request modifies the Changes
Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
testNet, err := testnet.New(logger, kn, testnet.Options{ | ||
ChainID: appconsts.TestChainID, | ||
}) |
There was a problem hiding this comment.
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
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: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.