-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
feat(x/bank): Allow value with slashes in DenomMetadata #22543
base: main
Are you sure you want to change the base?
feat(x/bank): Allow value with slashes in DenomMetadata #22543
Conversation
📝 Walkthrough📝 WalkthroughWalkthroughThe pull request updates the Cosmos SDK's changelog and modifies the Changes
Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
📜 Recent review detailsConfiguration used: .coderabbit.yml ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (3)
🔥 Files not summarized due to errors (1)
🚧 Files skipped from review as they are similar to previous changes (2)
🧰 Additional context used📓 Path-based instructions (1)api/cosmos/bank/v1beta1/query.pulsar.go (1)Pattern 🔇 Additional comments (3)api/cosmos/bank/v1beta1/query.pulsar.go (3)
The updated DenomMetadata endpoint now correctly supports denoms with slashes using the
The DenomOwners endpoint has been updated to use the same
Consider removing the redundant DenomMetadataByQueryString endpoint. This endpoint serves the same purpose as the DenomMetadata endpoint, which now supports denoms with slashes. Having two endpoints for the same functionality increases maintenance overhead and could lead to confusion. Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
bdde8a4
to
b6ab249
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (5)
x/bank/CHANGELOG.md (2)
46-46
: Enhance the bug fix description for better clarity.The current entry could be more descriptive. Consider expanding it to:
-* [#22543](https://github.com/cosmos/cosmos-sdk/pull/22543) Fix `DenomMetadata` rpc allow value with slashes +* [#22543](https://github.com/cosmos/cosmos-sdk/pull/22543) Fix `DenomMetadata` RPC to properly handle denom values containing slashes (e.g., ibc/xxx). Fixes #22542
59-59
: Add context to the API breaking change.The current entry should explain the rationale for removing the RPC. Consider expanding it to:
-* [#22543](https://github.com/cosmos/cosmos-sdk/pull/22543) Drop `DenomMetadataByQueryString` rpc +* [#22543](https://github.com/cosmos/cosmos-sdk/pull/22543) Remove redundant `DenomMetadataByQueryString` RPC as its functionality is now handled by the improved `DenomMetadata` RPCCHANGELOG.md (3)
Line range hint
1-1
: Add version table at the top of changelogConsider adding a version table at the top of the changelog that summarizes all versions with their release dates and major highlights. This would make it easier for users to quickly navigate to relevant versions.
Line range hint
13-13
: Standardize version date formatsThe date formats are inconsistent across versions. Some use YYYY-MM-DD format while others use Month DD, YYYY. Standardize all dates to use YYYY-MM-DD format for consistency.
Also applies to: 1124-1124
Line range hint
1124-1126
: Add missing version numbers in Previous Releases sectionThe "Previous Releases" section should list the version numbers that are included in the linked changelog, rather than just linking to "previous versions".
📜 Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
📥 Commits
Reviewing files that changed from the base of the PR and between fbd725d and b6ab249f59b78f6bd3401fdc450059764bd14478.
⛔ Files ignored due to path filters (3)
api/cosmos/bank/v1beta1/query_grpc.pb.go
is excluded by!**/*.pb.go
x/bank/types/query.pb.go
is excluded by!**/*.pb.go
x/bank/types/query.pb.gw.go
is excluded by!**/*.pb.gw.go
📒 Files selected for processing (5)
CHANGELOG.md
(1 hunks)x/bank/CHANGELOG.md
(2 hunks)x/bank/keeper/grpc_query.go
(0 hunks)x/bank/keeper/grpc_query_test.go
(0 hunks)x/bank/proto/cosmos/bank/v1beta1/query.proto
(2 hunks)
💤 Files with no reviewable changes (2)
- x/bank/keeper/grpc_query.go
- x/bank/keeper/grpc_query_test.go
🧰 Additional context used
📓 Path-based instructions (2)
CHANGELOG.md (1)
Pattern **/*.md
: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"
x/bank/CHANGELOG.md (1)
Pattern **/*.md
: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"
🔇 Additional comments (3)
x/bank/proto/cosmos/bank/v1beta1/query.proto (2)
80-80
: LGTM: DenomMetadata path now supports slashes
The updated path parameter syntax {denom=**}
correctly enables querying denoms containing slashes (e.g., "ibc/abc"), fixing the issue described in #22542.
98-98
: LGTM: Consistent path parameter handling for DenomOwners
Good consistency improvement by applying the same {denom=**}
syntax to the DenomOwners endpoint, ensuring uniform handling of denom values containing slashes.
CHANGELOG.md (1)
Line range hint 15-1123
: LGTM on changelog content and organization
The changelog content is well organized by version and properly categorizes changes into Features, Improvements, Bug Fixes, and Breaking Changes. The descriptions are clear and provide good detail about the changes made.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (5)
x/bank/CHANGELOG.md (1)
46-46
: Enhance the bug fix description with more context.The current description "Fix
DenomMetadata
rpc allow value with slashes" could be more descriptive. Consider expanding it to:-* [#22543](https://github.com/cosmos/cosmos-sdk/pull/22543) Fix `DenomMetadata` rpc allow value with slashes +* [#22543](https://github.com/cosmos/cosmos-sdk/pull/22543) Fix `DenomMetadata` RPC to properly handle denom values containing slashes (e.g., ibc/... or tokenfactory/...). This issue affected SDK versions 0.47, 0.50, and main.x/bank/proto/cosmos/bank/v1beta1/query.proto (1)
80-80
: LGTM! Good solution for handling denoms with slashesThe updated HTTP routing pattern using
{denom=**}
is an elegant solution that allows the DenomMetadata endpoint to support denoms containing slashes (e.g., ibc/tokenfactory denoms) while maintaining a clean API design.This change eliminates the need for a separate query endpoint, reducing API complexity and improving maintainability.
CHANGELOG.md (3)
Line range hint
1-1
: Add title to the changelog fileThe file should start with a clear title like "# Changelog" to follow standard changelog conventions.
+ # Changelog
Line range hint
12-15
: Improve version header formattingThe version header should include a release date in a consistent format. The current format varies between versions.
- ## [v0.47.16](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.47.16) - 2024-09-20 + ## [v0.47.16](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.47.16) - 2024-09-20
Line range hint
785-790
: Fix inconsistent section headersThe "Bug Fixes" section uses different header styles across versions (### vs ##). Standardize the header levels.
- ### Bug Fixes + ## Bug Fixes
📜 Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
⛔ Files ignored due to path filters (3)
api/cosmos/bank/v1beta1/query_grpc.pb.go
is excluded by!**/*.pb.go
x/bank/types/query.pb.go
is excluded by!**/*.pb.go
x/bank/types/query.pb.gw.go
is excluded by!**/*.pb.gw.go
📒 Files selected for processing (5)
CHANGELOG.md
(1 hunks)x/bank/CHANGELOG.md
(2 hunks)x/bank/keeper/grpc_query.go
(0 hunks)x/bank/keeper/grpc_query_test.go
(0 hunks)x/bank/proto/cosmos/bank/v1beta1/query.proto
(2 hunks)
💤 Files with no reviewable changes (2)
- x/bank/keeper/grpc_query.go
- x/bank/keeper/grpc_query_test.go
🧰 Additional context used
📓 Path-based instructions (2)
CHANGELOG.md (1)
Pattern **/*.md
: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"
x/bank/CHANGELOG.md (1)
Pattern **/*.md
: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"
🔇 Additional comments (2)
x/bank/proto/cosmos/bank/v1beta1/query.proto (1)
98-98
: LGTM! Consistent handling of denoms with slashes
Good catch on applying the same pattern to the DenomOwners endpoint. This maintains consistency across the API for handling denoms with slashes.
CHANGELOG.md (1)
Line range hint 1-2000
: LGTM for remaining content
The rest of the changelog content is well-structured and provides clear, detailed information about changes in each version. The categorization of changes (Features, Improvements, Bug Fixes, etc.) is consistent and helpful.
x/bank/CHANGELOG.md
Outdated
@@ -55,6 +56,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ | |||
* [#19477](https://github.com/cosmos/cosmos-sdk/pull/19477) `appmodule.Environment` is passed to bank `NewKeeper` | |||
* [#19627](https://github.com/cosmos/cosmos-sdk/pull/19627) The genesis api has been updated to match `appmodule.HasGenesis`. | |||
* [#19740](https://github.com/cosmos/cosmos-sdk/pull/19740) `InitGenesis` and `ExportGenesis` module code and keeper code do not panic but return errors. | |||
* [#22543](https://github.com/cosmos/cosmos-sdk/pull/22543) Drop `DenomMetadataByQueryString` rpc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Add migration guidance for the removed RPC.
The removal of DenomMetadataByQueryString
RPC is a breaking change that requires migration guidance. Consider expanding the entry to:
-* [#22543](https://github.com/cosmos/cosmos-sdk/pull/22543) Drop `DenomMetadataByQueryString` rpc
+* [#22543](https://github.com/cosmos/cosmos-sdk/pull/22543) Remove `DenomMetadataByQueryString` RPC as its functionality is now supported by the enhanced `DenomMetadata` RPC. Users should migrate to using `DenomMetadata` RPC which now properly handles denom values containing slashes.
📝 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. Thoroughly test & benchmark the code to ensure it meets the requirements.
* [#22543](https://github.com/cosmos/cosmos-sdk/pull/22543) Drop `DenomMetadataByQueryString` rpc | |
* [#22543](https://github.com/cosmos/cosmos-sdk/pull/22543) Remove `DenomMetadataByQueryString` RPC as its functionality is now supported by the enhanced `DenomMetadata` RPC. Users should migrate to using `DenomMetadata` RPC which now properly handles denom values containing slashes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey! We should strive to not do client breaking changes, please bring back the query.
@@ -77,15 +77,9 @@ service Query { | |||
// DenomMetadata queries the client metadata of a given coin denomination. | |||
rpc DenomMetadata(QueryDenomMetadataRequest) returns (QueryDenomMetadataResponse) { | |||
option (cosmos.query.v1.module_query_safe) = true; | |||
option (google.api.http).get = "/cosmos/bank/v1beta1/denoms_metadata/{denom}"; | |||
option (google.api.http).get = "/cosmos/bank/v1beta1/denoms_metadata/{denom=**}"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL, that's pretty cool, could you do that for all applicable queries?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked into it, and it seems that except for the endpoint, there is no case where a slash comes in the path parameter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, thanks!
Hmm.. reducing breaking changes is important, but these two rpc's seem to do exactly the same thing. Do you still want to keep them both? |
Yes please, it has no cost to keep them both. |
b6ab249
to
b2e0396
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (3)
CHANGELOG.md (3)
Line range hint
1-1
: Add title to changelog fileThe changelog file should start with a clear title like "# Changelog" to follow standard documentation practices.
+ # Changelog
Line range hint
14-20
: Improve version header formatting consistencyThe version headers should follow a consistent format. Some headers have dates in parentheses while others use hyphens. Standardize on one format.
- ## [v0.47.14](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.47.14) - 2024-09-20 + ## [v0.47.14](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.47.14) (2024-09-20)
Line range hint
1-2000
: Add table of contentsFor better navigation in such a large changelog, consider adding a table of contents at the beginning that links to major versions.
📜 Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
📒 Files selected for processing (2)
CHANGELOG.md
(1 hunks)x/bank/CHANGELOG.md
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- x/bank/CHANGELOG.md
🧰 Additional context used
📓 Path-based instructions (1)
CHANGELOG.md (1)
Pattern **/*.md
: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"
🔇 Additional comments (1)
CHANGELOG.md (1)
Line range hint 1-2000
: Verify future dates
The changelog contains entries dated in the future (e.g. November 2024). These should be marked as unreleased or have their dates adjusted.
Okay, I removed that commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, please fix failing test-system
CI check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK, thanks! Just one more change and we'll merge and backport
CHANGELOG.md
Outdated
@@ -52,9 +52,11 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i | |||
|
|||
* (sims) [#21906](https://github.com/cosmos/cosmos-sdk/pull/21906) Skip sims test when running dry on validators | |||
* (cli) [#21919](https://github.com/cosmos/cosmos-sdk/pull/21919) Query address-by-acc-num by account_id instead of id. | |||
* (bank) [#22543](https://github.com/cosmos/cosmos-sdk/pull/22543) Fix `DenomMetadata` rpc allow value with slashes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you delete this changelog entry?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
b2e0396
to
e97e236
Compare
e97e236
to
90bd3e5
Compare
Description
Closes: #22542
DenomMetadata does not work properly with slash.
Because of this, we have two RPCs that do the same thing. #16852
The solution to this has already been discussed below. cosmos/ibc-go#3045
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.
!
in the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
Please see Pull Request Reviewer section in the contributing guide for more information on how to review a pull request.
I have...
Summary by CodeRabbit
New Features
MsgBurn
, for burning coins.resolve_denom
field to enhance balance queries.Improvements
DenomMetadata
andDenomOwners
RPC methods to support wildcard matching.Bug Fixes
Breaking Changes
DenomMetadataByQueryString
RPC and updated several method signatures for better clarity.