-
Notifications
You must be signed in to change notification settings - Fork 6
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 #135
Conversation
📝 WalkthroughWalkthroughThe changes in this pull request involve significant updates to the Changes
Sequence Diagram(s)sequenceDiagram
participant Developer
participant GoModule
participant DependencyManager
Developer->>GoModule: Update dependencies
GoModule->>DependencyManager: Request version updates
DependencyManager->>GoModule: Provide latest versions
GoModule->>GoModule: Update go.mod and gomod2nix.toml
GoModule->>Developer: Notify completion of updates
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
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (1)
go.sum
is excluded by!**/*.sum
📒 Files selected for processing (2)
- go.mod (9 hunks)
- gomod2nix.toml (15 hunks)
🧰 Additional context used
🔇 Additional comments (9)
gomod2nix.toml (4)
Line range hint
1-638
: Ensure comprehensive testing for multiple dependency updates.This update includes changes to numerous dependencies simultaneously. While keeping dependencies up-to-date is crucial for security and performance, updating multiple dependencies at once can potentially lead to compatibility issues.
Please ensure that:
- Comprehensive integration tests have been run to verify the compatibility between all updated modules.
- The project's core functionality remains intact after these updates.
- Any new features or changes introduced by these updates are properly utilized and documented.
For future updates, consider adopting a more gradual approach:
- Update dependencies in smaller batches or individually.
- Thoroughly test each update before moving on to the next.
- Maintain a changelog documenting the reasons for each update and any required code changes.
To verify the overall health of the project after these updates, please run the following script:
#!/bin/bash # Description: Perform a comprehensive check of the project's health after dependency updates. # Test: Ensure all dependencies are properly vendored or downloaded go mod tidy go mod verify # Test: Compile the entire project go build ./... # Test: Run all tests go test ./... # Test: Run any integration or end-to-end tests # Uncomment and adjust the following line according to your project's setup # go test ./... -tags=integration # Test: Check for any new linting issues # Assuming you're using golangci-lint; adjust if using a different linter golangci-lint run
Line range hint
1-638
: Implement a robust dependency management strategy.The
gomod2nix.toml
file demonstrates a commendable practice of specifying exact versions and hashes for dependencies. To further enhance your dependency management, consider implementing the following strategies:
Regular Dependency Audits:
- Schedule periodic reviews of all dependencies.
- Check for newer versions, especially those containing security patches.
- Evaluate the need for each dependency and remove any that are no longer necessary.
Automated Dependency Updates:
- Implement a tool like Dependabot or Renovate to automatically create pull requests for dependency updates.
- Configure the tool to create separate pull requests for each dependency to simplify review and reduce the risk of conflicts.
Security Scanning:
- Integrate a security scanning tool (e.g., Snyk, OWASP Dependency-Check) into your CI/CD pipeline.
- Regularly scan dependencies for known vulnerabilities.
Dependency Pinning:
- Continue the practice of pinning dependencies to specific versions.
- Consider using a checksum verification tool to ensure the integrity of downloaded dependencies.
Documentation:
- Maintain a changelog or document explaining the reason for each dependency and any specific version requirements.
- Document the process for updating dependencies, including any necessary compatibility checks or code changes.
By implementing these strategies, you can maintain a more secure, up-to-date, and manageable dependency tree for your project.
To assist in implementing these strategies, consider running the following script periodically:
#!/bin/bash # Description: Perform a basic dependency health check. echo "Checking for outdated dependencies:" go list -u -m all | grep '\[' echo "\nChecking for known vulnerabilities (requires govulncheck):" govulncheck ./... echo "\nGenerating dependency graph (requires golang-deps-graph):" golang-deps-graph -horizontal > dependency_graph.svg echo "\nDependency health check complete. Please review the results and update dependencies as necessary."
471-472
: Justify the inclusion of new modules.The following new modules have been added to the project:
github.com/sagikazarmark/locafero
v0.4.0github.com/sagikazarmark/slog-shim
v0.1.0go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc
v0.46.1go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp
v0.46.1Please provide justification for the inclusion of these new modules:
- What functionality do they add to the project?
- Are they replacing any existing modules or introducing new features?
- Have they been thoroughly vetted for security and compatibility with the existing codebase?
To verify the usage of these new modules, please run the following script:
#!/bin/bash # Description: Check for the usage of newly added modules in the codebase. # Test: Search for import statements of the new modules echo "Searching for usage of new modules:" grep -R --include="*.go" "github.com/sagikazarmark/locafero" . grep -R --include="*.go" "github.com/sagikazarmark/slog-shim" . grep -R --include="*.go" "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" . grep -R --include="*.go" "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" .Also applies to: 474-475, 558-560, 561-563
583-584
: Explain the rationale for version downgrade.The
golang.org/x/exp
module has been downgraded fromv0.0.0-20230711153332-06a737ee72cb
tov0.0.0-20230905200255-921286631fa9
.Please provide an explanation for this downgrade:
- What issues, if any, were encountered with the previous version?
- How does this downgrade affect the project's functionality?
- Have you thoroughly tested the codebase with this older version to ensure no regressions?
To verify the impact of this downgrade, please run the following script:
go.mod (5)
182-182
: Validate File System Operations with Updatedafero
LibraryThe
github.com/spf13/afero
library has been updated tov1.11.0
(line 182). Verify that all file system abstractions and operations usingafero
are functioning correctly with the new version.To check the usage of
afero
in the codebase, run:#!/bin/bash # Description: Identify and review `afero` usage. # Search for `afero` function calls. rg --type go 'afero\.\w+' -A 5
11-22
: Ensure Compatibility with Updated DependenciesThe updates to multiple dependencies (lines 11-22, 32-44) may introduce breaking changes or deprecations. It is imperative to verify that the codebase remains compatible with these new versions and to update any affected code accordingly.
Please run the following script to identify potential issues arising from the updated dependencies:
Also applies to: 32-44
✅ Verification successful
Action Required: Correct and Re-execute the Verification Script
The initial script encountered a syntax error, preventing it from running successfully. Please use the corrected script below to verify compatibility with the updated dependencies:
[/run_scripts]
Verification Successful: No Deprecated or Obsolete APIs Detected
The updated dependencies do not introduce any deprecated or obsolete APIs in the codebase.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for deprecated functions or breaking changes due to updated dependencies. # List of updated dependencies dependencies=( "github.com/btcsuite/btcd" "github.com/cosmos/cosmos-sdk" "github.com/cosmos/gogoproto" "github.com/golang/protobuf" "github.com/spf13/cast" "github.com/spf13/cobra" "github.com/spf13/viper" "google.golang.org/grpc" ) # Search for deprecated or changed APIs in the codebase for dep in "${dependencies[@]}"; do echo "Checking for deprecated or changed APIs in $dep..." rg --type go --no-filename --no-heading --color never "$dep" -A 5 | grep -E 'Deprecated|deprecated|obsolete' doneLength of output: 126
Script:
#!/bin/bash # Description: Check for deprecated functions or breaking changes due to updated dependencies. # List of updated dependencies dependencies=( "github.com/btcsuite/btcd" "github.com/cosmos/cosmos-sdk" "github.com/cosmos/gogoproto" "github.com/golang/protobuf" "github.com/spf13/cast" "github.com/spf13/cobra" "github.com/spf13/viper" "google.golang.org/grpc" ) # Search for deprecated or changed APIs in the codebase for dep in "${dependencies[@]}"; do echo "Checking for deprecated or changed APIs in $dep..." rg --type go --no-filename --no-heading --color never "$dep" -A 5 | grep -E 'Deprecated|deprecated|obsolete' doneLength of output: 2744
185-185
: Review Changes ingotenv
Version UpdateThe
github.com/subosito/gotenv
package has been updated tov1.6.0
(line 185). Ensure that any changes in the package's API or behavior are compatible with existing environment variable management in the codebase.To verify the usage of
gotenv
, execute:✅ Verification successful
Action Required: Correct and Re-execute the Verification Script
The previous script encountered a syntax error, preventing successful verification of
gotenv
usage. Please execute the following corrected script to ensure accurate analysis:
Action Required: Conduct Comprehensive Verification of
gotenv
Imports and DependenciesTo ensure all usages of
github.com/subosito/gotenv
are accounted for, please execute the following scripts:
Verification Successful:
gotenv
is an Indirect DependencyNo direct usages of
github.com/subosito/gotenv
were found in the codebase. The package is listed as an indirect dependency ingo.mod
, indicating that the version update tov1.6.0
should not adversely affect existing environment variable management.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for `gotenv` usage and possible impact due to version update. # Find all usages of `gotenv` functions. rg --type go 'gotenv\.\w+' -A 2Length of output: 126
Script:
#!/bin/bash # Description: Check for `gotenv` usage and possible impact due to version update. # Find all usages of `gotenv` functions. rg --type go 'gotenv\.\w+' -A 2Length of output: 33
Script:
#!/bin/bash # Description: Locate all import statements for `gotenv` in the codebase. # Using ast-grep to find all import declarations of `github.com/subosito/gotenv`. ast-grep --lang go --pattern 'import ($_ $_ $_ "github.com/subosito/gotenv")' # Additionally, search for any aliases used during import. rg --type go '^import\s+\(\s*(.*\ngithub\.com/subosito/gotenv.*\n)*\s*\)'Length of output: 347
Script:
#!/bin/bash # Description: Inspect `go.mod` for indirect dependencies related to `gotenv`. # Check for `gotenv` in the dependencies, including indirect ones. grep 'github.com/subosito/gotenv' go.modLength of output: 87
197-201
: Assess the Addition of OpenTelemetry DependenciesNew OpenTelemetry dependencies have been introduced (lines 197-201). Confirm that the instrumentation for tracing and metrics is correctly implemented and that the necessary configurations for OpenTelemetry are properly set up in the system.
To locate and review OpenTelemetry usage in the codebase, please run:
146-146
: Examine Impact ofklauspost/compress
UpdateThe
github.com/klauspost/compress
library has been upgraded tov1.17.0
(line 146). Review any compression-related functionalities to ensure compatibility with the updated library and confirm that there are no breaking changes.Identify where
klauspost/compress
is utilized:
version = "v0.112.0" | ||
hash = "sha256-lmNLoqmLURfxu+a6V/SeoP8xVn0Wi2SD7uxxAtSjm+o=" |
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
Deprecated functions or APIs detected.
Several instances of deprecated functions or APIs were found in the codebase:
./app/ante/ante.go
: Deprecated handling of Cosmos SDK transactions../app/ante/eip712.go
: Multiple deprecated annotations related to EIP-712../app/export.go
: Temporary feature marked for deprecation../crypto/codec/amino.go
: Deprecated SDK components../x/evm/types/msg.go
: Deprecated transaction size handling../x/evm/types/params_legacy.go
: Deprecated parameter management in favor ofx/gov
../x/feemarket/types/keys.go
: Unused deprecated prefix.
Please address these deprecated usages to ensure future compatibility and maintain code quality.
🔗 Analysis chain
Ensure compatibility with major version upgrades.
Several modules have been upgraded to newer versions, including:
cloud.google.com/go
to v0.112.0cloud.google.com/go/storage
to v1.36.0github.com/btcsuite/btcd
to v0.24.2github.com/cosmos/cosmos-sdk
to v0.47.14github.com/cosmos/gogoproto
to v1.7.0google.golang.org/api
to v0.155.0google.golang.org/grpc
to v1.62.1google.golang.org/protobuf
to v1.33.0
These upgrades may introduce breaking changes or new features. Please ensure that:
- The codebase has been adapted to any breaking changes.
- New features are utilized where appropriate.
- Comprehensive testing has been performed to verify compatibility.
To verify the impact of these upgrades, please run the following script:
Also applies to: 17-18, 76-77, 82-83, 85-86, 131-132, 140-141, 363-364, 426-427, 486-487, 489-490, 492-493, 498-499, 504-505, 507-508, 510-511, 565-566, 568-569, 571-572, 580-581, 586-587, 589-590, 592-593, 595-596, 598-599, 607-608, 613-614, 616-617, 619-620, 622-623, 625-626
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check for any breaking changes or deprecation warnings in the codebase after dependency upgrades.
# Test: Compile the project and check for any new warnings or errors
go build ./... 2>&1 | grep -E "warning|error|deprecated"
# Test: Run all tests to ensure functionality is maintained
go test ./...
Length of output: 403
Script:
#!/bin/bash
# Description: List all current dependencies with their versions to confirm upgrades.
go list -m all
Length of output: 86
Script:
#!/bin/bash
# Description: Search for usage of deprecated functions or APIs in the codebase.
grep -R --include="*.go" -E "Deprecated|deprecated" .
Length of output: 1306
Script:
#!/bin/bash
# Description: Analyze the dependency tree for potential conflicts or issues.
go mod graph | sort | uniq
Length of output: 98
github.com/cosmos/cosmos-proto v1.0.0-beta.4 | ||
github.com/cosmos/cosmos-sdk v0.47.10 | ||
github.com/cosmos/cosmos-proto v1.0.0-beta.5 | ||
github.com/cosmos/cosmos-sdk v0.47.14 |
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
Potential Deprecated API Usages Identified
Several instances suggest deprecated or altered APIs from cosmos-sdk
v0.47.14:
x/evm/types/params_legacy.go
: Usage of deprecated functionsParamKeyTable
andParamSetPairs
.app/ante/ante.go
: Deprecated handling of EIP712 representations.- Multiple files in
x/evm/types/
andrpc/ethereum/pubsub/
directories indicate deprecated fields and methods related toRemoved
. testutil/network/network.go
: Presence of deprecated TODO comments and legacy configurations.app/ante/eip712.go
: Deprecated transaction handling and signature verification mechanisms.
🔗 Analysis chain
Verify Integration with Updated cosmos-sdk
Version
The github.com/cosmos/cosmos-sdk
has been upgraded to v0.47.14
(line 16) as per the PR objective. This major update could affect modules and functionalities dependent on cosmos-sdk
. Ensure that all references and implementations align with the new version's API and address any deprecations or breaking changes.
To identify potential issues with the cosmos-sdk
upgrade, execute the following script:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Identify usage of deprecated or altered APIs from `cosmos-sdk`.
# Search for known deprecated or altered functions in `cosmos-sdk` v0.47.x.
# Replace 'OldFunction' with actual deprecated function names if available.
rg --type go 'OldFunction|DeprecatedFunction' -A 5
Length of output: 126
Script:
#!/bin/bash
# Description: Identify usage of deprecated or altered APIs from `cosmos-sdk` v0.47.14.
# Replace 'ActualDeprecatedFunction1|ActualDeprecatedFunction2' with real deprecated function names as per `cosmos-sdk` v0.47.14 documentation.
rg --type go 'ActualDeprecatedFunction1|ActualDeprecatedFunction2' -A 5
# Alternatively, if specific deprecated functions are unknown, search for deprecation comments.
rg --type go '//\s*@deprecated' -A 3
Length of output: 112
Script:
#!/bin/bash
# Description: Identify usage of deprecated or altered APIs from `cosmos-sdk` v0.47.14.
# Search for general deprecation annotations in Go files.
rg --type go '@deprecated' -A 3
# Optionally, search for common deprecation keywords or patterns.
rg --type go 'Deprecated|Obsolete|Remove' -A 3
Length of output: 9326
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.
some lint issues, not sure if related somehow
nope not related, the same lint issues exist on |
Upgrade cosmos-sdk to match node version.
zeta-chain/node#2980
Related to #86
Summary by CodeRabbit
New Features
github.com/sagikazarmark/locafero
andgithub.com/sagikazarmark/slog-shim
.Dependency Updates
cloud.google.com/go
,github.com/btcsuite/btcd
, andgoogle.golang.org/grpc
.Bug Fixes