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: bump gogoproto #19869

Merged
merged 28 commits into from
Mar 28, 2024
Merged

refactor: bump gogoproto #19869

merged 28 commits into from
Mar 28, 2024

Conversation

raynaudoe
Copy link
Contributor

@raynaudoe raynaudoe commented Mar 26, 2024

Description

Fully closes #19446

Bump gogoproto to v1.4.12.
Replace old codec/types/any with gogoproto/types/any


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

Summary by CodeRabbit

  • Refactor
    • Updated data types for improved compatibility and consistency.
    • Enhanced plugin configurations to adhere to new standards and paths.

Copy link
Contributor

coderabbitai bot commented Mar 26, 2024

Walkthrough

Walkthrough

The overall change involves updating various protobuf definitions across multiple modules within a Cosmos SDK-based project. Specifically, the updates replace references from types.Any to google.protobuf.any.Any (shortened as any.Any), reflecting a shift towards using the standard protobuf Any type for enhanced compatibility and flexibility. This modification affects structures related to governance, fee grants, evidence submission, and more, streamlining the usage of Any across different components of the system.

Changes

Files Change Summary
x/evidence/types/tx.pb.go, x/feegrant/feegrant.pb.go, x/feegrant/tx.pb.go,
x/gov/types/v1/gov.pb.go, x/gov/types/v1/tx.pb.go,
x/gov/types/v1beta1/gov.pb.go, x/gov/types/v1beta1/tx.pb.go,
x/group/tx.pb.go, x/group/types.pb.go, x/nft/nft.pb.go,
x/staking/types/staking.pb.go, x/staking/types/tx.pb.go,
x/upgrade/types/upgrade.pb.go
Replaced usage of types.Any or types1.Any with any.Any.
x/feegrant/proto/buf.gen.gogo.yaml, x/genutil/proto/buf.gen.gogo.yaml,
x/gov/proto/buf.gen.gogo.yaml, x/group/proto/buf.gen.gogo.yaml,
x/mint/proto/buf.gen.gogo.yaml, x/nft/proto/buf.gen.gogo.yaml,
x/params/proto/buf.gen.gogo.yaml, x/protocolpool/proto/buf.gen.gogo.yaml,
x/slashing/proto/buf.gen.gogo.yaml, x/staking/proto/buf.gen.gogo.yaml,
x/upgrade/proto/buf.gen.gogo.yaml
Updated the plugin option in gocosmos section to use a different path for any.proto.
x/staking/types/staking.pb.go Renamed types from types3 to types2, types2 to types1, and updated references from types2.Coin to types1.Coin.

Assessment against linked issues

Objective Addressed Explanation
Move codectypes.Any to gogoproto and alias in the sdk [Feature]: move codectypes.Any

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

@raynaudoe raynaudoe marked this pull request as ready for review March 28, 2024 12:03
@raynaudoe raynaudoe requested a review from a team as a code owner March 28, 2024 12:03
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: 5

Configuration used: .coderabbit.yml

Commits Files that changed from the base of the PR and between 705fad6 and 50271e5.
Files selected for processing (74)
  • baseapp/grpcrouter_test.go (1 hunks)
  • baseapp/testutil/buf.gen.yaml (1 hunks)
  • client/grpc/cmtservice/query.pb.go (12 hunks)
  • codec/amino.go (2 hunks)
  • codec/any_test.go (1 hunks)
  • codec/json.go (2 hunks)
  • codec/types/any.go (1 hunks)
  • codec/types/any_internal_test.go (1 hunks)
  • codec/types/interface_registry.go (6 hunks)
  • codec/types/types_test.go (6 hunks)
  • codec/yaml_test.go (4 hunks)
  • crypto/keyring/record.pb.go (5 hunks)
  • crypto/keys/multisig/keys.pb.go (3 hunks)
  • proto/buf.gen.gogo.yaml (1 hunks)
  • proto/buf.lock (1 hunks)
  • store/db/pebbledb.go (2 hunks)
  • store/db/rocksdb_noflag.go (3 hunks)
  • store/root/migrate_test.go (1 hunks)
  • tests/integration/tx/internal/buf.gen.gogo.yaml (1 hunks)
  • testutil/testdata/buf.gen.gogo.yaml (1 hunks)
  • testutil/testdata/codec.go (1 hunks)
  • testutil/testdata/grpc_query.go (3 hunks)
  • testutil/testdata/query.pb.go (4 hunks)
  • testutil/testdata/testdata.pb.go (9 hunks)
  • testutil/testdata/unknonwnproto.pb.go (33 hunks)
  • types/abci.pb.go (16 hunks)
  • types/tx/signing/signing.pb.go (7 hunks)
  • types/tx/tx.pb.go (19 hunks)
  • x/accounts/defaults/lockup/types/tx.pb.go (4 hunks)
  • x/accounts/proto/buf.gen.gogo.yaml (1 hunks)
  • x/accounts/v1/query.pb.go (7 hunks)
  • x/accounts/v1/tx.pb.go (18 hunks)
  • x/auth/migrations/legacytx/stdtx.go (2 hunks)
  • x/auth/proto/buf.gen.gogo.yaml (1 hunks)
  • x/auth/signing/adapter.go (1 hunks)
  • x/auth/types/auth.pb.go (3 hunks)
  • x/auth/types/genesis.pb.go (4 hunks)
  • x/auth/types/query.pb.go (13 hunks)
  • x/authz/authz.pb.go (5 hunks)
  • x/authz/proto/buf.gen.gogo.yaml (1 hunks)
  • x/authz/tx.pb.go (3 hunks)
  • x/bank/proto/buf.gen.gogo.yaml (1 hunks)
  • x/circuit/proto/buf.gen.gogo.yaml (1 hunks)
  • x/consensus/proto/buf.gen.gogo.yaml (1 hunks)
  • x/counter/proto/buf.gen.gogo.yaml (1 hunks)
  • x/crisis/proto/buf.gen.gogo.yaml (1 hunks)
  • x/distribution/proto/buf.gen.gogo.yaml (1 hunks)
  • x/evidence/proto/buf.gen.gogo.yaml (1 hunks)
  • x/evidence/types/genesis.pb.go (4 hunks)
  • x/evidence/types/query.pb.go (7 hunks)
  • x/evidence/types/tx.pb.go (3 hunks)
  • x/feegrant/feegrant.pb.go (6 hunks)
  • x/feegrant/proto/buf.gen.gogo.yaml (1 hunks)
  • x/feegrant/tx.pb.go (4 hunks)
  • x/genutil/proto/buf.gen.gogo.yaml (1 hunks)
  • x/gov/proto/buf.gen.gogo.yaml (1 hunks)
  • x/gov/types/v1/gov.pb.go (4 hunks)
  • x/gov/types/v1/tx.pb.go (15 hunks)
  • x/gov/types/v1beta1/gov.pb.go (3 hunks)
  • x/gov/types/v1beta1/tx.pb.go (5 hunks)
  • x/group/proto/buf.gen.gogo.yaml (1 hunks)
  • x/group/tx.pb.go (9 hunks)
  • x/group/types.pb.go (5 hunks)
  • x/mint/proto/buf.gen.gogo.yaml (1 hunks)
  • x/nft/nft.pb.go (7 hunks)
  • x/nft/proto/buf.gen.gogo.yaml (1 hunks)
  • x/params/proto/buf.gen.gogo.yaml (1 hunks)
  • x/protocolpool/proto/buf.gen.gogo.yaml (1 hunks)
  • x/slashing/proto/buf.gen.gogo.yaml (1 hunks)
  • x/staking/proto/buf.gen.gogo.yaml (1 hunks)
  • x/staking/types/staking.pb.go (12 hunks)
  • x/staking/types/tx.pb.go (11 hunks)
  • x/upgrade/proto/buf.gen.gogo.yaml (1 hunks)
  • x/upgrade/types/upgrade.pb.go (3 hunks)
Path instructions used (47)
tests/integration/tx/internal/buf.gen.gogo.yaml (1)

tests/**/*
Assess the integration and e2e test code assessing sufficient code coverage for the changes associated in the pull request

codec/yaml_test.go (2)

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


**/*_test.go
Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request

codec/json.go (1)

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

testutil/testdata/codec.go (1)

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

codec/types/any_internal_test.go (2)

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


**/*_test.go
Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request

x/auth/signing/adapter.go (1)

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

testutil/testdata/grpc_query.go (1)

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

store/db/rocksdb_noflag.go (1)

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

codec/any_test.go (2)

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


**/*_test.go
Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request

codec/amino.go (1)

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

x/auth/migrations/legacytx/stdtx.go (1)

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

codec/types/types_test.go (2)

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


**/*_test.go
Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request

store/db/pebbledb.go (1)

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

baseapp/grpcrouter_test.go (2)

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


