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 SIGN_MODE_AMINO_AUX handler #10268

Merged
merged 13 commits into from
Oct 4, 2021
Merged

feat: Add SIGN_MODE_AMINO_AUX handler #10268

merged 13 commits into from
Oct 4, 2021

Conversation

atheeshp
Copy link
Contributor

Description

Closes: #10249


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)

@atheeshp atheeshp changed the title Atheesh/amino aux feat: Add SIGN_MODE_AMINO_AUX handler Sep 30, 2021
@github-actions github-actions bot added the C:CLI label Oct 1, 2021
@atheeshp atheeshp removed the C:CLI label Oct 1, 2021
@atheeshp atheeshp marked this pull request as ready for review October 1, 2021 06:12
@codecov
Copy link

codecov bot commented Oct 1, 2021

Codecov Report

Merging #10268 (293c0b0) into master (623d084) will increase coverage by 0.05%.
The diff coverage is 69.92%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10268      +/-   ##
==========================================
+ Coverage   63.67%   63.73%   +0.05%     
==========================================
  Files         573      572       -1     
  Lines       53792    53957     +165     
==========================================
+ Hits        34251    34388     +137     
- Misses      17592    17612      +20     
- Partials     1949     1957       +8     
Impacted Files Coverage Δ
x/auth/migrations/legacytx/stdsign_aux.go 0.00% <0.00%> (ø)
x/auth/migrations/legacytx/stdtx_builder.go 58.65% <0.00%> (-1.16%) ⬇️
x/feegrant/keeper/keeper.go 84.66% <ø> (ø)
x/auth/middleware/middleware.go 75.00% <55.55%> (-25.00%) ⬇️
x/auth/middleware/basic.go 65.34% <65.34%> (ø)
x/auth/middleware/ext.go 68.00% <68.00%> (ø)
x/auth/middleware/sigverify.go 66.49% <71.16%> (ø)
x/auth/middleware/fee.go 80.90% <80.90%> (ø)
x/auth/tx/amino_aux.go 88.00% <88.00%> (ø)
server/mock/app.go 83.72% <100.00%> (+4.97%) ⬆️
... and 13 more

@amaury1093 amaury1093 mentioned this pull request Oct 1, 2021
23 tasks
@github-actions github-actions bot added the C:CLI label Oct 1, 2021
Copy link
Contributor

@alexanderbez alexanderbez left a comment

Choose a reason for hiding this comment

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

@atheeshp can you remind me where I can read up on Amino AUX mode pls?

docs/core/proto-docs.md Show resolved Hide resolved
@@ -2882,7 +2882,7 @@ ReflectionService defines a service for application reflection.
<a name="cosmos.base.snapshots.v1beta1.Metadata"></a>

### Metadata
Metadata contains Cosmos SDK-specific snapshot metadata.
Metadata contains SDK-specific snapshot metadata.
Copy link
Contributor

Choose a reason for hiding this comment

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

If you're going to use just SDK, then it should be an SDK ...

Copy link
Contributor

@amaury1093 amaury1093 left a comment

Choose a reason for hiding this comment

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

Nice, logic looks good!

I proposed some nits to make the test easier to read

x/auth/migrations/legacytx/stdsign_aux.go Outdated Show resolved Hide resolved
x/auth/tx/amino_aux_test.go Outdated Show resolved Hide resolved
x/auth/tx/amino_aux_test.go Outdated Show resolved Hide resolved
x/auth/tx/amino_aux_test.go Show resolved Hide resolved
x/auth/tx/amino_aux_test.go Outdated Show resolved Hide resolved
x/auth/tx/amino_aux_test.go Outdated Show resolved Hide resolved
x/auth/tx/amino_aux_test.go Outdated Show resolved Hide resolved
x/auth/tx/amino_aux_test.go Outdated Show resolved Hide resolved
@atheeshp
Copy link
Contributor Author

atheeshp commented Oct 1, 2021

@atheeshp can you remind me where I can read up on Amino AUX mode pls?

I don't think we have better docs for this yet, you may get some context here: #10249

Copy link
Contributor

@amaury1093 amaury1093 left a comment

Choose a reason for hiding this comment

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

utACK.

This will be tested when integrated with #10208

@amaury1093 amaury1093 added the A:automerge Automatically merge PR once all prerequisites pass. label Oct 4, 2021
@mergify mergify bot merged commit 465ace2 into master Oct 4, 2021
@mergify mergify bot deleted the atheesh/amino-aux branch October 4, 2021 10:57
mergify bot pushed a commit that referenced this pull request Oct 18, 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

Revert #10268 

As part of the TX working group, we decided not to introduce a new sign mode for tipper signing. The tipper will use amino-json to sign via ledger (see #10346).

Also, add `signing.SignerData#Address` (will be used in subsequent PR #10346)

<!-- 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)
mergify bot pushed a commit that referenced this pull request Nov 16, 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

R4R

Closes: #9912 

This PR introduces 1 new middleware:
- `TipsMiddleware`: transfer tip from tipper to feePayer when relevant.

It also makes sure in the DIRECT_AUX sign mode handler that the fee payer cannot use that sign mode.

Depends on:
- [x]  #10028 
- [x] #10268 
- [x] #10322 
- [x] #10346 

<!-- 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)
blewater pushed a commit to e-money/cosmos-sdk that referenced this pull request Dec 8, 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

R4R

Closes: cosmos#9912 

This PR introduces 1 new middleware:
- `TipsMiddleware`: transfer tip from tipper to feePayer when relevant.

It also makes sure in the DIRECT_AUX sign mode handler that the fee payer cannot use that sign mode.

Depends on:
- [x]  cosmos#10028 
- [x] cosmos#10268 
- [x] cosmos#10322 
- [x] cosmos#10346 

<!-- 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)
larry0x pushed a commit to larry0x/cosmos-sdk that referenced this pull request May 22, 2023
<!--
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

Revert cosmos#10268 

As part of the TX working group, we decided not to introduce a new sign mode for tipper signing. The tipper will use amino-json to sign via ledger (see cosmos#10346).

Also, add `signing.SignerData#Address` (will be used in subsequent PR cosmos#10346)

<!-- 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
A:automerge Automatically merge PR once all prerequisites pass. C:CLI C:x/auth
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create SIGN_MODE_AMINO_AUX for signing meta-transactions
3 participants