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

Create SIGN_MODE_AMINO_AUX for signing meta-transactions #10249

Closed
4 tasks
amaury1093 opened this issue Sep 28, 2021 · 0 comments · Fixed by #10268
Closed
4 tasks

Create SIGN_MODE_AMINO_AUX for signing meta-transactions #10249

amaury1093 opened this issue Sep 28, 2021 · 0 comments · Fixed by #10268
Assignees
Labels

Comments

@amaury1093
Copy link
Contributor

amaury1093 commented Sep 28, 2021

Part of the TX working group

Summary

Create a new sign mode called SIGN_MODE_AMINO_AUX

Problem Definition

The meta-transactions feature (#9912) needs a SIGN_MODE for signing tips. We added SIGN_MODE_AUX, but ledger devices can't sign that.

Our first approach was to create a totally new SIGN_MODE for ledger: either PROTO_JSON or TEXTUAL. Unfortunately, the first one is not perfect for ledger, and the second one needs more specification work.

For the meta-tx feature to be shipped asap, we propose to create a SIGN_MODE_AMINO_AUX based on the existing StdSignDoc, and used to sign tipped txs using Amino (so compatible with Ledger). This would require minimal work on the SDK, on CosmJS/client-devs and on the Ledger app teams.

Proposal

  1. Create a new StdSignDocAux:
type StdSignDocAux struct {
	AccountNumber uint64            `json:"account_number" yaml:"account_number"`
	Sequence      uint64            `json:"sequence" yaml:"sequence"`
	TimeoutHeight uint64            `json:"timeout_height,omitempty" yaml:"timeout_height"`
	ChainID       string            `json:"chain_id" yaml:"chain_id"`
	Memo          string            `json:"memo" yaml:"memo"`
	Msgs          []json.RawMessage `json:"msgs" yaml:"msgs"`
	// Remove `Fee` field from StdSignDoc, and add this
	Tip           []sdk.Coins // or []json.RawMessage? Look at output and fee if there's any difference between using sdk.Coins and []json.RawMessage
}
  1. Create a new sign mode handler for SIGN_MODE_AMINO_AUX
  2. Add tests

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@mergify mergify bot closed this as completed in #10268 Oct 4, 2021
mergify bot pushed a commit that referenced this issue Oct 4, 2021
<!--
The default pull request template is for types feat, fix, or refactor.
For other templates, add one of the following parameters to the url:
- template=docs.md
- template=other.md
-->

## Description

Closes: #10249 

<!-- Add a description of the changes that this PR introduces and the files that
are the most critical to review. -->

---

### 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](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] added `!` to the type prefix if API or client breaking change
- [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting))
- [ ] provided a link to the relevant issue or specification
- [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules)
- [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing)
- [ ] added a changelog entry to `CHANGELOG.md`
- [ ] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [ ] 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](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants