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

chore: upgrade cosmos-sdk to v0.47.14 #2980

Merged
merged 3 commits into from
Oct 10, 2024
Merged

Conversation

gartnera
Copy link
Member

@gartnera gartnera commented Oct 8, 2024

Description

#2934 was reverted. There doesn't seem to be any good way to get this to build on MacOS without forcing use of GCC.

Let's try only upgrading cosmos-sdk for now. That should at least unblock zeta-chain/ethermint#86 as the x/exp dependency was removed with the gogoproto upgrade.

Closes #2959

Upgrade tests failures are unrelated: #2982

TODO:

How Has This Been Tested?

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

Summary by CodeRabbit

  • New Features

    • Updated sorting mechanism for chain IDs in the Chain Registry for improved clarity and accuracy.
  • Chores

    • Comprehensive update of various dependencies to their latest versions, enhancing overall stability and performance.

@gartnera gartnera added no-changelog Skip changelog CI check UPGRADE_TESTS Run make start-upgrade-tests PERFORMANCE_TESTS Run make start-e2e-performance-test labels Oct 8, 2024
Copy link

codecov bot commented Oct 8, 2024

Codecov Report

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

Project coverage is 66.08%. Comparing base (cb74b25) to head (57cc5d1).
Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
zetaclient/context/chain.go 0.00% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2980      +/-   ##
===========================================
- Coverage    66.09%   66.08%   -0.01%     
===========================================
  Files          397      397              
  Lines        22332    22334       +2     
===========================================
  Hits         14760    14760              
- Misses        6804     6806       +2     
  Partials       768      768              
Files with missing lines Coverage Δ
zetaclient/context/chain.go 73.25% <0.00%> (-1.75%) ⬇️

Copy link
Contributor

coderabbitai bot commented Oct 8, 2024

📝 Walkthrough

Walkthrough

The pull request introduces updates to the go.mod file, focusing on upgrading various dependencies to their latest versions. Notably, it updates the github.com/cometbft/cometbft and github.com/cosmos/cosmos-sdk libraries. Additionally, new indirect dependencies are added, and existing replace directives are modified. Furthermore, the zetaclient/context/chain.go file has been altered to improve the sorting mechanism within the All method of the ChainRegistry struct, changing from a boolean-based comparison to an integer-based comparison using the cmp package.

Changes

File Change Summary
go.mod Updated multiple dependency versions, added new indirect dependencies, and modified replace directives.
zetaclient/context/chain.go Introduced a new import for the cmp package and updated the sorting mechanism in the All method.

Assessment against linked issues

Objective Addressed Explanation
Upgrade cometbft and cosmos-sdk minor version (#2959)

Possibly related PRs

Suggested labels

ci, UPGRADE_IMPORT_MAINNET_TESTS

Suggested reviewers

  • fbac
  • skosito
  • kingpinXD
  • ws4charlie
  • brewmaster012
  • swift1337
  • lumtis

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:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • 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 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: 0

🧹 Outside diff range and nitpick comments (1)
go.mod (1)

Line range hint 1-371: Consider streamlining dependency management process.

The current dependency management strategy involves a complex mix of direct and indirect dependencies, replace directives, and maintained forks. To improve maintainability and reduce potential issues:

  1. Consider using a dependency management tool like go mod tidy regularly to clean up unused dependencies and ensure consistency.
  2. Evaluate the necessity of each replace directive and maintained fork. Aim to minimize these where possible.
  3. Document the rationale behind each non-standard dependency management decision (e.g., why a specific fork is maintained).
  4. Set up automated dependency update checks (e.g., using Dependabot or similar tools) to stay informed about new versions and potential security updates.

Implementing a more streamlined dependency management process will help reduce complexity, improve maintainability, and make it easier to keep dependencies up-to-date and secure.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 45a9b05 and f0b3b08.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (2)
  • go.mod (11 hunks)
  • zetaclient/context/chain.go (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
zetaclient/context/chain.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

🪛 GitHub Check: codecov/patch
zetaclient/context/chain.go

[warning] 69-71: zetaclient/context/chain.go#L69-L71
Added lines #L69 - L71 were not covered by tests

🔇 Additional comments (7)
zetaclient/context/chain.go (2)

4-4: Import of cmp package is appropriate.

The addition of the cmp package import is suitable for the subsequent changes in the All method. This standard library package provides efficient and type-safe comparison functions.


69-71: Improved sorting mechanism in All method.

The update to the sorting mechanism in the All method is a commendable improvement. The use of cmp.Compare provides a more standardized and potentially more efficient three-way comparison, which is preferable to the previous boolean-based approach.

However, it is noted that these changes are not covered by unit tests. To ensure the reliability and correctness of this critical functionality, it is advisable to add appropriate test cases.

To verify the test coverage and potentially add tests, you may use the following script:

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 69-71: zetaclient/context/chain.go#L69-L71
Added lines #L69 - L71 were not covered by tests

go.mod (5)

Line range hint 1-5: Go version and toolchain specifications are appropriate.

The use of Go 1.22.2 and toolchain go1.22.5 demonstrates a commitment to leveraging the latest stable features and security updates. This is commendable for maintaining a robust and secure codebase.


Line range hint 1-371: Summary of changes and recommendations for go.mod

The go.mod file has undergone significant updates, including:

  1. Specification of Go version 1.22.2 and toolchain go1.22.5.
  2. Updates to core dependencies like cometbft, cosmos-sdk, and grpc.
  3. Addition of new indirect dependencies, including OpenTelemetry instrumentation.
  4. Modifications to replace directives and specification of ZetaChain maintained forks.

Recommendations:

  1. Thoroughly test the codebase with the updated dependencies, paying special attention to breaking changes.
  2. Monitor the impact of new indirect dependencies on performance and behavior.
  3. Regularly sync ZetaChain maintained forks with their upstream repositories.
  4. Streamline the dependency management process to reduce complexity and improve maintainability.
  5. Set up automated dependency update checks to stay informed about new versions and security updates.

These changes demonstrate a commitment to keeping the project up-to-date, but careful management is required to ensure long-term stability and security.


80-84: New indirect dependencies added and existing ones updated.

Several indirect dependencies have been updated, which is generally positive for bug fixes and security improvements. However, new dependencies have been introduced, notably:

  • github.com/sagikazarmark/locafero v0.4.0
  • github.com/sagikazarmark/slog-shim v0.1.0
  • github.com/sourcegraph/conc v0.3.0
  • OpenTelemetry instrumentation packages

To ensure these new dependencies don't introduce unexpected behavior or performance issues, run the following script:

#!/bin/bash
# Description: Check for any potential issues with new dependencies

# List all new dependencies
grep -nE "require \($" go.mod -A 100 | grep -E "github.com/sagikazarmark/locafero|github.com/sagikazarmark/slog-shim|github.com/sourcegraph/conc|go.opentelemetry.io/"

# Check for any known vulnerabilities
go list -json -m all | go run golang.org/x/vuln/cmd/govulncheck@latest

Monitor the impact of these new dependencies on build times, binary size, and runtime performance. Consider setting up benchmarks to track any changes in these metrics.

Also applies to: 88-88, 119-119, 143-143, 145-145, 153-153, 162-162, 205-205, 261-261, 263-263, 281-281, 306-308, 316-317, 323-323, 325-326, 344-345, 347-349


Line range hint 351-371: Ensure ZetaChain maintained forks are regularly synced with upstream.

The use of replace directives for ZetaChain maintained forks is noted. While this allows for customization, it's crucial to:

  1. Regularly sync these forks with their upstream repositories to incorporate bug fixes and security patches.
  2. Document the reasons for maintaining these forks and any custom changes made.
  3. Have a plan for eventually upstreaming these changes or migrating back to the original repositories.

To verify the current status of these forks, run the following script:

#!/bin/bash
# Description: Check the status of ZetaChain maintained forks

# Function to check fork status
check_fork() {
    local fork=$1
    local upstream=$2
    echo "Checking $fork against $upstream"
    git ls-remote $fork | grep HEAD
    git ls-remote $upstream | grep HEAD
}

# Check each fork
check_fork https://github.com/zeta-chain/tss-lib https://github.com/bnb-chain/tss-lib
check_fork https://github.com/zeta-chain/go-ethereum https://github.com/ethereum/go-ethereum
check_fork https://github.com/zeta-chain/go-libp2p https://github.com/libp2p/go-libp2p
check_fork https://github.com/zeta-chain/go-tss https://gitlab.com/thorchain/tss/go-tss

This script will help identify any significant divergence between the forks and their upstream repositories.


19-23: Significant updates to core dependencies require careful review and testing.

Notable updates include:

  • github.com/cometbft/cometbft v0.37.5
  • github.com/cosmos/cosmos-sdk v0.47.14
  • github.com/cosmos/gogoproto v1.7.0
  • google.golang.org/grpc v1.62.1

These updates may introduce breaking changes or new features. Ensure that:

  1. The codebase has been adapted to accommodate any breaking changes.
  2. New features have been leveraged where appropriate.
  3. Comprehensive testing has been performed, including integration tests and end-to-end scenarios.

To verify the impact of these changes, run the following script:

This script will help identify any breaking changes that need to be addressed in the codebase.

Also applies to: 28-28, 32-32, 52-52, 55-55, 58-58, 66-66, 69-71

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.

Compile locally for me

@lumtis lumtis enabled auto-merge October 10, 2024 12:52
@gartnera gartnera disabled auto-merge October 10, 2024 15:13
@gartnera gartnera force-pushed the upgrade-cosmossdk-0-47-14 branch from 0e45c22 to 57cc5d1 Compare October 10, 2024 18:34
@gartnera gartnera enabled auto-merge October 10, 2024 18:34
@gartnera gartnera added this pull request to the merge queue Oct 10, 2024
Merged via the queue into develop with commit a36bc0a Oct 10, 2024
34 of 35 checks passed
@gartnera gartnera deleted the upgrade-cosmossdk-0-47-14 branch October 10, 2024 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog Skip changelog CI check PERFORMANCE_TESTS Run make start-e2e-performance-test UPGRADE_TESTS Run make start-upgrade-tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade cometbft and cosmos-sdk minor version
4 participants