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(textual): Add client-side infra #14661

Merged
merged 117 commits into from
Jan 24, 2023
Merged

feat(textual): Add client-side infra #14661

merged 117 commits into from
Jan 24, 2023

Conversation

amaury1093
Copy link
Contributor

@amaury1093 amaury1093 commented Jan 18, 2023

Description

Closes: #13747

  • Add clientCtx support and CLI flags for Textual (will throw an error for now if used)
  • Add keyring support for Ledger devices
    • To tell the device whether the bytes we're sending are TEXTUAL bytes or AMINO_JSON bytes, we pass a byte flag called P2, which can be 0 or 1. To achieve this, I needed to break some keyring APIs for this new argument, as well as add a new LedgerPrivKeyAminoJSON interface so that ledger priv keys have 2 Sign methods.
    • Let me know if you can think of better ways to achieve this.
  • Add ante handler tests to make sure Textual passes sig verification.

Manual Testing

I managed to sign on my Nano S by performing the following changes on this PR (see as diff):

	_ "cosmossdk.io/api/cosmos/bank/v1beta1"
	_ "cosmossdk.io/api/cosmos/crypto/secp256k1"

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
Copy link
Member

Somewhat unrelated could you make proto-gen, the changes are related to textual.

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.

utACK.

client/flags/flags.go Show resolved Hide resolved
@@ -147,15 +162,20 @@ func TestSigVerification(t *testing.T) {
gasLimit := testdata.NewTestGasLimit()

spkd := ante.NewSetPubKeyDecorator(suite.accountKeeper)
svd := ante.NewSigVerificationDecorator(suite.accountKeeper, suite.clientCtx.TxConfig.SignModeHandler())
anteTxConfig := authtx.NewTxConfigWithTextual(
Copy link
Member

@julienrbrt julienrbrt Jan 20, 2023

Choose a reason for hiding this comment

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

It is a bit confusing I think given that they both do the same thing. Except one with a bank keeper and the other using gRPC. Especially since one constructor lives in client and the other on in auth/tx.
If they were in the same file that would be easier to compare and see they do the same thing.

@amaury1093 amaury1093 enabled auto-merge (squash) January 24, 2023 09:41
@github-actions github-actions bot added C:Confix Issues and PR related to Confix C:Cosmovisor Issues and PR related to Cosmovisor C:Rosetta Issues and PR related to Rosetta C:x/evidence C:x/tx labels Jan 24, 2023
@amaury1093 amaury1093 merged commit 57bedb1 into main Jan 24, 2023
@amaury1093 amaury1093 deleted the am/13747-textual-client branch January 24, 2023 10:17
larry0x pushed a commit to larry0x/cosmos-sdk that referenced this pull request May 22, 2023
Co-authored-by: Jeancarlo Barrios <JeancarloBarrios@users.noreply.github.com>
rootulp added a commit to rootulp/cosmos-sdk that referenced this pull request Oct 12, 2023
rootulp added a commit to celestiaorg/cosmos-sdk that referenced this pull request Oct 12, 2023
* fix: bump ledger-cosmos-go

* feat: update cosmos-sdk code for ledger-cosmos-go

Inspired by cosmos#14661
cmwaters pushed a commit to celestiaorg/cosmos-sdk that referenced this pull request Nov 13, 2023
* fix: bump ledger-cosmos-go

* feat: update cosmos-sdk code for ledger-cosmos-go

Inspired by cosmos#14661
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:CLI C:Confix Issues and PR related to Confix C:Cosmovisor Issues and PR related to Cosmovisor C:Rosetta Issues and PR related to Rosetta C:x/auth C:x/evidence C:x/nft C:x/tx Type: Build
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow client-side signing with SIGN_MODE_TEXTUAL
3 participants