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(proto): use buf registry for cometbft protos #19366

Merged
merged 10 commits into from
Feb 16, 2024

Conversation

julienrbrt
Copy link
Member

@julienrbrt julienrbrt commented Feb 6, 2024

Description

Purposely ignoring the result of this action: https://github.com/cosmos/cosmos-sdk/actions/runs/7802154284/job/21278920476?pr=19366 as tendermint protos aren't sdk protos, and now that cometbft has a buf module, this isn't breaking. We've only included cometbft protos in the past because they didn't use buf.


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
  • 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.

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

  • Refactor

    • Simplified dependency management across various modules.
    • Improved import paths for better code maintainability.
  • Chores

    • Updated dependencies and added new ones to enhance functionality.
    • Removed outdated configurations and dependencies for a cleaner setup.
  • Documentation

    • Adjusted comments and documentation to reflect current configurations and dependencies accurately.

Copy link
Contributor

coderabbitai bot commented Feb 6, 2024

Note

Reviews Paused

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Walkthrough

The project has undergone a significant update, focusing on cleaning up dependencies, reorganizing imports, and updating import paths across various packages. Notably, explicit downloading of protobuf files has been removed from the Makefile, and new dependencies have been added to various go.mod files. Import paths for packages like abci, types, and others have been updated to reflect new structures. Additionally, the project has seen the addition of new dependencies and versions in go.sum files, indicating an overall enhancement in the project's dependency management and structure.

Changes

Files Change Summary
Makefile Removed explicit downloading of protobuf files.
api/.../abci/v1beta1/abci.pulsar.go Updated import paths for abci and types.
api/.../tendermint/v1beta1/query.pulsar.go Reorganized import statements.
api/.../tendermint/v1beta1/types.pulsar.go Updated import paths for types and version.
api/.../consensus/v1/*.pulsar.go Updated import path for types package.
api/.../staking/v1beta1/staking.pulsar.go Reorganized import statements for abci and types.
api/.../store/.../*.pulsar.go Updated import paths for abci and v1beta1.
api/.../tx/v1beta1/service.pulsar.go Updated import path for types package.
api/go.mod, api/go.sum Added new dependencies.
go.mod, go.sum Added dependencies and new versions.
proto/buf.gen.pulsar.yaml Commented out go-cosmos-orm plugin config.
proto/buf.lock, proto/buf.yaml Updated dependencies' commits and added dependency.
simapp/..., tests/..., x/... (go.mod, go.sum) Added dependencies and new versions of protocol buffers.

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>.
    • Generate unit-tests for this file.
  • 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 tests 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 generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

@julienrbrt julienrbrt marked this pull request as ready for review February 6, 2024 15:33
@julienrbrt julienrbrt requested a review from a team as a code owner February 6, 2024 15:33
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.

Review Status

Actionable comments generated: 4

Configuration used: .coderabbit.yml

Commits Files that changed from the base of the PR and between c91660e and d918fbb.
Files selected for processing (32)
  • Makefile (1 hunks)
  • api/cosmos/base/abci/v1beta1/abci.pulsar.go (1 hunks)
  • api/cosmos/base/tendermint/v1beta1/query.pulsar.go (1 hunks)
  • api/cosmos/base/tendermint/v1beta1/types.pulsar.go (1 hunks)
  • api/cosmos/consensus/v1/query.pulsar.go (1 hunks)
  • api/cosmos/consensus/v1/tx.pulsar.go (1 hunks)
  • api/cosmos/staking/v1beta1/staking.pulsar.go (1 hunks)
  • api/cosmos/store/streaming/abci/grpc.pulsar.go (1 hunks)
  • api/cosmos/store/v1beta1/listening.pulsar.go (1 hunks)
  • api/cosmos/tx/v1beta1/service.pulsar.go (1 hunks)
  • api/go.mod (2 hunks)
  • api/go.sum (1 hunks)
  • go.mod (1 hunks)
  • go.sum (1 hunks)
  • proto/buf.gen.pulsar.yaml (1 hunks)
  • proto/buf.lock (1 hunks)
  • proto/buf.yaml (1 hunks)
  • simapp/go.mod (1 hunks)
  • simapp/go.sum (1 hunks)
  • simapp/gomod2nix.toml (1 hunks)
  • tests/go.mod (1 hunks)
  • tests/go.sum (1 hunks)
  • tests/starship/tests/go.mod (1 hunks)
  • tests/starship/tests/go.sum (1 hunks)
  • x/accounts/go.mod (1 hunks)
  • x/accounts/go.sum (1 hunks)
  • x/authz/go.mod (1 hunks)
  • x/authz/go.sum (1 hunks)
  • x/gov/go.mod (1 hunks)
  • x/gov/go.sum (1 hunks)
  • x/group/go.mod (1 hunks)
  • x/group/go.sum (1 hunks)
Files not reviewed due to errors (2)
  • (no review received)
  • (no review received)
Files skipped from review due to trivial changes (2)
  • Makefile
  • proto/buf.gen.pulsar.yaml
Additional comments: 41
proto/buf.yaml (1)
  • 5-5: LGTM!
api/go.mod (2)
  • 6-6: LGTM!
  • 15-15: LGTM!
proto/buf.lock (3)
  • 12-13: LGTM!
  • 17-18: LGTM!
  • 24-28: LGTM!
api/go.sum (1)
  • 1-4: LGTM!
x/accounts/go.mod (1)
  • 21-22: LGTM!
x/authz/go.mod (1)
  • 30-33: LGTM!
x/gov/go.mod (1)
  • 36-39: LGTM!
x/group/go.mod (1)
  • 39-40: LGTM!
go.mod (1)
  • 69-70: LGTM!
tests/go.mod (1)
  • 52-53: LGTM!
tests/starship/tests/go.mod (1)
  • 53-54: The addition of buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go and buf.build/gen/go/tendermint/tendermint/protocolbuffers/go dependencies aligns with the PR objectives to leverage buf registry for protobuf management. Ensure the specified versions are the latest stable releases compatible with the project.
simapp/go.mod (1)
  • 51-52: The inclusion of buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go and buf.build/gen/go/tendermint/tendermint/protocolbuffers/go dependencies is consistent with the PR's goal to utilize the buf registry for protobuf file management. Confirm that the versions used are up-to-date and compatible with the rest of the project's dependencies.
simapp/gomod2nix.toml (1)
  • 4-9: Ensure the versions and hashes for buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go and buf.build/gen/go/tendermint/tendermint/protocolbuffers/go are correctly aligned with the intended versions from the buf registry. The formatting and structure of these additions are consistent with the rest of the file.
api/cosmos/consensus/v1/query.pulsar.go (1)
  • 5-5: The import path for types has been updated to "buf.build/gen/go/tendermint/tendermint/protocolbuffers/go/tendermint/types". Confirm this path aligns with the new structure and location of the protobuf definitions as per the buf registry adoption.
api/cosmos/consensus/v1/tx.pulsar.go (1)
  • 5-5: The import path for the types package has been updated to buf.build/gen/go/tendermint/tendermint/protocolbuffers/go/tendermint/types. Ensure this path correctly points to the intended buf-generated protobuf definitions as per the PR objectives.
api/cosmos/store/v1beta1/listening.pulsar.go (1)
  • 5-5: The import path for the abci package has been updated to use buf.build/gen/go/tendermint/tendermint/protocolbuffers/go/tendermint/abci. Ensure this new path correctly points to the intended abci package and matches the project's dependency management and build configurations.
api/cosmos/store/streaming/abci/grpc.pulsar.go (1)
  • 5-5: Ensure the new import paths buf.build/gen/go/tendermint/tendermint/protocolbuffers/go/tendermint/abci and cosmossdk.io/api/cosmos/store/v1beta1 are correct and accessible within the project's dependencies.
api/cosmos/base/tendermint/v1beta1/types.pulsar.go (1)
  • 5-6: The import paths for types and version packages have been updated to use buf.build URLs. Confirm that these URLs are correctly pointing to the intended modules and that they are accessible in your build environment.
x/authz/go.sum (3)
  • 1-4: Added new versions for buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go and buf.build/gen/go/tendermint/tendermint/protocolbuffers/go. Ensure these versions are compatible with the project's requirements and do not introduce breaking changes.
  • 5-6: Updated versions for cloud.google.com/go. Verify compatibility and check for any required code changes due to this update.
  • 1-7: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [7-8]

Updated versions for cosmossdk.io/collections. Confirm that the new version's changes are compatible with the project's usage of this dependency.

x/group/go.sum (3)
  • 1-4: Ensure the added buf.build dependencies are compatible with the project's existing modules and do not introduce any known security vulnerabilities.
  • 5-5: Verify the update of cloud.google.com/go from v0.26.0 to v0.34.0 does not break any existing functionality or introduce performance regressions.
  • 7-7: Confirm the update of cosmossdk.io/collections to v0.4.0 is necessary and does not introduce breaking changes to the project.
x/gov/go.sum (3)
  • 1-4: Ensure the added versions of buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go and buf.build/gen/go/tendermint/tendermint/protocolbuffers/go are compatible with the project's requirements and do not introduce breaking changes or known security vulnerabilities.
  • 3-4: The addition of buf.build/gen/go/tendermint/tendermint/protocolbuffers/go v1.32.0-20231117195010-33ed361a9051.1 should be verified for compatibility and security. Ensure it aligns with the project's dependencies and does not conflict with other modules.
  • 1-4: Check for consistency in module versioning and ensure that the updates to buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go and buf.build/gen/go/tendermint/tendermint/protocolbuffers/go do not cause conflicts with other dependencies.
tests/go.sum (2)
  • 1-4: Ensure compatibility and absence of known issues with the newly added versions of cosmos/gogo-proto and tendermint/tendermint generated Go packages.
  • 1-7: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [5-8]

Verify that the updated versions of cloud.google.com/go do not introduce breaking changes or compatibility issues with the project's existing codebase and dependencies.

tests/starship/tests/go.sum (2)
  • 1-4: Ensure the newly added versions of cosmos/gogo-proto and tendermint/tendermint protocol buffers are compatible with the rest of the project dependencies and do not introduce breaking changes.
  • 4-4: The addition of buf.build/gen/go/tendermint/tendermint/protocolbuffers/go with version v1.32.0-20231117195010-33ed361a9051.1 aligns with the PR's objective to leverage the buf registry for protobuf management. Confirm that this version is the latest or most stable for the project's requirements.
simapp/go.sum (2)
  • 1-4: Ensure that the versions and hashes for buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go and buf.build/gen/go/tendermint/tendermint/protocolbuffers/go are correct and align with the project's dependency management strategy. The addition of these dependencies should directly support the PR's objectives of utilizing the buf registry for protobuf management.
  • 1-4: The addition of multiple versions of cloud.google.com/go in the go.sum file indicates updates to dependencies. However, without the corresponding go.mod file changes in the provided code fragment, it's not possible to assess the impact of these updates. Ensure that these updates are necessary and do not introduce version conflicts with other dependencies.
api/cosmos/base/abci/v1beta1/abci.pulsar.go (1)
  • 5-6: Ensure the new import paths for abci and types using buf.build are correctly pointing to the intended protobuf definitions. Confirm that these paths are accessible and valid within the project's dependency management setup.
api/cosmos/tx/v1beta1/service.pulsar.go (1)
  • 5-5: Ensure the new import path buf.build/gen/go/tendermint/tendermint/protocolbuffers/go/tendermint/types is accessible and correctly references the intended types package. This change aligns with the PR's goal to use the buf registry for protobuf management but requires verification to ensure the path is valid and the package is correctly utilized within the codebase.
api/cosmos/base/tendermint/v1beta1/query.pulsar.go (1)
  • 5-6: Ensure the new import paths for p2p and types packages are correct and accessible. Verify that these changes do not introduce any package initialization order issues or dependency cycles.
api/cosmos/staking/v1beta1/staking.pulsar.go (2)
  • 5-6: Ensure the updated import paths for abci and types packages are correctly pointing to the intended buf-generated protobuf files. This change is crucial for aligning with the PR's objectives.
  • 5-9: Confirm that the imports prefixed with an underscore are intentionally used for their side effects only, as per Go's convention for imports that are necessary but not directly used in the code.

tests/starship/tests/go.sum Show resolved Hide resolved
api/cosmos/staking/v1beta1/staking.pulsar.go Show resolved Hide resolved
api/cosmos/base/abci/v1beta1/abci.pulsar.go Show resolved Hide resolved
api/cosmos/base/abci/v1beta1/abci.pulsar.go Show resolved Hide resolved
@julienrbrt
Copy link
Member Author

@coderabbitai pause

Copy link
Member

@facundomedica facundomedica left a comment

Choose a reason for hiding this comment

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

LGTM, left a small question

proto/buf.gen.pulsar.yaml Outdated Show resolved Hide resolved
@julienrbrt julienrbrt added this pull request to the merge queue Feb 16, 2024
Merged via the queue into main with commit 43df8d8 Feb 16, 2024
63 of 66 checks passed
@julienrbrt julienrbrt deleted the julien/use-buf-comet branch February 16, 2024 16:18
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.

3 participants