**/*_test.go
Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request

x/evidence/types/genesis.pb.go (1)

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

crypto/keys/multisig/keys.pb.go (1)

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

x/auth/types/genesis.pb.go (1)

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

codec/types/interface_registry.go (1)

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

x/evidence/types/tx.pb.go (1)

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

x/nft/nft.pb.go (1)

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

x/authz/authz.pb.go (1)

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

x/evidence/types/query.pb.go (1)

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

crypto/keyring/record.pb.go (1)

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

x/auth/types/auth.pb.go (1)

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

testutil/testdata/query.pb.go (1)

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

x/upgrade/types/upgrade.pb.go (1)

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

x/feegrant/feegrant.pb.go (1)

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

x/feegrant/tx.pb.go (1)

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

types/tx/signing/signing.pb.go (1)

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

testutil/testdata/testdata.pb.go (1)

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

x/authz/tx.pb.go (1)

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

x/gov/types/v1beta1/tx.pb.go (1)

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

x/accounts/v1/tx.pb.go (1)

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

x/accounts/v1/query.pb.go (1)

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

x/accounts/defaults/lockup/types/tx.pb.go (1)

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

x/gov/types/v1beta1/gov.pb.go (1)

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

types/abci.pb.go (1)

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

types/tx/tx.pb.go (1)

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

x/group/types.pb.go (1)

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

x/staking/types/tx.pb.go (1)

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

x/auth/types/query.pb.go (1)

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

x/gov/types/v1/tx.pb.go (1)

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

client/grpc/cmtservice/query.pb.go (1)

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

x/gov/types/v1/gov.pb.go (1)

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

x/group/tx.pb.go (1)

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

x/staking/types/staking.pb.go (1)

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

testutil/testdata/unknonwnproto.pb.go (1)

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

Files skipped from review due to trivial changes (2)
  • codec/types/any.go
  • store/root/migrate_test.go
Additional comments (207)
baseapp/testutil/buf.gen.yaml (1)
  • 5-5: The update to reference github.com/cosmos/gogoproto/types/any aligns with the PR's objectives. Please ensure the path is correct and verify compatibility with existing code.
testutil/testdata/buf.gen.gogo.yaml (1)
  • 6-6: The update to reference github.com/cosmos/gogoproto/types/any is consistent with the PR's objectives. Please ensure the path is correct and verify compatibility with existing code.
x/accounts/proto/buf.gen.gogo.yaml (1)
  • 5-5: The update to reference github.com/cosmos/gogoproto/types/any aligns with the PR's objectives. Please ensure the path is correct and verify compatibility with existing code.
x/auth/proto/buf.gen.gogo.yaml (1)
  • 5-5: The update to reference github.com/cosmos/gogoproto/types/any is consistent with the PR's objectives. Please ensure the path is correct and verify compatibility with existing code.
x/authz/proto/buf.gen.gogo.yaml (1)
  • 5-5: The update to reference github.com/cosmos/gogoproto/types/any is consistent with the PR's objectives. Please ensure the path is correct and verify compatibility with existing code.
x/bank/proto/buf.gen.gogo.yaml (1)
  • 5-5: The update to reference github.com/cosmos/gogoproto/types/any is consistent with the PR's objectives. Please ensure the path is correct and verify compatibility with existing code.
x/circuit/proto/buf.gen.gogo.yaml (1)
  • 5-5: The update to reference github.com/cosmos/gogoproto/types/any is consistent with the PR's objectives. Please ensure the path is correct and verify compatibility with existing code.
x/consensus/proto/buf.gen.gogo.yaml (1)
  • 5-5: The update to reference github.com/cosmos/gogoproto/types/any is consistent with the PR's objectives. Please ensure the path is correct and verify compatibility with existing code.
x/counter/proto/buf.gen.gogo.yaml (1)
  • 5-5: The update to reference github.com/cosmos/gogoproto/types/any in the gocosmos plugin option aligns with the PR's objectives of migrating to the newer any type. Ensure this change is consistently applied across all modules to maintain compatibility.
x/crisis/proto/buf.gen.gogo.yaml (1)
  • 5-5: Identical to the previous file, the update to reference github.com/cosmos/gogoproto/types/any is consistent with the PR's objectives. Ensure uniform application of this change across all modules.
x/distribution/proto/buf.gen.gogo.yaml (1)
  • 5-5: As with the previous files, updating the plugin option to reference github.com/cosmos/gogoproto/types/any is in line with the migration objectives. Consistency in these updates across all affected modules is crucial.
x/evidence/proto/buf.gen.gogo.yaml (1)
  • 5-5: This file's update to the gocosmos plugin option, referencing github.com/cosmos/gogoproto/types/any, is consistent with the overarching migration strategy. A comprehensive consistency check across all modules is recommended to ensure uniform application.
x/feegrant/proto/buf.gen.gogo.yaml (1)
  • 5-5: Updating the gocosmos plugin option to reference github.com/cosmos/gogoproto/types/any here is consistent with the migration efforts seen in other modules. A thorough review to ensure no old references remain is advisable.
x/genutil/proto/buf.gen.gogo.yaml (1)
  • 5-5: The update in this file to reference github.com/cosmos/gogoproto/types/any continues the consistent migration pattern observed. Additional testing, especially around serialization and deserialization processes, is recommended to ensure no issues arise from these changes.
x/gov/proto/buf.gen.gogo.yaml (1)
  • 5-5: Like the previous files, updating the gocosmos plugin option to reference github.com/cosmos/gogoproto/types/any is part of the broader migration effort. Uniform updates across all modules are essential for a seamless migration.
x/group/proto/buf.gen.gogo.yaml (1)
  • 5-5: This file's update to the gocosmos plugin option, referencing github.com/cosmos/gogoproto/types/any, completes the consistent migration effort observed across all reviewed files. A final review to ensure completeness and consistency across the codebase is recommended.
x/mint/proto/buf.gen.gogo.yaml (1)
  • 5-5: The update to the plugin option for gocosmos to reference github.com/cosmos/gogoproto/types/any aligns with the PR's objectives. Please ensure the new path is correct and compatible with the rest of the codebase.
x/nft/proto/buf.gen.gogo.yaml (1)
  • 5-5: Identical to the previous file, the update to the plugin option for gocosmos is consistent with the PR's objectives. Ensure the new path is correct and does not introduce compatibility issues.
x/params/proto/buf.gen.gogo.yaml (1)
  • 5-5: As with the previous files, the update to the gocosmos plugin option is appropriate. Please verify the correctness and compatibility of the new path.
x/slashing/proto/buf.gen.gogo.yaml (1)
  • 5-5: This update to the gocosmos plugin option follows the pattern seen in previous files. Please verify the new path's correctness and compatibility.
x/upgrade/proto/buf.gen.gogo.yaml (1)
  • 5-5: Consistent with the previous files, the update to the gocosmos plugin option is appropriate. Please verify the new path's correctness and compatibility.
tests/integration/tx/internal/buf.gen.gogo.yaml (1)
  • 5-5: The update to the gocosmos plugin option in this integration test configuration is consistent with the PR's objectives. Ensure the new path's correctness and compatibility.
proto/buf.gen.gogo.yaml (1)
  • 5-5: The update of plugin references in the gocosmos section to use the new paths for any.proto and orm.proto aligns with the migration to gogoproto/types/any and the updated cosmossdk.io/orm. This change is crucial for ensuring that the protobuf compilation process utilizes the correct versions of these dependencies.
codec/yaml_test.go (2)
  • 6-6: The update of the import path to github.com/cosmos/gogoproto/types/any/test is consistent with the migration to the new gogoproto types. This change ensures that the tests are using the correct types for YAML marshaling.
  • 15-15: The updates to the Dog and HasAnimal types in the YAML marshaling tests are correctly reflecting the changes made due to the migration to gogoproto/types/any. The expected YAML output has been appropriately adjusted to match the new type references, ensuring the tests remain valid.

Also applies to: 31-31, 41-45

codec/json.go (2)
  • 8-8: The import of gogoprototypes from github.com/cosmos/gogoproto/types/any is necessary for the migration to the updated gogoproto types. This change ensures that the JSON marshaling process utilizes the correct types.
  • 24-24: Updating the usage of types.ProtoJSONPacker to gogoprototypes.ProtoJSONPacker aligns with the migration to the new gogoproto types. This ensures that the JSON marshaling process is compatible with the updated types, enhancing serialization and deserialization processes.
proto/buf.lock (1)
  • 17-18: Updating the commit and digest values for the googleapis repository ensures that the protobuf dependencies are aligned with the latest versions. This change is crucial for maintaining compatibility and accessing the latest features and bug fixes from the googleapis.
testutil/testdata/codec.go (1)
  • 46-53: The updates to the registration of concrete types (Dog, Cat, HasAnimal, HasHasAnimal) with the new package paths are necessary for reflecting the migration to the updated gogoproto types. This ensures that the type registration is aligned with the changes and maintains the correct behavior in the codebase.
codec/types/any_internal_test.go (1)
  • 51-51: Replacing the direct manipulation of any.cachedValue with a call to any.ResetCachedValue() in the test is a good practice. It ensures that the test uses the public API of the Any type, which is more robust and less prone to breakage if the internal implementation of Any changes.
x/auth/signing/adapter.go (1)
  • 30-30: Adding the signerData parameter to the GetSignBytesAdapter function signature is a significant change. Ensure that all calls to this function throughout the codebase have been updated to include the new parameter. This change likely enhances the function's flexibility by allowing it to handle signer data explicitly.
Verification successful

To further verify the addition of the signerData parameter to the GetSignBytesAdapter function and its correct usage across the codebase, we need to inspect the parameters passed in each call to this function. Let's proceed with examining a few of these calls more closely.


The review of the new context confirms that the signerData parameter has been added to the GetSignBytesAdapter function signature and that all calls to this function throughout the codebase have been updated to include the new parameter. This verifies the accuracy of the review comment.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Search for calls to GetSignBytesAdapter to ensure they include the new signerData parameter.
rg --type go 'GetSignBytesAdapter\('

Length of output: 799



Script:

#!/bin/bash
# Extract the lines of code where `GetSignBytesAdapter` is called to verify if the `signerData` parameter is being passed.
rg --type go -C 2 'GetSignBytesAdapter\('

Length of output: 2790

testutil/testdata/grpc_query.go (2)
  • 6-6: The addition of the test package import from github.com/cosmos/gogoproto/types/any/test is necessary for the migration to the updated gogoproto types. This ensures that the correct types are used in the QueryImpl struct's methods.
  • 26-26: Updating type references from Animal to test.Animal in the QueryImpl struct's methods aligns with the migration to the new gogoproto types. This change ensures that the correct types are used, maintaining the functionality and compatibility of the code.

Also applies to: 54-54

store/db/rocksdb_noflag.go (4)
  • 16-16: The RocksDB struct is now defined without any fields. This change simplifies the struct since it's used in a build context where RocksDB is not enabled. The empty struct definition is appropriate here.
  • 56-56: The rocksDBIterator struct is now defined without any fields. Similar to the RocksDB struct, this change is appropriate for the build context where RocksDB is not enabled.
  • 90-90: The rocksDBBatch struct is now defined without any fields. This is consistent with the other struct changes in this file and is suitable for the build context.
  • 11-11: All functions in this file now contain a panic statement with the message "rocksdb must be built with -tags rocksdb". This change ensures that any attempt to use these functions without the appropriate build tags will result in a clear and immediate error. This is a good practice for conditional compilation scenarios.
codec/any_test.go (6)
  • 6-6: The import path has been updated from testdata to test for interfaces and implementations related to animals. This change aligns with the updated package structure and ensures that the correct types are used in the tests.
  • 19-23: The registration of interfaces and implementations has been updated to use the new test package. This change is necessary due to the updated import paths and ensures that the tests are using the correct types.
  • 30-30: The registration of implementations has been updated to use the new test package. This change is consistent with the other updates in this file and ensures that the tests are using the correct types.
  • 36-36: The variable kitty is now instantiated using the test package. This change is necessary due to the updated import paths and ensures that the tests are using the correct types.
  • 44-44: The variable animal is now declared using the test package. This change is consistent with the other updates in this file and ensures that the tests are using the correct types.
  • 56-56: The registration of implementations has been updated to use the new test package. This change ensures that the tests are using the correct types and is consistent with the other updates in this file.
codec/amino.go (2)
  • 11-11: The import path has been updated to gogoprototypes from types. This change reflects the migration to using the updated gogoproto types for handling interfaces with the Amino codec. Ensuring the correct import path is used is crucial for compatibility and functionality.
  • 65-77: The method calls for packing and unpacking interfaces have been updated to use the gogoprototypes package. This change is necessary due to the updated import paths and ensures that the Amino codec is using the correct methods for handling interfaces. It's important for maintaining compatibility and functionality with the updated gogoproto types.
x/auth/migrations/legacytx/stdtx.go (2)
  • 4-4: The import path has been updated to use types "github.com/cosmos/gogoproto/types/any". This change reflects the migration to using the updated gogoproto types for handling interfaces. Ensuring the correct import path is used is crucial for compatibility and functionality.
  • 110-110: The AsAny method in the StdTx struct has been updated to use types.UnsafePackAnyWithCache instead of codectypes.UnsafePackAny. This change is necessary due to the updated import paths and ensures that the method is using the correct function for packing the StdTx struct into an Any type. It's important for maintaining compatibility and functionality with the updated gogoproto types.
codec/types/types_test.go (5)
  • 9-10: The import paths have been updated to include gogoproto/types/any and gogoproto/types/any/test. This change reflects the migration to using the updated gogoproto types for handling interfaces in tests. Ensuring the correct import paths are used is crucial for compatibility and functionality.
  • 18-30: The registration of interfaces and implementations has been updated to use the new test package. This change is necessary due to the updated import paths and ensures that the tests are using the correct types. Additionally, the NewAnyWithValue method call has been correctly updated to reflect the new package structure.
  • 32-48: A new test function TestAnyResetCache has been added to test the cache reset functionality of the Any type. This addition is a good practice for ensuring the correctness of cache-related behavior in the Any type. The test is well-structured and covers the intended functionality.
  • 106-106: The error message in the TestRegister function has been updated to reflect the new package structure. This change ensures that the error message is accurate and informative, which is important for debugging and understanding test failures.
  • 189-192: The UnpackInterfaces method call has been updated to use gogoproto.ProtoJSONPacker. This change is necessary due to the updated import paths and ensures that the method is using the correct packer for handling interfaces with JSON. It's important for maintaining compatibility and functionality with the updated gogoproto types.
store/db/pebbledb.go (2)
  • 10-12: The import statements have been reorganized, moving pebble and cast imports up. This reorganization improves the readability of the import section by grouping similar imports together. It's a minor change but contributes to the overall cleanliness of the code.
  • 10-12: The NewPebbleDB function has been modified to internally call NewPebbleDBWithOpts with nil as the options parameter. This change simplifies the code by reducing duplication and leveraging the existing functionality of NewPebbleDBWithOpts. It's a good practice to avoid code duplication where possible.
baseapp/grpcrouter_test.go (1)
  • 171-171: The function call to register the query server has been updated to use testdata_pulsar.RegisterQueryServer instead of testdata.RegisterQueryServer. This change reflects the migration to using the updated package path for registering the query server. Ensuring the correct function is used is crucial for the functionality of the tests.
x/evidence/types/genesis.pb.go (4)
  • 9-9: The import path for Any has been correctly updated to any.Any from github.com/cosmos/gogoproto/types/any. This change aligns with the PR's objective to migrate to the newer gogoproto types.
  • 29-29: The GenesisState struct's Evidence field type has been updated to []*any.Any. This change is necessary for compatibility with the updated gogoproto version and follows the migration from types.Any to any.Any. Ensure that all references to this field across the codebase are updated accordingly to avoid type mismatches.
  • 65-65: The GetEvidence method correctly returns a slice of pointers to any.Any, aligning with the updated import and type usage. This consistency is crucial for maintaining the integrity of the codebase following the dependency update.
  • 223-223: In the Unmarshal method, the Evidence slice is correctly appended with instances of any.Any. This change is part of the migration to the newer gogoproto types and is implemented correctly. However, ensure that the unmarshalling process is thoroughly tested with the new type to prevent runtime issues.
crypto/keys/multisig/keys.pb.go (1)
  • 33-33: The migration from types.Any to any.Any in the PubKeys field of the LegacyAminoPubKey struct aligns with the PR's objectives to update to gogoproto v1.4.12 and migrate to gogoproto/types/any. Ensure to verify the impact of this change on serialization and deserialization processes, especially in multisig functionalities.
x/auth/types/genesis.pb.go (1)
  • 33-33: The migration from types.Any to any.Any in the Accounts field of the GenesisState struct is in line with the PR's objectives. Ensure to verify the impact of this change on the genesis process, particularly regarding compatibility with existing genesis files.
codec/types/interface_registry.go (3)
  • 31-53: Redefinition of the UnpackInterfacesMessage interface and introduction of the UnpackInterfaces function are significant changes that enhance how types packed within Any are unpacked. Ensure thorough testing, especially in scenarios involving nested Any types and recursive unpacking, to prevent regressions in functionality.
  • 287-287: The handling of cached values in the UnpackAny method is a noteworthy improvement. It's important to ensure that the cached value logic correctly handles type compatibility and does not lead to incorrect type assignments, especially in concurrent scenarios.
  • 324-329: The creation of new Any instances with cached values in the UnpackAny method introduces a change in how Any values are managed. Ensure that this does not lead to inconsistencies in Any handling across different parts of the application, particularly in serialization and deserialization processes.
x/evidence/types/tx.pb.go (3)
  • 16-16: The import alias for github.com/cosmos/gogoproto/types/any is correctly defined as any, which is concise and avoids confusion with the standard any interface introduced in Go 1.18. This change aligns with the PR objectives and is a good practice for clarity.
  • 42-42: The replacement of types.Any with any.Any for the Evidence field in the MsgSubmitEvidence struct is correctly implemented. This change is consistent with the PR's objective to migrate to the newer gogoproto/types/any package. It's important to ensure that all references and usages of MsgSubmitEvidence throughout the codebase are updated to reflect this change.
Verification successful

Given the extensive presence of types.Any across various modules and files in the codebase, it's clear that its usage is widespread and serves multiple purposes beyond the scope of the MsgSubmitEvidence struct. The specific change from types.Any to any.Any in the MsgSubmitEvidence struct is a targeted update within the evidence module. Each module listed in the script output likely utilizes types.Any for its distinct functionalities, such as governance proposals, account information, or message storage, which are unrelated to the evidence submission process.

Therefore, the presence of types.Any references in the codebase does not inherently indicate an issue with the migration to any.Any for the MsgSubmitEvidence struct. It's essential, however, to ensure that all references directly related to evidence submission are correctly updated to reflect this change. The specific mention of files within the x/evidence module, such as x/evidence/types/msgs.go, x/evidence/types/genesis.go, and x/evidence/keeper/grpc_query.go, should be scrutinized to confirm they align with the migration objectives.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Search for any remaining references to the old `types.Any` in Go files that might need updating.
rg --type go 'types\.Any' --files-with-matches

Length of output: 2501

* 478-478: The instantiation of `m.Evidence` as `&any.Any{}` during unmarshaling is correctly done. This ensures that the `Evidence` field is properly initialized with the new `any.Any` type before unmarshaling the data into it. This change is necessary due to the type migration and is correctly implemented.
x/nft/nft.pb.go (7)
  • 9-9: The import alias for github.com/cosmos/gogoproto/types/any is correctly updated to reflect the new dependency version and the migration from types.Any to any.Any. This change is consistent with the PR objectives.
  • 41-41: The Data field in the Class struct has been correctly updated to use any.Any instead of types.Any. This change aligns with the PR's goal of migrating to the newer gogoproto/types/any package.
  • 119-119: The GetData method for the Class struct has been updated to return a pointer to any.Any. This change is consistent with the update to the Data field type and follows best practices for accessor methods in Go.
  • 137-137: The Data field in the NFT struct has been correctly updated to use any.Any instead of types.Any. This change is in line with the PR's objectives and ensures compatibility with the updated gogoproto dependency.
  • 201-201: The GetData method for the NFT struct has been updated to return a pointer to any.Any, consistent with the change to the Data field type. This update follows Go best practices for accessor methods.
  • 713-713: The instantiation of m.Data within the Unmarshal method for the Class struct correctly uses any.Any. This ensures that the unmarshaling process is compatible with the updated field type.
  • 927-927: Similarly, the instantiation of m.Data within the Unmarshal method for the NFT struct correctly uses any.Any. This change is necessary for the unmarshaling process to work with the updated Data field type.
x/authz/authz.pb.go (3)
  • 13-13: The import alias for any "github.com/cosmos/gogoproto/types/any" is correctly updated to reflect the new package path following the migration from types.Any to any.Any. This change is consistent with the PR's objective to update the gogoproto dependency and migrate to the newer any.Any type.
  • 76-76: The Authorization field in the Grant struct has been correctly updated to use any.Any instead of types.Any. This change aligns with the PR's objective of migrating to the newer any.Any type and ensures compatibility with the updated gogoproto dependency.
  • 121-121: Similarly, the Authorization field in the GrantAuthorization struct has been updated to use any.Any, consistent with the migration strategy outlined in the PR. This change is necessary for maintaining compatibility with the latest gogoproto standards and features.
x/evidence/types/query.pb.go (5)
  • 12-12: The import alias for github.com/cosmos/gogoproto/types/any is correctly updated to any, aligning with the migration from types.Any to gogoproto/types/any.Any.
  • 95-95: The type of Evidence in QueryEvidenceResponse struct has been correctly updated to *any.Any from types.Any. This change is consistent with the PR's objective of migrating to the newer gogoproto/types/any package.
  • 131-131: The getter method GetEvidence for QueryEvidenceResponse now correctly returns a pointer to any.Any, reflecting the updated type in the struct. This change is necessary for consistency with the updated field type.
  • 189-189: In QueryAllEvidenceResponse, the type of the Evidence slice has been correctly updated to []*any.Any from []*types.Any. This change aligns with the migration to gogoproto/types/any and affects the handling of evidence data in a list context.
  • 227-227: The getter method GetEvidence for QueryAllEvidenceResponse now correctly returns a slice of pointers to any.Any, reflecting the updated type in the struct. This change ensures consistency with the updated field type in a list context.
crypto/keyring/record.pb.go (3)
  • 10-10: The import alias for github.com/cosmos/gogoproto/types/any is correctly defined as any, aligning with Go best practices for readability and avoiding namespace conflicts.
  • 33-33: The PubKey field in the Record struct has been correctly updated to use any.Any from the gogoproto/types package. This change is consistent with the PR's objective to migrate from types.Any to gogoproto/types/any.
  • 149-149: Similarly, the PrivKey field in the Record_Local struct has been updated to use any.Any. This change aligns with the migration strategy and ensures consistency across the codebase.
x/auth/types/auth.pb.go (4)
  • 7-12: The import statements are correctly organized and include necessary packages for the protobuf definitions. Unused imports are appropriately suppressed using the blank identifier to avoid compilation errors.
  • 33-36: The struct definitions, including BaseAccount, ModuleAccount, ModuleCredential, and Params, are correctly defined with appropriate protobuf tags. Notably, the PubKey field in the BaseAccount struct has been updated to use any.Any from github.com/cosmos/gogoproto/types/any, aligning with the migration objectives.
  • 726-732: > 📝 NOTE

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

The generated methods for marshaling, unmarshaling, size calculation, and other operations are correctly implemented following the protobuf specification. These methods include necessary error handling and optimizations for efficient data processing.

  • 6-15: > 📝 NOTE

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

The overall structure and formatting of the file are well-organized and adhere to Go conventions. The separation between imports, struct definitions, and generated methods is clear, and the use of comments enhances readability.

testutil/testdata/query.pb.go (4)
  • 11-11: The import alias for github.com/cosmos/gogoproto/types/any is correctly updated to reflect the new dependency path. This change is consistent with the PR's objective of migrating to the newer gogoproto version.
  • 208-208: The TestAnyRequest struct has been updated to use *any.Any for the AnyAnimal field, aligning with the migration from types.Any to gogoproto/types/any. This change is crucial for ensuring compatibility with the updated gogoproto dependency.
  • 244-244: The GetAnyAnimal method correctly returns a pointer to any.Any, which is consistent with the updated field type in the TestAnyRequest struct. This ensures that the method's return type is aligned with the field's type.
  • 1157-1157: The unmarshalling logic for AnyAnimal within the TestAnyRequest struct has been correctly updated to instantiate a any.Any type. This change is necessary for the unmarshalling process to work with the updated gogoproto/types/any dependency.
x/upgrade/types/upgrade.pb.go (3)
  • 13-13: The import alias for github.com/cosmos/gogoproto/types/any is correctly defined as any, aligning with Go best practices for readability and avoiding namespace conflicts.
  • 55-55: The UpgradedClientState field in the Plan struct has been updated to use any.Any instead of types.Any. This change is consistent with the PR's objective to migrate to the newer gogoproto/types/any. However, it's marked as deprecated, which is appropriate if the intention is to discourage its use in favor of a new approach or structure. Ensure that this deprecation is communicated clearly in the project's documentation and migration guides.
  • 847-847: The instantiation of UpgradedClientState as &any.Any{} during unmarshalling is correct and ensures that the field is properly initialized before attempting to unmarshal data into it. This is a good practice to prevent nil pointer dereferences.
x/feegrant/feegrant.pb.go (4)
  • 15-15: The import alias for github.com/cosmos/gogoproto/types/any is correctly defined as any, aligning with Go best practices for readability and avoiding unnecessary verbosity in the code.
  • 184-184: The replacement of types1.Any with any.Any for the Allowance field in the AllowedMsgAllowance struct is correctly implemented. This change aligns with the PR's objective to migrate to the newer gogoproto/types/any package.
  • 229-229: Similarly, the replacement of types1.Any with any.Any for the Allowance field in the Grant struct is correctly implemented. This ensures consistency across the codebase and aligns with the updated gogoproto dependency.
  • 279-279: The method GetAllowance in the Grant struct correctly returns a pointer to an any.Any type. This method facilitates access to the Allowance field, adhering to Go best practices for encapsulation and type safety.
x/feegrant/tx.pb.go (3)
  • 14-14: The import alias for github.com/cosmos/gogoproto/types/any is correctly defined as any, which is concise and avoids naming conflicts. This change aligns with the migration from types.Any to any.Any.
  • 42-42: The Allowance field in the MsgGrantAllowance struct has been correctly updated to use any.Any from the gogoproto/types package. This change is necessary for the migration and ensures compatibility with the updated gogoproto version.
  • 92-92: The GetAllowance method correctly returns a pointer to an any.Any type, ensuring that the method's return type is consistent with the updated Allowance field type.
types/tx/signing/signing.pb.go (3)
  • 8-10: The addition of the import any "github.com/cosmos/gogoproto/types/any" correctly aligns with the PR's objective to migrate from types.Any to any.Any. This change is necessary for compatibility with the updated gogoproto types.
  • 155-155: The update of the PublicKey field type to any.Any from types.Any in the SignatureDescriptor struct correctly implements the necessary migration to the updated gogoproto types. This change is aligned with the PR objectives.
  • 364-364: The update of the Bitarray field type to types.CompactBitArray from types1.CompactBitArray in the SignatureDescriptor_Data_Multi struct correctly standardizes the usage of types within the codebase. This change improves readability and maintainability.
testutil/testdata/testdata.pb.go (7)
  • 10-10: The import alias for github.com/cosmos/gogoproto/types/any is correctly defined as any, aligning with the PR's objective to migrate from types.Any to gogoproto's any.Any.
  • 184-184: The replacement of types.Any with any.Any in the HasAnimal struct is correctly implemented, ensuring compatibility with the updated gogoproto types.
  • 221-221: The method GetAnimal in the HasAnimal struct correctly returns a pointer to any.Any, aligning with the migration to gogoproto's any.Any.
  • 236-236: The replacement of types.Any with any.Any in the HasHasAnimal struct is correctly implemented, ensuring compatibility with the updated gogoproto types.
  • 272-272: The method GetHasAnimal in the HasHasAnimal struct correctly returns a pointer to any.Any, aligning with the migration to gogoproto's any.Any.
  • 280-280: The replacement of types.Any with any.Any in the HasHasHasAnimal struct is correctly implemented, ensuring compatibility with the updated gogoproto types.
  • 316-316: The method GetHasHasAnimal in the HasHasHasAnimal struct correctly returns a pointer to any.Any, aligning with the migration to gogoproto's any.Any.
x/authz/tx.pb.go (2)
  • 15-15: The import statement for any "github.com/cosmos/gogoproto/types/any" correctly replaces the deprecated types.Any with any.Any. This change aligns with the PR's objective to migrate to the newer gogoproto/types/any.
  • 121-121: The Msgs field in the MsgExec struct has been updated to use any.Any from the gogoproto/types package instead of the deprecated types.Any. This change is consistent with the PR's goal of updating to gogoproto version v1.4.12 and migrating to the newer any.Any type.
x/gov/types/v1beta1/tx.pb.go (5)
  • 11-11: Renaming the package alias from types1 to types improves readability and consistency. Good change.
  • 17-17: Updating the import path to use any from gogoproto/types instead of codec/types aligns with the migration to the newer version of gogoproto. This change is necessary for compatibility with the updated dependency.
  • 41-41: The change from types.Any to any.Any for the Content field in MsgSubmitProposal is consistent with the migration to the newer gogoproto types. This update is crucial for ensuring that the serialization and deserialization processes work with the updated gogoproto version.
  • 1163-1163: The use of types.Coin in the InitialDeposit field remains unchanged. It's important to verify that the types.Coin definition is compatible with the updated gogoproto version and does not require migration to a new type. If types.Coin is defined in a file that also underwent changes due to the gogoproto update, ensure those changes are correctly applied.
  • 1754-1754: Similar to the previous comment, ensure that the types.Coin definition used in the Amount field of MsgDeposit is compatible with the updated gogoproto version. This verification is crucial for maintaining the integrity of the serialization and deserialization processes.
x/accounts/v1/tx.pb.go (11)
  • 16-16: The import any "github.com/cosmos/gogoproto/types/any" replaces the deprecated types.Any. This change aligns with the PR's objective to migrate to the newer gogoproto/types/any. Ensure that all references to types.Any are updated accordingly throughout the codebase.
  • 43-43: The replacement of types.Any with any.Any for the Message field in MsgInit struct is correctly implemented according to the PR's objectives. This change is crucial for compatibility with the updated gogoproto version.
  • 96-96: The getter method GetMessage for the MsgInit struct correctly returns a pointer to any.Any. This change is consistent with the migration to gogoproto/types/any.
  • 115-115: The replacement of types.Any with any.Any for the Response field in MsgInitResponse struct is correctly implemented. This aligns with the PR's goal of updating to the newer gogoproto/types/any.
  • 158-158: The getter method GetResponse for the MsgInitResponse struct correctly returns a pointer to any.Any, aligning with the migration to gogoproto/types/any.
  • 172-172: The replacement of types.Any with any.Any for the Message field in MsgExecute struct is correctly implemented, ensuring compatibility with the updated gogoproto version.
  • 225-225: The getter method GetMessage for the MsgExecute struct correctly returns a pointer to any.Any, consistent with the migration to gogoproto/types/any.
  • 242-242: The replacement of types.Any with any.Any for the Response field in MsgExecuteResponse struct is correctly implemented, aligning with the PR's objectives.
  • 278-278: The getter method GetResponse for the MsgExecuteResponse struct correctly returns a pointer to any.Any, consistent with the migration to gogoproto/types/any.
  • 343-343: The replacement of types.Any with any.Any for the ExecResponses field in BundledTxResponse struct is correctly implemented. This change is crucial for compatibility with the updated gogoproto version.
  • 380-380: The getter method GetExecResponses for the BundledTxResponse struct correctly returns a pointer to any.Any, aligning with the migration to gogoproto/types/any.
x/accounts/v1/query.pb.go (1)
  • 36-36: The migration from types.Any to *any.Any in struct fields is correctly implemented according to the PR objectives. Ensure that this change does not affect the serialization or deserialization of existing data, potentially requiring data migration or compatibility layers.

Also applies to: 79-79, 89-89, 125-125

x/accounts/defaults/lockup/types/tx.pb.go (4)
  • 16-16: The import alias any for github.com/cosmos/gogoproto/types/any is correctly introduced to replace types1.Any with any.Any. This change aligns with the PR's objective to migrate to the newer gogoproto/types/any.
  • 363-363: The replacement of types1.Any with any.Any in the MsgExecuteMessagesResponse struct is correctly implemented. This change is consistent with the migration strategy outlined in the PR objectives.
  • 399-399: The method GetResponses correctly returns a slice of *any.Any, aligning with the updated import and type usage. This ensures that the method's return type is consistent with the updated MsgExecuteMessagesResponse struct.
  • 6-19: > 📝 NOTE

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

Ensure that all other message types and methods in this file are unaffected by the types1.Any to any.Any migration and that they continue to function as expected. This includes serialization, deserialization, and any method logic that may indirectly interact with the changed types.

x/gov/types/v1beta1/gov.pb.go (2)
  • 16-16: The import alias for github.com/cosmos/gogoproto/types/any has been correctly updated to any from presumably types1 to reflect the new dependency version and usage. This change aligns with the PR objectives and improves readability by using a more intuitive alias.
  • 260-260: The replacement of types1.Any with any.Any in the Content field of the Proposal struct is correctly implemented. This change is consistent with the PR's objective to migrate from the deprecated codec/types/any to gogoproto/types/any, ensuring compatibility with the latest gogoproto features and standards.
types/abci.pb.go (7)
  • 8-12: The import aliases types and types1 are used to resolve package name conflicts. While this is automatically generated and functionally correct, it could potentially lead to confusion when reading the code. Consider renaming these imports in the protobuf definitions for clarity, if possible.
  • 56-56: The use of any.Any from the gogoproto/types/any package for the Tx field in TxResponse struct is noted. Ensure that all necessary migrations from types.Any to any.Any are completed across the codebase to maintain consistency and compatibility.
  • 67-67: The Events field in the TxResponse struct uses types.Event, which seems to be imported with an alias due to package name conflicts. It's important to ensure that the correct Event type is being used here, especially after the migration to any.Any. Double-check the protobuf definitions to confirm that the correct types are being referenced.
Verification successful

The verification process has confirmed that the Event type used in the TxResponse struct is indeed specified as tendermint.abci.Event in the protobuf definition, aligning with the expectations mentioned in the review comment. This ensures that the correct Event type is being referenced, especially after the migration to any.Any.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify that the correct Event type is being used in protobuf definitions.
rg --type proto 'Event'

Length of output: 53



Script:

#!/bin/bash
# Adjusting the search to explicitly target .proto files
rg 'Event' --glob '*.proto'

Length of output: 5613

* 335-335: The `Events` field in the `Result` struct also uses `types.Event`. Similar to the previous comment, verify that the migration to `any.Any` and the usage of package aliases do not affect the correct usage of the `Event` type across the codebase. * 339-339: The `MsgResponses` field in the `Result` struct uses `any.Any`. This is part of the migration to the newer `any.Any` type. Ensure that all message response types are correctly migrated and compatible with this change.
Verification successful

The verification process has confirmed that all instances of MsgResponses across the codebase have been correctly migrated to use any.Any or anypb.Any. This indicates a successful migration and compatibility with the change. No issues related to the migration were found in the provided context.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify that all message response types are correctly migrated to use any.Any.
rg --type go 'MsgResponses'

Length of output: 6727

* 483-483: Similar to the previous comment, the `MsgResponses` field in the `TxMsgData` struct uses `any.Any`. Verify that all necessary migrations and compatibility checks are performed for message response types. * 636-636: The `Blocks` field in the `SearchBlocksResult` struct uses `types1.Block`, indicating an import alias due to package name conflicts. Ensure that the correct `Block` type is being used and consider renaming imports in the protobuf definitions for clarity.
x/group/types.pb.go (3)
  • 13-13: The import any "github.com/cosmos/gogoproto/types/any" has been added to support the migration from types.Any to any.Any. Ensure that all references to types.Any have been updated to use any.Any accordingly.
  • 653-653: The DecisionPolicy field in the GroupPolicyInfo struct has been correctly updated to use any.Any from github.com/cosmos/gogoproto/types/any. This change aligns with the migration goal.
  • 732-732: The Messages field in the Proposal struct has been correctly updated to use any.Any from github.com/cosmos/gogoproto/types/any. This change is consistent with the migration from types.Any to any.Any.
x/staking/types/tx.pb.go (8)
  • 11-18: The import aliases for packages are not consistent with the Uber Go Style Guide, which recommends avoiding aliasing except in cases of conflict.

Consider removing unnecessary aliases for better readability and conformity to Go best practices.

  • 49-52: The use of omitempty JSON tag option for non-pointer fields of basic types or structs might lead to unexpected behavior when marshaling zero values. It's generally safe for pointer fields or slices where a nil value is meaningful.

Evaluate if the omitempty option is necessary for these fields, especially for DelegatorAddress and ValidatorAddress which are of type string, and Value which is a struct. Removing omitempty can ensure that zero values (e.g., empty strings) are correctly represented in the JSON output.

  • 210-212: Similar to the previous comment, reconsider the use of omitempty for fields DelegatorAddress, ValidatorAddress, and Amount in MsgDelegate. These fields are crucial for the message, and omitting them when empty might not be desirable.
  • 288-291: For MsgBeginRedelegate, the same advice regarding omitempty applies. Ensure that the decision to use omitempty aligns with the intended behavior for zero values of these fields.
  • 375-377: The omitempty JSON tag option is used for DelegatorAddress, ValidatorAddress, and Amount in MsgUndelegate. Consider the implications of omitting empty values in the JSON representation and adjust accordingly.
  • 419-419: The field Amount in MsgUndelegateResponse uses the omitempty JSON tag option. Given that this field represents a significant part of the response, carefully evaluate the need for omitting zero values.
  • 476-476: For MsgCancelUnbondingDelegation, the Amount field also uses omitempty. As this field is essential for understanding the operation being canceled, consider if omitting it when empty is appropriate.
  • 656-657: In MsgRotateConsPubKey, the omitempty JSON tag option is used for ValidatorAddress and NewPubkey. Given the critical nature of these fields for the message's purpose, ensure that omitting them when empty is the intended behavior.
x/auth/types/query.pb.go (9)
  • 14-14: The import alias any for github.com/cosmos/gogoproto/types/any is correctly updated to reflect the migration from types.Any to gogoproto's any.Any. This change aligns with the PR's objective of updating the gogoproto dependency and migrating to the newer any.Any type.
  • 88-88: The replacement of types.Any with any.Any in the QueryAccountsResponse struct is correctly implemented. This change is part of the migration to use the updated gogoproto types and is consistent with the PR's objectives.
  • 126-126: The getter method GetAccounts in QueryAccountsResponse now correctly returns a slice of *any.Any. This adjustment is necessary due to the change in the Accounts field type and ensures compatibility with the updated gogoproto types.
  • 182-182: The replacement of types.Any with any.Any in the QueryAccountResponse struct is correctly implemented. This change is part of the migration to use the updated gogoproto types and is consistent with the PR's objectives.
  • 218-218: The getter method GetAccount in QueryAccountResponse now correctly returns a *any.Any. This adjustment is necessary due to the change in the Account field type and ensures compatibility with the updated gogoproto types.
  • 351-351: The replacement of types.Any with any.Any in the QueryModuleAccountsResponse struct is correctly implemented. This change is part of the migration to use the updated gogoproto types and is consistent with the PR's objectives.
  • 387-387: The getter method GetAccounts in QueryModuleAccountsResponse now correctly returns a slice of *any.Any. This adjustment is necessary due to the change in the Accounts field type and ensures compatibility with the updated gogoproto types.
  • 441-441: The replacement of types.Any with any.Any in the QueryModuleAccountByNameResponse struct is correctly implemented. This change is part of the migration to use the updated gogoproto types and is consistent with the PR's objectives.
  • 477-477: The getter method GetAccount in QueryModuleAccountByNameResponse now correctly returns a *any.Any. This adjustment is necessary due to the change in the Account field type and ensures compatibility with the updated gogoproto types.
x/gov/types/v1/tx.pb.go (5)
  • 18-18: The import alias any is introduced for "github.com/cosmos/gogoproto/types/any". Consider using a more descriptive alias to avoid confusion with "google.golang.org/protobuf/types/known/anypb".
  • 45-45: The field Messages in MsgSubmitProposal struct is updated to use any.Any instead of types.Any. Ensure that all serialization and deserialization logic, as well as any usage of this field across the codebase, is updated accordingly to handle the new type.
  • 214-214: The field Content in MsgExecLegacyContent struct is updated to use any.Any instead of types.Any. Similar to the previous comment, ensure that all related logic is updated to work with any.Any.
  • 530-530: The Amount field in MsgDeposit struct remains unchanged, but it's important to verify that the serialization and deserialization logic for types.Coin is compatible with the updated gogoproto version.
  • 1102-1102: The Msg field in MsgSudoExec struct is updated to use any.Any instead of types.Any. Ensure compatibility and correct handling of this field across the codebase.
client/grpc/cmtservice/query.pb.go (5)
  • 3432-3432: The usage of any.Any from the gogoproto package for the PubKey field in the Validator struct is consistent with the migration from types.Any to gogoproto's any.Any as mentioned in the PR summary. This change is crucial for compatibility with the updated gogoproto types.
  • 3625-3625: The usage of types.BlockID for the BlockId field in the GetBlockByHeightResponse struct aligns with the cosmos-sdk's approach to handling blockchain data structures. This ensures that the block ID is correctly represented and utilized within the cosmos-sdk ecosystem.
  • 3661-3661: The usage of types.Block for the Block field in the GetBlockByHeightResponse struct is appropriate, as it ensures that the block data is correctly represented according to the cosmos-sdk's data structures. This is essential for the correct serialization and deserialization of block data.
  • 3833-3833: The usage of types.BlockID for the BlockId field in the GetLatestBlockResponse struct is consistent and correct, ensuring that the block ID is represented according to the cosmos-sdk's data structures. This consistency is crucial for the integrity of block data within the ecosystem.
  • 3869-3869: The usage of types.Block for the Block field in the GetLatestBlockResponse struct is correct, aligning with the cosmos-sdk's data structures for representing block data. This ensures that block data is serialized and deserialized correctly within the ecosystem.
x/gov/types/v1/gov.pb.go (2)
  • 14-14: The import of the any package has been updated to use github.com/cosmos/gogoproto/types/any instead of types1.Any. This change aligns with the PR's objective to migrate from the deprecated codec/types/any to the newer gogoproto/types/any.
  • 310-310: The Messages field in the Proposal struct has been correctly updated to use []*any.Any instead of []*types1.Any, following the migration to the new gogoproto/types/any package.
x/group/tx.pb.go (9)
  • 15-15: The import alias for github.com/cosmos/gogoproto/types/any as any is clear and follows good Go practices for readability and avoiding namespace conflicts. This change aligns with the PR's objective of migrating to the newer gogoproto/types/any.
  • 490-490: The change from types.Any to *any.Any for the DecisionPolicy field in MsgCreateGroupPolicy is correctly implemented. It's important to ensure that all related serialization, deserialization, and usage of this field are updated accordingly to handle the new type.
Verification successful

Given the findings, it appears that the change from types.Any to *any.Any for the DecisionPolicy field has been reflected in multiple places within the codebase, including both tx.pb.go and types.pb.go files. The initialization of DecisionPolicy with &any.Any{} in several locations suggests that updates have been made to accommodate the new pointer type. However, to conclusively verify that all related serialization and deserialization logic, as well as usage of this field, have been correctly updated, it would be beneficial to examine the context around these occurrences more closely.


The provided context from the script output confirms that the DecisionPolicy field's change to *any.Any has been integrated across various parts of the codebase, including in structures and methods related to serialization and deserialization. Specifically, the output shows:

  • The DecisionPolicy field is declared with the new type *any.Any in different message structures within tx.pb.go and types.pb.go.
  • There are instances where DecisionPolicy is being initialized with &any.Any{}, indicating that the code has been updated to handle the new pointer type correctly.
  • The Unmarshal method is called on DecisionPolicy, which is part of the deserialization process, further indicating that the necessary updates to handle the new type have been made.

These findings verify that the change from types.Any to *any.Any for the DecisionPolicy field in MsgCreateGroupPolicy and related structures has been correctly implemented, and the related serialization, deserialization, and usage of this field have been updated accordingly.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify that serialization and deserialization logic for DecisionPolicy has been updated.
rg 'DecisionPolicy.*any.Any' --type go

Length of output: 842



Script:

#!/bin/bash
# Extract context around occurrences of DecisionPolicy being updated to *any.Any
rg 'DecisionPolicy.*any.Any' --type go -C 5

Length of output: 5813

* 687-687: Similar to the previous comment, the update of the `DecisionPolicy` field in `MsgCreateGroupWithPolicy` to use `*any.Any` is correctly done. Ensure consistency in handling this type across the codebase.
Verification successful

The review comment regarding the update of the DecisionPolicy field in MsgCreateGroupWithPolicy to use *any.Any and ensuring consistency in handling this type across the codebase is supported by the evidence from the codebase. The search results confirm that DecisionPolicy *any.Any is consistently used and initialized across the x/group package, indicating a standard practice in handling this type.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Confirm consistent handling of DecisionPolicy across the codebase.
rg 'DecisionPolicy.*any.Any' --type go

Length of output: 842

* 785-785: Updating the `DecisionPolicy` field in `MsgUpdateGroupPolicyDecisionPolicy` to `*any.Any` is in line with the migration goals. Consistency in handling this type change is crucial for maintaining functionality.
Verification successful

The script output indicates that the DecisionPolicy field has been updated to type *any.Any in multiple instances within the x/group directory, suggesting a consistent migration effort. However, the script focused on finding instances of DecisionPolicy with type *any.Any and did not explicitly verify the absence of DecisionPolicy fields of other types. Based on the information available, it appears that the update is consistent with the migration goals, but complete verification of consistency across the entire codebase would require a more exhaustive search. Given the evidence, the review comment seems to be in line with the observed codebase changes.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Check for consistent updates to DecisionPolicy handling.
rg 'DecisionPolicy.*any.Any' --type go

Length of output: 842

* 973-973: The migration of the `Messages` field in proposals to a slice of `*any.Any` is a significant change. This affects how messages within proposals are serialized, deserialized, and processed. It's crucial to review related logic to ensure compatibility. * 4616-4616: The initialization of `DecisionPolicy` to `&any.Any{}` during unmarshalling is correct. This ensures that the field is ready for use even if not explicitly set in the incoming data. Review related logic to ensure seamless integration. * 5130-5130: The initialization of `DecisionPolicy` to `&any.Any{}` in another unmarshalling context is consistent with the previous comment. This consistency is key to ensuring reliable data handling. * 5381-5381: Again, initializing `DecisionPolicy` to `&any.Any{}` during unmarshalling is correctly applied, maintaining consistency across different parts of the codebase. * 5808-5808: Appending a new `&any.Any{}` to `Messages` and then unmarshalling into it is a correct approach for handling dynamic message types in proposals. Ensure that all logic processing these messages accounts for the new type.
x/staking/types/staking.pb.go (13)
  • 11-21: The import alias changes from types2, types, and types1 to a more consistent naming convention are good for clarity. However, ensure that these changes are consistently applied across the entire codebase to avoid confusion or errors due to the renaming.
  • 419-419: Changing the ConsensusPubkey field type from types1.Any to any.Any aligns with the migration to the updated gogoproto types. This is a crucial update for compatibility with the latest gogoproto features. Ensure that all related serialization and deserialization logic is updated accordingly.
  • 1003-1003: The update of KeyRotationFee field type to types1.Coin is consistent with the renaming strategy. Ensure that the types1.Coin type is correctly defined and that all references to KeyRotationFee are updated to reflect this change.
  • 1074-1078: The addition of the GetKeyRotationFee method is a good practice for encapsulating the access to struct fields. Ensure that this method is used consistently wherever KeyRotationFee needs to be accessed.
  • 1085-1085: The Balance field in DelegationResponse being updated to types1.Coin is consistent with the changes made elsewhere in the code. This ensures type consistency across the codebase.
  • 1128-1132: The GetBalance method addition for DelegationResponse is consistent with best practices for data encapsulation. Ensure that this method is utilized wherever Balance needs to be accessed.
  • 1281-1281: The update in ValidatorUpdates to use types2.ValidatorUpdate for the Updates field is part of the renaming strategy. Verify that types2.ValidatorUpdate is correctly defined and that all instances of ValidatorUpdates are updated accordingly.
  • 1317-1317: The GetUpdates method in ValidatorUpdates is a good addition for encapsulating the access to the Updates field. Ensure consistency in using this method across the codebase.
  • 1329-1335: The changes in ConsPubKeyRotationHistory, including the update of OldConsPubkey and NewConsPubkey to any.Any and Fee to types1.Coin, are aligned with the migration to updated gogoproto types and renaming strategy. Ensure that all related logic is updated to reflect these changes.
  • 5174-5174: Initializing ConsensusPubkey with &any.Any{} before unmarshalling is a necessary change due to the type update. Ensure that error handling and unmarshalling logic are correctly implemented to handle potential issues.
  • 7722-7722: Appending a new types2.ValidatorUpdate to m.Updates before unmarshalling is consistent with the changes made to ValidatorUpdates. Ensure that the unmarshalling logic is correctly implemented and tested.
  • 7841-7841: Initializing OldConsPubkey with &any.Any{} before unmarshalling is necessary due to the type update. Verify that the unmarshalling logic is correctly implemented and tested for potential issues.
  • 7877-7877: Initializing NewConsPubkey with &any.Any{} before unmarshalling is consistent with the type update. Ensure that the unmarshalling logic is correctly implemented and tested for potential issues.
testutil/testdata/unknonwnproto.pb.go (8)
  • 12-12: The import alias for github.com/cosmos/gogoproto/types/any as any is correctly updated to reflect the migration from types.Any to any.Any. This change is consistent with the PR's objective of updating to gogoproto version v1.4.12.
  • 138-138: The replacement of types.Any with any.Any for the Miscellaneous field in the Customer2 struct is correctly implemented. This change aligns with the PR's goal of migrating to the newer gogoproto/types/any.
  • 216-216: The method GetMiscellaneous correctly returns a pointer to any.Any, reflecting the updated type for the Miscellaneous field in the Customer2 struct. This change is consistent with the migration to gogoproto/types/any.
  • 856-856: The addition of the G field of type *any.Any in various structs like TestVersion1, TestVersion2, TestVersion3, etc., is consistent with the PR's objective. Ensure that all references and usages of these structs are updated accordingly to handle the new field type.
  • 968-968: The method GetG correctly returns a pointer to any.Any for the TestVersion1 struct. This change is consistent across various versions and types, reflecting the migration to gogoproto/types/any.
  • 6809-6811: The unmarshalling logic for the Miscellaneous field in various structs has been correctly updated to instantiate an any.Any type before unmarshalling. This change is necessary due to the migration from types.Any to any.Any.
  • 12546-12552: > 📝 NOTE

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

The logic for appending and unmarshalling *any.Any types to the Messages slice in the TestUpdatedTxBody struct is correctly implemented. This change supports the migration to gogoproto/types/any and ensures that the serialization and deserialization processes are aligned with the updated dependency.

  • 12716-12722: > 📝 NOTE

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

Similarly, the logic for appending and unmarshalling *any.Any types to the NonCriticalExtensionOptions slice in the TestUpdatedTxBody struct is correctly implemented. This ensures compatibility with the updated gogoproto types and maintains the integrity of the serialization and deserialization processes.

github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types"
types1 "github.com/cosmos/cosmos-sdk/types"
types "github.com/cosmos/cosmos-sdk/types"
Copy link
Contributor

Choose a reason for hiding this comment

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

The import alias types is redeclared. This is redundant and can be removed to clean up the code.

-	types "github.com/cosmos/cosmos-sdk/types"

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
types "github.com/cosmos/cosmos-sdk/types"

Comment on lines +9 to +16
types "github.com/cosmos/cosmos-sdk/crypto/types"
github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types"
types2 "github.com/cosmos/cosmos-sdk/types"
types1 "github.com/cosmos/cosmos-sdk/types"
_ "github.com/cosmos/cosmos-sdk/types/tx/amino"
signing "github.com/cosmos/cosmos-sdk/types/tx/signing"
_ "github.com/cosmos/gogoproto/gogoproto"
proto "github.com/cosmos/gogoproto/proto"
any "github.com/cosmos/gogoproto/types/any"
Copy link
Contributor

Choose a reason for hiding this comment

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

The import alias types1 for "github.com/cosmos/cosmos-sdk/types" on line 11 seems to be a leftover from a previous version of the code where there might have been multiple types packages imported. Given that there's only one types package imported now (aliased as types on line 9), the alias types1 is unnecessary and could potentially cause confusion.

-	types1 "github.com/cosmos/cosmos-sdk/types"

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
types "github.com/cosmos/cosmos-sdk/crypto/types"
github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types"
types2 "github.com/cosmos/cosmos-sdk/types"
types1 "github.com/cosmos/cosmos-sdk/types"
_ "github.com/cosmos/cosmos-sdk/types/tx/amino"
signing "github.com/cosmos/cosmos-sdk/types/tx/signing"
_ "github.com/cosmos/gogoproto/gogoproto"
proto "github.com/cosmos/gogoproto/proto"
any "github.com/cosmos/gogoproto/types/any"
types "github.com/cosmos/cosmos-sdk/crypto/types"
github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types"
_ "github.com/cosmos/cosmos-sdk/types/tx/amino"
signing "github.com/cosmos/cosmos-sdk/types/tx/signing"
_ "github.com/cosmos/gogoproto/gogoproto"
proto "github.com/cosmos/gogoproto/proto"
any "github.com/cosmos/gogoproto/types/any"

github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types"
types1 "github.com/cosmos/cosmos-sdk/types"
types "github.com/cosmos/cosmos-sdk/types"
Copy link
Contributor

Choose a reason for hiding this comment

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

The import alias types is declared but not used in the visible code. If it's truly unused, it should be removed to keep the code clean and to follow Go best practices.

-	types "github.com/cosmos/cosmos-sdk/types"

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
types "github.com/cosmos/cosmos-sdk/types"

@@ -2,7 +2,7 @@ version: v1
plugins:
- name: gocosmos
out: ..
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any
Copy link
Contributor

Choose a reason for hiding this comment

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

Tip

Codebase Verification

The verification process revealed that the URL provided in the code change redirects from the 'master' branch to the 'main' branch, indicating that the URL is outdated. It's important to update the path to use the 'main' branch to ensure accuracy and alignment with current repository standards. The file is accessible, but the path correction is necessary.

Analysis chain

The update to the gocosmos plugin option here is consistent with the overarching goals of the PR. Ensure the new path's correctness and compatibility.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify the new path is accessible and compatible
curl -I https://github.com/cosmos/gogoproto/blob/master/types/any.proto

Length of output: 4498

@@ -2,7 +2,7 @@ version: v1
plugins:
- name: gocosmos
out: ..
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any
Copy link
Contributor

Choose a reason for hiding this comment

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

Tip

Codebase Verification

The attempt to verify the new path's accessibility resulted in a HTTP 404 response, indicating that the file at https://github.com/cosmos/gogoproto/blob/main/types/any.proto does not exist. This suggests that the updated path in the PR might be incorrect or the file has been moved or deleted from the specified location.

Analysis chain

The update to the gocosmos plugin option is consistent with the PR's objectives. Ensure the new path's correctness and compatibility.


Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify the new path is accessible and compatible
curl -I https://github.com/cosmos/gogoproto/blob/master/types/any.proto

Length of output: 4493



Script:

#!/bin/bash
# Verify the redirected path is accessible
curl -I https://github.com/cosmos/gogoproto/blob/main/types/any.proto

Length of output: 4469

Copy link
Member

@julienrbrt julienrbrt left a comment

Choose a reason for hiding this comment

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

Some alias are missing. Can we get a quick changelog as well or go doc on the alias that explains the reason

x/nft/proto/buf.gen.gogo.yaml Show resolved Hide resolved
codec/types/any.go Outdated Show resolved Hide resolved
codec/types/compat.go Show resolved Hide resolved
codec/types/compat.go Show resolved Hide resolved
@julienrbrt julienrbrt changed the title chore: bump gogoproto refactor: bump gogoproto Mar 28, 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.

Review Status

Actionable comments generated: 0

Configuration used: .coderabbit.yml

Commits Files that changed from the base of the PR and between 50271e5 and 3e3106b.
Files selected for processing (1)
  • codec/types/any.go (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • codec/types/any.go

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: 0

Configuration used: .coderabbit.yml

Commits Files that changed from the base of the PR and between 3e3106b and bca3e7c.
Files selected for processing (1)
  • CHANGELOG.md (1 hunks)
Path instructions used (1)
CHANGELOG.md (1)

**/*.md
Assess the documentation for misspellings, grammatical errors, missing documentation and correctness

Additional comments (2)
CHANGELOG.md (2)
  • 62-62: The documentation of the change related to PR refactor: bump gogoproto #19869 in the CHANGELOG.md is clear and accurately reflects the modifications made in the PR. This entry helps in tracking the significant change regarding the Any type replacement.
  • 62-62: The documentation of the enhancements related to PR feat(server): add custom start handler #19854 in the CHANGELOG.md is detailed and provides a clear understanding of the new customizability features added to the start command. This entry is well-documented and contributes to the transparency of changes made in the cosmos-sdk.

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: 0

Configuration used: .coderabbit.yml

Commits Files that changed from the base of the PR and between bca3e7c and 8e6571b.
Files selected for processing (1)
  • codec/types/types_test.go (7 hunks)
Files skipped from review as they are similar to previous changes (1)
  • codec/types/types_test.go

@@ -2,4 +2,4 @@ version: v1
plugins:
- name: gocosmos
out: ../..
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any
Copy link
Member

Choose a reason for hiding this comment

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

wanted to double check this is optional correct? chains dont have to do this as part of their upgrade?

Copy link
Contributor Author

@raynaudoe raynaudoe Mar 28, 2024

Choose a reason for hiding this comment

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

it is optional bc all public types are aliased, but could be a good idea to use the gogoproto path to not 'depend' on sdk types. But if is ok to use one or the other, I can clarify in the UPGRADING.md that this is indeed optional

Copy link
Member

Choose a reason for hiding this comment

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

amazing, thank you!!

// returns an error if that value couldn't be packed. This also caches
// the packed value so that it can be retrieved from GetCachedValue without
// unmarshaling
func NewAnyWithValue(v proto.Message) (*Any, error) {
Copy link
Member

Choose a reason for hiding this comment

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

do we want to alias this as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep, the alias is here

var NewAnyWithValue = gogoproto.NewAnyWithCacheWithValue

where NewAnyWithCacheWithValue is in fact the previous NewAnyWithValue

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: 1

Configuration used: .coderabbit.yml

Commits Files that changed from the base of the PR and between 8e6571b and cccdb50.
Files selected for processing (1)
  • UPGRADING.md (1 hunks)
Path instructions used (1)
UPGRADING.md (1)

**/*.md
Assess the documentation for misspellings, grammatical errors, missing documentation and correctness

Comment on lines +443 to +444
Due to the `Any` type moving to the `github.com/cosmos/gogoproto/types/any` repository, module developers must update the `buf.gen.gogo.yaml` configuration files by adjusting the corresponding `opt` option to `Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any` for correct mapping to the new `Any` type location.

Copy link
Contributor

Choose a reason for hiding this comment

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

Due to the Any type moving to the github.com/cosmos/gogoproto/types/any repository, module developers must update the buf.gen.gogo.yaml configuration files by adjusting the corresponding opt option to Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any for correct mapping to the new Any type location.

- Mgoogle/protobuf/any.proto=github.com/gogo/protobuf/types
+ Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
Due to the `Any` type moving to the `github.com/cosmos/gogoproto/types/any` repository, module developers must update the `buf.gen.gogo.yaml` configuration files by adjusting the corresponding `opt` option to `Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any` for correct mapping to the new `Any` type location.
Due to the `Any` type moving to the `github.com/cosmos/gogoproto/types/any` repository, module developers must update the `buf.gen.gogo.yaml` configuration files by adjusting the corresponding `opt` option to `Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any` for correct mapping to the new `Any` type location.

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.

one less sdk import to worry about thank you!!

Copy link
Member

@julienrbrt julienrbrt left a comment

Choose a reason for hiding this comment

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

Wohoo!

@julienrbrt julienrbrt added this pull request to the merge queue Mar 28, 2024
@@ -440,6 +440,9 @@ With the deprecation of the Amino JSON codec defined in [cosmos/gogoproto](https

For core SDK types equivalence is asserted by generative testing of [SignableTypes](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-beta.0/tests/integration/rapidgen/rapidgen.go#L102) in [TestAminoJSON_Equivalence](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-beta.0/tests/integration/tx/aminojson/aminojson_test.go#L94).

Due to the `Any` type moving to the `github.com/cosmos/gogoproto/types/any` repository, module developers must update the `buf.gen.gogo.yaml` configuration files by adjusting the corresponding `opt` option to `Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any` for correct mapping to the new `Any` type location.
Copy link
Member

@julienrbrt julienrbrt Mar 28, 2024

Choose a reason for hiding this comment

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

This is at the wrong place, should be https://github.com/cosmos/cosmos-sdk/blob/main/UPGRADING.md#protobuf. And they don't have to, we should clarify it is optional but recommended (one less sdk import)

Merged via the queue into main with commit b9c8d60 Mar 28, 2024
84 of 85 checks passed
@julienrbrt julienrbrt deleted the eze/bump_gogoproto branch March 28, 2024 19:57
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.

[Feature]: move codectypes.Any
3 participants