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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion test/e2e/major_upgrade_v3.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ func MajorUpgradeToV3(logger *log.Logger) error {
logger.Printf("Knuu initialized with scope %s", kn.Scope)

logger.Println("Creating testnet")
testNet, err := testnet.New(logger, kn, testnet.Options{})
testNet, err := testnet.New(logger, kn, testnet.Options{
ChainID: appconsts.TestChainID,
})
Comment on lines +37 to +39
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

testnet.NoError("failed to create testnet", err)

defer testNet.Cleanup(ctx)
Expand Down
Loading