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

feat: add debug cmd for application codec types #18219

Merged
merged 1 commit into from
Oct 23, 2023

Conversation

damiannolan
Copy link
Member

@damiannolan damiannolan commented Oct 23, 2023

Description

Adds a debug cmd for the app codec.

  • List interfaces
  • List implementations

List interfaces usage:

> simd debug codec list-interfaces

cosmos.auth.v1.ModuleCredential
cosmos.group.v1.DecisionPolicy
cosmos.evidence.v1beta1.Evidence
cosmos.tx.v1beta1.MsgResponse
cosmos.auth.v1beta1.GenesisAccount
cosmos.vesting.v1beta1.VestingAccount
cosmos.feegrant.v1beta1.FeeAllowanceI
cosmos.authz.v1beta1.Authorization
cosmos.base.v1beta1.Msg
cosmos.tx.v1beta1.Tx
cosmos.crypto.PubKey
cosmos.crypto.PrivKey
cosmos.auth.v1beta1.AccountI
cosmos.tx.v1beta1.TxExtensionOptionI
cosmos.gov.v1beta1.Content

List implemenations usage:

> simd debug codec list-implementations cosmos.crypto.PubKey

/cosmos.auth.v1beta1.ModuleCredential
/cosmos.crypto.ed25519.PubKey
/cosmos.crypto.secp256k1.PubKey
/cosmos.crypto.multisig.LegacyAminoPubKey
/cosmos.crypto.secp256r1.PubKey

Closes: #XXXX (didn't open an issue, soz)


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
  • added ! to 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
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • run make lint and make test
  • 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 ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

Summary by CodeRabbit

  • New Feature: Introduced a new debugging command, CodecCmd(). This enhancement provides users with two new subcommands: list-interfaces and list-implementations. The list-interfaces command allows users to view all registered interface type URLs, while the list-implementations command displays the registered type URLs for a given interface name. This update improves the debugging process by providing more detailed information about the application codec, enhancing the user's ability to troubleshoot and understand the system's inner workings.

@damiannolan damiannolan requested a review from a team as a code owner October 23, 2023 14:05
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 23, 2023

Walkthrough

The primary change in this pull request is the addition of a new debugging command, CodecCmd(), to the Cmd() function. This command enhances the debugging capabilities of the application by providing detailed information about the registered interface type URLs and their implementations.

Changes

File Summary
client/debug/main.go Added CodecCmd() to Cmd(). This new command provides two subcommands: list-interfaces and list-implementations for debugging the application codec.

🐇

In the land of code, where the debuggers play,

A new command was born, to brighten the day.

list-interfaces, list-implementations it can say,

Making debugging easier, in a rabbit's own way. 🎉


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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 help to get help.

Note: For conversation with the bot, please use the review comments on code diffs or files.

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

@github-prbot github-prbot requested review from a team, facundomedica and atheeshp and removed request for a team October 23, 2023 14:05
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 UI

Commits Files that changed from the base of the PR and between 19eaac3 and bbcd6df.
Files selected for processing (1)
  • client/debug/main.go (2 hunks)
Files skipped from review due to trivial changes (1)
  • client/debug/main.go

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.

lgtm, definitely useful thank you!
Added the backport v0.50.1 label (as 0.50 is feature frozen) and we can backport to v0.47.x as well after 0.50.0 is released.

@julienrbrt
Copy link
Member

One thing to note, is that displays the interface registry from the client.Context. Which should normally be the same as the server (app.go), but could differ if someone didn't wire their root.go properly.

@julienrbrt julienrbrt added this pull request to the merge queue Oct 23, 2023
Merged via the queue into main with commit 3c9168d Oct 23, 2023
44 of 53 checks passed
@julienrbrt julienrbrt deleted the damian/add-codec-debug-cmd branch October 23, 2023 15:00
Copy link
Member

Choose a reason for hiding this comment

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

Reminder to myself, when calling mergify after v0.50.0 tag, add this change as well: https://github.com/cosmos/cosmos-sdk/pull/18309/files#diff-138125b0bd1d362882611450341f8ca83ca00dcc7473a3b13a792fc2a146cf78R89

@julienrbrt
Copy link
Member

@Mergifyio backport release/v0.50.x

Copy link
Contributor

mergify bot commented Nov 10, 2023

backport release/v0.50.x

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Nov 10, 2023
julienrbrt added a commit that referenced this pull request Nov 10, 2023
…8433)

Co-authored-by: Damian Nolan <damiannolan@gmail.com>
Co-authored-by: Julien Robert <julien@rbrt.fr>
@faddat faddat mentioned this pull request Nov 8, 2024
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants