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(client/v2): support consensus address decoding #16927

Merged
merged 4 commits into from
Jul 14, 2023

Conversation

julienrbrt
Copy link
Member

@julienrbrt julienrbrt commented Jul 11, 2023

Description

Found while working on #16659.
Currently, consensus address or pubkey aren't supported by client/v2.

For instance, in the CLI of slashing the following command is currently supported:

$ simd q slashing signing-info '{"@type":"/cosmos.crypto.ed25519.PubKey","key":"j8qdbR+AlH/V6aBTCSWXRvX3JUESF2bV+SEzndBhF0o="}'

However, because there is a (wrong) proto annotation in the protofile (fixed in #16945), client/v2 will attempt to decode this as a bech32 address.

Additionally, the gRPC endpoint expects a bech32 consensus address (like cosmosvalcons1nrqsld3aw6lh6t082frdqc84uwxn0t958c).

This means, for backward compatibility, we should allow passing interchangeably a pubkey and a bech32 valcons for consistency with gRPC.

Both are currently not supported by autocli. This PR aims to solve that.


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

@julienrbrt julienrbrt added the backport/v0.50.x PR scheduled for inclusion in the v0.50's next stable release label Jul 11, 2023
@julienrbrt julienrbrt changed the title Julien/support consensus address feat(client/v2): support consensus address decoding Jul 11, 2023
@julienrbrt julienrbrt changed the base branch from main to julien/bech32-prefix-auth July 12, 2023 10:47
x/auth/keeper/keeper.go Outdated Show resolved Hide resolved
Base automatically changed from julien/bech32-staking to main July 13, 2023 09:10
@julienrbrt julienrbrt marked this pull request as ready for review July 13, 2023 11:41
@julienrbrt julienrbrt requested a review from a team as a code owner July 13, 2023 11:41
@julienrbrt julienrbrt force-pushed the julien/support-consensus-address branch from fa8d0a0 to 3dd1fab Compare July 14, 2023 07:12
@github-actions
Copy link
Contributor

@julienrbrt your pull request is missing a changelog!

@julienrbrt
Copy link
Member Author

@julienrbrt your pull request is missing a changelog!

client/v2 has never been released yet.

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.

this can be a non bech32 encoded string as well right?

@julienrbrt
Copy link
Member Author

this can be a non bech32 encoded string as well right?

Yes, you just inject/pass an address codec (in client/v2).
Hubl supports only bech32 for now tho.

@julienrbrt julienrbrt added this pull request to the merge queue Jul 14, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 14, 2023
@julienrbrt julienrbrt added this pull request to the merge queue Jul 14, 2023
Merged via the queue into main with commit 90b3907 Jul 14, 2023
51 of 52 checks passed
@julienrbrt julienrbrt deleted the julien/support-consensus-address branch July 14, 2023 08:11
mergify bot pushed a commit that referenced this pull request Jul 14, 2023
(cherry picked from commit 90b3907)

# Conflicts:
#	client/v2/go.mod
#	client/v2/go.sum
#	tools/hubl/go.mod
#	tools/hubl/go.sum
#	tools/hubl/internal/remote.go
@julienrbrt julienrbrt mentioned this pull request Jul 14, 2023
33 tasks
julienrbrt added a commit that referenced this pull request Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/v0.50.x PR scheduled for inclusion in the v0.50's next stable release C:CLI C:Hubl Tool: Hubl
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants