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

refactor: remove v1 commands and begin server removal #23018

Merged
merged 7 commits into from
Dec 20, 2024

Conversation

julienrbrt
Copy link
Member

@julienrbrt julienrbrt commented Dec 19, 2024

Description

ref: #22904

  • Remove v1 commands from client (pruning)
  • Cleanup x/genutil v1 commands
  • Remove dead code server

Server/config needs to stay I think as confix uses it, and you can go install it from main.


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title, you can find examples of the prefixes below:
  • confirmed ! in the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • reviewed "Files changed" and left comments if necessary
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • updated the relevant documentation or specification, including comments for documenting Go code
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

Please see Pull Request Reviewer section in the contributing guide for more information on how to review a pull request.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic, API design and naming, documentation is accurate, tests and test coverage

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Introduced a new interface for managing genesis data validation and default settings.
    • Enhanced the genesis transaction command to include validation for the genesis state.
    • Added new configuration flags for server management.
  • Bug Fixes

    • Improved error handling during the genesis state validation process.
    • Enhanced error handling for database operations and command execution.
  • Chores

    • Removed outdated commands related to pruning and genesis management from the application.
    • Cleaned up and updated module dependencies across various components.

Copy link
Contributor

coderabbitai bot commented Dec 19, 2024

Warning

Rate limit exceeded

@julienrbrt has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 18 minutes and 34 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between fda6f6d and 42fcdd7.

⛔ Files ignored due to path filters (27)
  • client/v2/go.sum is excluded by !**/*.sum
  • go.sum is excluded by !**/*.sum
  • server/v2/cometbft/go.sum is excluded by !**/*.sum
  • simapp/v2/go.sum is excluded by !**/*.sum
  • tests/go.sum is excluded by !**/*.sum
  • tools/benchmark/go.sum is excluded by !**/*.sum
  • x/accounts/defaults/base/go.sum is excluded by !**/*.sum
  • x/accounts/defaults/lockup/go.sum is excluded by !**/*.sum
  • x/accounts/defaults/multisig/go.sum is excluded by !**/*.sum
  • x/accounts/go.sum is excluded by !**/*.sum
  • x/authz/go.sum is excluded by !**/*.sum
  • x/bank/go.sum is excluded by !**/*.sum
  • x/circuit/go.sum is excluded by !**/*.sum
  • x/consensus/go.sum is excluded by !**/*.sum
  • x/distribution/go.sum is excluded by !**/*.sum
  • x/epochs/go.sum is excluded by !**/*.sum
  • x/evidence/go.sum is excluded by !**/*.sum
  • x/feegrant/go.sum is excluded by !**/*.sum
  • x/gov/go.sum is excluded by !**/*.sum
  • x/group/go.sum is excluded by !**/*.sum
  • x/mint/go.sum is excluded by !**/*.sum
  • x/nft/go.sum is excluded by !**/*.sum
  • x/params/go.sum is excluded by !**/*.sum
  • x/protocolpool/go.sum is excluded by !**/*.sum
  • x/slashing/go.sum is excluded by !**/*.sum
  • x/staking/go.sum is excluded by !**/*.sum
  • x/upgrade/go.sum is excluded by !**/*.sum
📒 Files selected for processing (24)
  • client/v2/go.mod (0 hunks)
  • go.mod (1 hunks)
  • server/swagger.go (0 hunks)
  • simapp/v2/go.mod (0 hunks)
  • tests/go.mod (0 hunks)
  • x/accounts/defaults/base/go.mod (0 hunks)
  • x/accounts/defaults/multisig/go.mod (0 hunks)
  • x/accounts/go.mod (0 hunks)
  • x/authz/go.mod (0 hunks)
  • x/bank/go.mod (0 hunks)
  • x/circuit/go.mod (0 hunks)
  • x/consensus/go.mod (0 hunks)
  • x/distribution/go.mod (0 hunks)
  • x/epochs/go.mod (0 hunks)
  • x/evidence/go.mod (0 hunks)
  • x/feegrant/go.mod (1 hunks)
  • x/gov/go.mod (0 hunks)
  • x/group/go.mod (0 hunks)
  • x/mint/go.mod (0 hunks)
  • x/nft/go.mod (0 hunks)
  • x/protocolpool/go.mod (0 hunks)
  • x/slashing/go.mod (0 hunks)
  • x/staking/go.mod (0 hunks)
  • x/upgrade/go.mod (0 hunks)
📝 Walkthrough
📝 Walkthrough
📝 Walkthrough

Walkthrough

The pull request involves the removal of several files and functions related to command-line interface (CLI) management in the Cosmos SDK. Specifically, it removes main.go in the pruning client, commands.go, export.go, and modifies gentx.go in the genesis utility client. The changes primarily impact command definitions for pruning, genesis management, state export, and transaction generation. A new interface genesisMM is introduced in gentx.go to provide more structured genesis state management.

Changes

File Change Summary
client/pruning/main.go Removed entire file with pruning command and database opening functions
x/genutil/client/cli/commands.go Deleted file containing genesis command generation functions
x/genutil/client/cli/export.go Removed ExportCmd for exporting application state
x/genutil/client/cli/gentx.go Added new genesisMM interface, updated GenTxCmd function signature
client/v2/go.mod Updated dependencies, removed github.com/cosmos/gogogateway
go.mod Updated dependencies, removed multiple unused packages
runtime/app.go Removed RegisterAPIRoutes method
server/api/server.go Removed API server implementation
server/cmt_cmds.go Removed several command definitions for CometBFT interactions
server/rollback.go Removed rollback command implementation
server/start.go Removed server start command implementation
server/types/app.go Removed RegisterAPIRoutes method signature
server/util.go Removed context management and utility functions
server/v2/cometbft/go.mod Updated dependencies and removed github.com/cosmos/gogogateway
x/accounts/defaults/base/go.mod Updated dependencies, removed several indirect dependencies
x/accounts/go.mod Cleaned up dependencies, removed unused packages
x/authz/go.mod Updated dependencies, removed several indirect dependencies
x/bank/go.mod Updated dependencies, removed several indirect dependencies
x/circuit/go.mod Updated dependencies, removed github.com/cosmos/gogogateway
x/consensus/go.mod Updated dependencies, removed several indirect dependencies
x/distribution/go.mod Updated dependencies, removed several indirect dependencies
x/epochs/go.mod Cleaned up dependencies, removed several indirect dependencies
x/evidence/go.mod Updated dependencies, removed several indirect dependencies
x/feegrant/go.mod Updated dependencies, consolidated dependency declarations
x/gov/go.mod Updated dependencies, removed several indirect dependencies
x/group/go.mod Updated dependencies, removed several indirect dependencies
x/mint/go.mod Updated dependencies, removed several indirect dependencies
x/nft/go.mod Updated dependencies, removed several indirect dependencies
x/params/go.mod Updated dependencies, removed several indirect dependencies
x/protocolpool/go.mod Updated dependencies, removed github.com/cosmos/gogogateway
x/slashing/go.mod Updated dependencies, removed several indirect dependencies
x/staking/go.mod Updated dependencies, removed several indirect dependencies
x/upgrade/go.mod Updated dependencies, added several new indirect dependencies

Possibly related PRs

Suggested labels

C:core/testing, C:Confix, C:Hubl, backport/v0.52.x

Suggested reviewers

  • tac0turtle
  • sontrinh16

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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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

🧹 Nitpick comments (1)
x/genutil/client/cli/gentx.go (1)

29-32: Consider improving interface naming and documentation

The newly introduced interface name “genesisMM” may not be immediately obvious to future maintainers. Also, adding doc comments for the interface and its methods would clarify usage expectations. For example:

• Rename “genesisMM” to something more descriptive (e.g., “GenesisModuleManager”).
• Provide doc comments describing the purpose of “DefaultGenesis” and “ValidateGenesis”.

Below is a potential diff:

-// genesisMM defines methods for default and validated genesis data.
-type genesisMM interface {
+// GenesisModuleManager defines methods for managing the genesis state of modules.
+type GenesisModuleManager interface {
	DefaultGenesis() map[string]json.RawMessage
	ValidateGenesis(genesisData map[string]json.RawMessage) error
}
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4f5c3d8 and 0fdd8f2.

📒 Files selected for processing (4)
  • client/pruning/main.go (0 hunks)
  • x/genutil/client/cli/commands.go (0 hunks)
  • x/genutil/client/cli/export.go (0 hunks)
  • x/genutil/client/cli/gentx.go (1 hunks)
💤 Files with no reviewable changes (3)
  • x/genutil/client/cli/commands.go
  • client/pruning/main.go
  • x/genutil/client/cli/export.go
🧰 Additional context used
📓 Path-based instructions (1)
x/genutil/client/cli/gentx.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

@julienrbrt julienrbrt marked this pull request as draft December 19, 2024 21:15
@github-actions github-actions bot removed the Type: CI label Dec 19, 2024
@julienrbrt julienrbrt marked this pull request as ready for review December 19, 2024 21:53
runtime/app.go Outdated
Copy link
Member Author

Choose a reason for hiding this comment

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

I could have removed more, but that would touch the config and I think we need to think about server/config functionalities a bit more because of config.

@julienrbrt julienrbrt changed the title chore: remove v1 commands refactor: remove v1 commands and begin serverremoval Dec 19, 2024
@julienrbrt julienrbrt changed the title refactor: remove v1 commands and begin serverremoval refactor: remove v1 commands and begin server removal Dec 19, 2024
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: 2

🧹 Nitpick comments (5)
server/flags.go (3)

3-18: Add documentation for critical configuration flags.

While the grouping is clear, consider adding documentation for critical flags like FlagMinGasPrices, FlagHaltHeight, and FlagHaltTime to explain their purpose and expected values.

Consider adding documentation like this:

 const (
 	// CometBFT full-node start flags
 	flagWithComet          = "with-comet"
 	flagAddress            = "address"
 	flagTransport          = "transport"
 	flagTraceStore         = "trace-store"
 	flagCPUProfile         = "cpu-profile"
+	// FlagMinGasPrices defines the minimum gas prices a validator is willing to accept for processing a
+	// transaction. A transaction's fees must meet the minimum of any denomination specified in this config.
 	FlagMinGasPrices       = "minimum-gas-prices"
+	// FlagHaltHeight defines a height at which a node will gracefully halt and shutdown
 	FlagHaltHeight         = "halt-height"
+	// FlagHaltTime defines a UNIX timestamp at which a node will gracefully halt and shutdown
 	FlagHaltTime           = "halt-time"

19-28: Improve flag grouping organization.

Consider reorganizing the flags into more specific groups:

  1. Move FlagShutdownGrace to the CometBFT group as it's related to node operation
  2. Create a separate group for IAVL-specific flags

Consider this organization:

 	// Pruning flags
 	FlagPruning           = "pruning"
 	FlagPruningKeepRecent = "pruning-keep-recent"
 	FlagPruningInterval   = "pruning-interval"
 	FlagIndexEvents       = "index-events"
 	FlagMinRetainBlocks   = "min-retain-blocks"
-	FlagIAVLCacheSize     = "iavl-cache-size"
-	FlagDisableIAVLFastNode = "iavl-disable-fastnode"
-	FlagIAVLSyncPruning    = "iavl-sync-pruning"
-	FlagShutdownGrace      = "shutdown-grace"
+
+	// IAVL configuration flags
+	FlagIAVLCacheSize       = "iavl-cache-size"
+	FlagDisableIAVLFastNode = "iavl-disable-fastnode"
+	FlagIAVLSyncPruning     = "iavl-sync-pruning"

49-57: Add documentation and use consistent naming for testnet keys.

The testnet keys would benefit from documentation explaining their purpose. Also, consider making the naming more consistent.

Consider these improvements:

 	// testnet keys
+	// Keys used for testnet configuration and upgrade management
 
 	KeyIsTestnet             = "is-testnet"
-	KeyNewChainID            = "new-chain-ID"
-	KeyNewOpAddr             = "new-operator-addr"
-	KeyNewValAddr            = "new-validator-addr"
+	KeyChainID               = "chain-id"              // The new chain ID to use
+	KeyOperatorAddr          = "operator-addr"         // The new operator address
+	KeyValidatorAddr         = "validator-addr"        // The new validator address
 	KeyUserPubKey            = "user-pub-key"
 	KeyTriggerTestnetUpgrade = "trigger-testnet-upgrade"
x/genutil/client/cli/export.go (2)

47-47: Consider closing the database.
The database handle (db) isn't closed after use. Although it may be acceptable to let it persist, best practice is to close DB connections, especially if this command is part of a longer-running process.


126-131: Validate openDB error handling.
The openDB function simply returns an error from dbm.NewDB. Depending on usage, confirm if additional context or logging is desirable for troubleshooting DB open failures.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 0fdd8f2 and fda6f6d.

⛔ Files ignored due to path filters (27)
  • client/v2/go.sum is excluded by !**/*.sum
  • go.sum is excluded by !**/*.sum
  • server/v2/cometbft/go.sum is excluded by !**/*.sum
  • simapp/v2/go.sum is excluded by !**/*.sum
  • tests/go.sum is excluded by !**/*.sum
  • tools/benchmark/go.sum is excluded by !**/*.sum
  • x/accounts/defaults/base/go.sum is excluded by !**/*.sum
  • x/accounts/defaults/lockup/go.sum is excluded by !**/*.sum
  • x/accounts/defaults/multisig/go.sum is excluded by !**/*.sum
  • x/accounts/go.sum is excluded by !**/*.sum
  • x/authz/go.sum is excluded by !**/*.sum
  • x/bank/go.sum is excluded by !**/*.sum
  • x/circuit/go.sum is excluded by !**/*.sum
  • x/consensus/go.sum is excluded by !**/*.sum
  • x/distribution/go.sum is excluded by !**/*.sum
  • x/epochs/go.sum is excluded by !**/*.sum
  • x/evidence/go.sum is excluded by !**/*.sum
  • x/feegrant/go.sum is excluded by !**/*.sum
  • x/gov/go.sum is excluded by !**/*.sum
  • x/group/go.sum is excluded by !**/*.sum
  • x/mint/go.sum is excluded by !**/*.sum
  • x/nft/go.sum is excluded by !**/*.sum
  • x/params/go.sum is excluded by !**/*.sum
  • x/protocolpool/go.sum is excluded by !**/*.sum
  • x/slashing/go.sum is excluded by !**/*.sum
  • x/staking/go.sum is excluded by !**/*.sum
  • x/upgrade/go.sum is excluded by !**/*.sum
📒 Files selected for processing (43)
  • client/v2/go.mod (0 hunks)
  • go.mod (1 hunks)
  • runtime/app.go (0 hunks)
  • server/README.md (0 hunks)
  • server/api/server.go (0 hunks)
  • server/cmd/execute.go (0 hunks)
  • server/cmt_cmds.go (0 hunks)
  • server/constructors_test.go (0 hunks)
  • server/doc.go (0 hunks)
  • server/flags.go (1 hunks)
  • server/module_hash.go (0 hunks)
  • server/pruning.go (0 hunks)
  • server/pruning_test.go (0 hunks)
  • server/rollback.go (0 hunks)
  • server/start.go (0 hunks)
  • server/types/app.go (0 hunks)
  • server/util.go (0 hunks)
  • server/util_test.go (0 hunks)
  • server/v2/cometbft/go.mod (0 hunks)
  • simapp/v2/go.mod (0 hunks)
  • tests/go.mod (0 hunks)
  • tests/integration/server/grpc_test.go (0 hunks)
  • x/accounts/defaults/base/go.mod (0 hunks)
  • x/accounts/defaults/multisig/go.mod (0 hunks)
  • x/accounts/go.mod (0 hunks)
  • x/authz/go.mod (0 hunks)
  • x/bank/go.mod (0 hunks)
  • x/circuit/go.mod (0 hunks)
  • x/consensus/go.mod (0 hunks)
  • x/distribution/go.mod (0 hunks)
  • x/epochs/go.mod (0 hunks)
  • x/evidence/go.mod (0 hunks)
  • x/feegrant/go.mod (1 hunks)
  • x/genutil/client/cli/export.go (4 hunks)
  • x/gov/go.mod (0 hunks)
  • x/group/go.mod (0 hunks)
  • x/mint/go.mod (0 hunks)
  • x/nft/go.mod (0 hunks)
  • x/params/go.mod (0 hunks)
  • x/protocolpool/go.mod (0 hunks)
  • x/slashing/go.mod (0 hunks)
  • x/staking/go.mod (0 hunks)
  • x/upgrade/go.mod (0 hunks)
💤 Files with no reviewable changes (39)
  • server/types/app.go
  • server/cmd/execute.go
  • server/pruning.go
  • server/constructors_test.go
  • server/README.md
  • server/doc.go
  • server/start.go
  • x/slashing/go.mod
  • server/rollback.go
  • server/module_hash.go
  • server/pruning_test.go
  • client/v2/go.mod
  • runtime/app.go
  • tests/integration/server/grpc_test.go
  • x/consensus/go.mod
  • x/upgrade/go.mod
  • x/mint/go.mod
  • server/util_test.go
  • x/epochs/go.mod
  • x/accounts/defaults/multisig/go.mod
  • x/protocolpool/go.mod
  • server/api/server.go
  • x/accounts/defaults/base/go.mod
  • x/circuit/go.mod
  • server/util.go
  • x/accounts/go.mod
  • x/distribution/go.mod
  • x/bank/go.mod
  • tests/go.mod
  • x/evidence/go.mod
  • server/v2/cometbft/go.mod
  • simapp/v2/go.mod
  • x/authz/go.mod
  • x/nft/go.mod
  • x/staking/go.mod
  • server/cmt_cmds.go
  • x/group/go.mod
  • x/params/go.mod
  • x/gov/go.mod
🧰 Additional context used
📓 Path-based instructions (2)
x/genutil/client/cli/export.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

server/flags.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

🔇 Additional comments (9)
server/flags.go (2)

29-33: LGTM!

The state sync flags are well-organized and clearly named.


45-48: LGTM!

The mempool flag is well-defined and appropriately grouped.

x/genutil/client/cli/export.go (5)

9-9: No issues with this import.
Importing "path/filepath" appears correct and aligns well with usage in the newly introduced openDB function.


11-11: Dependency reference is valid.
Import alias "dbm" from "github.com/cosmos/cosmos-db" is consistent with the usage in openDB and getAppDBBackend.


15-15: Core store import looks good.
Import alias "corestore" from "cosmossdk.io/core/store" is utilized for the KVStore interface without any issues.


80-80: Passing in nil for trace writer.
Confirm you do not require a trace writer for debugging or profiling. If exporting large states, you may want to log/troubleshoot details.


125-125: Empty line.
There is nothing to address here.

x/feegrant/go.mod (1)

31-31: Check version validity.
You have introduced “github.com/cockroachdb/fifo” with a specific commit hash. Verify that this commit is stable and doesn't introduce unexpected dependencies or issues.

✅ Verification successful

Version is stable and widely used across the codebase

The commit 0bbfbd93a7ce from June 6, 2024, is a merge commit for a safety improvement PR ("queue-safer"). This version is consistently used across multiple modules in the codebase as an indirect dependency, indicating it's a stable and vetted version. The widespread adoption across different modules (x/feegrant, x/bank, x/gov, etc.) suggests it has been thoroughly tested within the ecosystem.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Validate the introduced CockroachDB FIFO version
gh api graphql -f query='
{
  repository(name: "fifo", owner: "cockroachdb") {
    object(expression: "0bbfbd93a7ce") {
      ... on Commit {
        committedDate
        messageHeadline
      }
    }
  }
}'

Length of output: 357


Script:

#!/bin/bash
# Check the go.mod file for any potential conflicts or issues
cat x/feegrant/go.mod

# Check if this dependency is used in the codebase
rg "github.com/cockroachdb/fifo" -A 2

Length of output: 35857

go.mod (1)

160-160: Verify newly added sync version.
Confirm that “golang.org/x/sync v0.10.0” does not introduce any known vulnerabilities or backward-incompatible changes for the project.

✅ Verification successful

Let me gather more information about the changes between versions and usage.


Let me check the changelog and release notes for this version.


Let me check the actual usage of the sync package in the codebase with a different pattern.


golang.org/x/sync v0.10.0 update is safe to use

The package is used in a limited scope within the codebase, specifically for the errgroup package in:

  • x/gov/types/v1/genesis.go
  • store/v2/migration/manager.go

The v0.10.0 release of golang.org/x/sync is a stable version that maintains backward compatibility. The package provides additional concurrency primitives and is well-maintained as part of the Go ecosystem. No known vulnerabilities or breaking changes are reported for this version.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for potential vulnerabilities or advisories regarding golang.org/x/sync v0.10.0
gh api graphql -f query='
{
  securityVulnerabilities(first: 5, ecosystem: GO, package: "golang.org/x/sync") {
    nodes {
      advisory {
        summary
        severity
        publishedAt
      }
      vulnerableVersionRange
      firstPatchedVersion {
        identifier
      }
    }
  }
}'

Length of output: 349


Script:

#!/bin/bash
# Check the previous version of golang.org/x/sync in go.mod
git log -p go.mod | grep "golang.org/x/sync" | head -n 2

# Find all usages of sync package in the codebase
rg "golang.org/x/sync" -A 2

# Check if there are any breaking changes by looking at imports
rg "sync/" --type go

Length of output: 62098


Script:

#!/bin/bash
# Check the changelog or release notes for golang.org/x/sync v0.10.0
curl -s https://raw.githubusercontent.com/golang/sync/v0.10.0/CHANGES.md || true
curl -s https://raw.githubusercontent.com/golang/sync/v0.10.0/README.md || true

# Check actual usage of sync package in the codebase
ast-grep --pattern 'import "$_"' | grep sync

Length of output: 849


Script:

#!/bin/bash
# Check where golang.org/x/sync is actually used
rg "golang.org/x/sync" --type go -B 2 -A 2

# Check what version was used before
git log -p go.mod | grep "golang.org/x/sync" | head -n 4

Length of output: 505

server/flags.go Show resolved Hide resolved
x/genutil/client/cli/export.go Show resolved Hide resolved
Copy link
Member

@tac0turtle tac0turtle left a comment

Choose a reason for hiding this comment

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

wow, this is an amazing start. incredible to see the day the legacy system gets deleted

@julienrbrt julienrbrt added this pull request to the merge queue Dec 20, 2024
Merged via the queue into main with commit 6a550b9 Dec 20, 2024
92 of 93 checks passed
@julienrbrt julienrbrt deleted the julien/v1-commands branch December 20, 2024 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants