Skip to content

Commit 0b6f3b9

Browse files
authored
revert: Revert SIGN_MODE_DIRECT_JSON proto files (#10305)
<!-- 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: #10252 <!-- 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)
1 parent fb78bbf commit 0b6f3b9

File tree

10 files changed

+227
-622
lines changed

10 files changed

+227
-622
lines changed

docs/core/proto-docs.md

+2-26
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,6 @@
665665
- [ModeInfo.Single](#cosmos.tx.v1beta1.ModeInfo.Single)
666666
- [SignDoc](#cosmos.tx.v1beta1.SignDoc)
667667
- [SignDocDirectAux](#cosmos.tx.v1beta1.SignDocDirectAux)
668-
- [SignDocJSON](#cosmos.tx.v1beta1.SignDocJSON)
669668
- [SignerInfo](#cosmos.tx.v1beta1.SignerInfo)
670669
- [Tip](#cosmos.tx.v1beta1.Tip)
671670
- [Tx](#cosmos.tx.v1beta1.Tx)
@@ -9365,9 +9364,8 @@ SignMode represents a signing mode with its own security guarantees.
93659364
| SIGN_MODE_UNSPECIFIED | 0 | SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be rejected. |
93669365
| SIGN_MODE_DIRECT | 1 | SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is verified with raw bytes from Tx. |
93679366
| SIGN_MODE_TEXTUAL | 2 | SIGN_MODE_TEXTUAL is a future signing mode that will verify some human-readable textual representation on top of the binary representation from SIGN_MODE_DIRECT. It is currently not supported. |
9368-
| SIGN_MODE_DIRECT_JSON | 3 | SIGN_MODE_DIRECT_JSON specifies a signing mode which uses SignDocJSON. It is verified using a canonical JSON representation of the bytes used in SIGN_MODE_DIRECT. It is currently not supported. |
9369-
| SIGN_MODE_DIRECT_AUX | 4 | SIGN_MODE_DIRECT_AUX specifies a signing mode which uses SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode does not require signers signing over other signers' `signer_info`. It also allows for adding Tips in transactions. |
9370-
| SIGN_MODE_AMINO_AUX | 5 | SIGN_MODE_AMINO_AUX specifies a signing mode which uses SignDocAminoAux. |
9367+
| SIGN_MODE_DIRECT_AUX | 3 | SIGN_MODE_DIRECT_AUX specifies a signing mode which uses SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode does not require signers signing over other signers' `signer_info`. It also allows for adding Tips in transactions. |
9368+
| SIGN_MODE_AMINO_AUX | 4 | SIGN_MODE_AMINO_AUX specifies a signing mode which uses SignDocAminoAux. |
93719369
| SIGN_MODE_LEGACY_AMINO_JSON | 127 | SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses Amino JSON and will be removed in the future. |
93729370

93739371

@@ -9512,28 +9510,6 @@ SIGN_MODE_DIRECT_AUX.
95129510

95139511

95149512

9515-
<a name="cosmos.tx.v1beta1.SignDocJSON"></a>
9516-
9517-
### SignDocJSON
9518-
SignDocJSON is the type used for generating sign bytes for
9519-
SIGN_MODE_DIRECT_JSON. It is designed to be serialized as proto3 JSON
9520-
following the rules defined here:
9521-
https://github.com/regen-network/canonical-proto3/blob/master/README.md#json.
9522-
9523-
9524-
| Field | Type | Label | Description |
9525-
| ----- | ---- | ----- | ----------- |
9526-
| `body` | [TxBody](#cosmos.tx.v1beta1.TxBody) | | body is the processable content of the transaction |
9527-
| `auth_info` | [AuthInfo](#cosmos.tx.v1beta1.AuthInfo) | | auth_info is the authorization related content of the transaction, specifically signers, signer modes and fee |
9528-
| `chain_id` | [string](#string) | | chain_id is the identifier of the chain this transaction targets. It prevents signed transactions from being used on another chain by an attacker |
9529-
| `account_number` | [uint64](#uint64) | | account_number is the account number of the signing account in state |
9530-
| `sign_doc_sha256_hash` | [bytes](#bytes) | | sign_doc_sha256_hash is the SHA-256 hash of SignDoc. It is included here to reduce the malleability attack surface of SIGN_MODE_DIRECT_JSON vs SIGN_MODE_DIRECT to zero. Basically this means that any discrepancy between protobuf bytes over the wire and protobuf bytes that are signed cannot be exploited. This information is obviously redundant with information already in SignDocJSON, but is included as a security check for scenarios where this information may have inadvertently been excluded. We include the hash of SignDoc rather than the full SignDoc bytes to reduce the size of SignDocJSON for scenarios where large payloads could cause problems for hardware wallets. |
9531-
9532-
9533-
9534-
9535-
9536-
95379513
<a name="cosmos.tx.v1beta1.SignerInfo"></a>
95389514

95399515
### SignerInfo

proto/cosmos/tx/signing/v1beta1/signing.proto

+2-7
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,15 @@ enum SignMode {
2121
// from SIGN_MODE_DIRECT. It is currently not supported.
2222
SIGN_MODE_TEXTUAL = 2;
2323

24-
// SIGN_MODE_DIRECT_JSON specifies a signing mode which uses SignDocJSON. It
25-
// is verified using a canonical JSON representation of the bytes used in
26-
// SIGN_MODE_DIRECT. It is currently not supported.
27-
SIGN_MODE_DIRECT_JSON = 3;
28-
2924
// SIGN_MODE_DIRECT_AUX specifies a signing mode which uses
3025
// SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode does not
3126
// require signers signing over other signers' `signer_info`. It also allows
3227
// for adding Tips in transactions.
33-
SIGN_MODE_DIRECT_AUX = 4;
28+
SIGN_MODE_DIRECT_AUX = 3;
3429

3530
// SIGN_MODE_AMINO_AUX specifies a signing mode which uses
3631
// SignDocAminoAux.
37-
SIGN_MODE_AMINO_AUX = 5;
32+
SIGN_MODE_AMINO_AUX = 4;
3833

3934
// SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses
4035
// Amino JSON and will be removed in the future.

proto/cosmos/tx/v1beta1/tx.proto

-33
Original file line numberDiff line numberDiff line change
@@ -64,39 +64,6 @@ message SignDoc {
6464
uint64 account_number = 4;
6565
}
6666

67-
// SignDocJSON is the type used for generating sign bytes for
68-
// SIGN_MODE_DIRECT_JSON. It is designed to be serialized as proto3 JSON
69-
// following the rules defined here:
70-
// https://github.com/regen-network/canonical-proto3/blob/master/README.md#json.
71-
message SignDocJSON {
72-
// body is the processable content of the transaction
73-
TxBody body = 1;
74-
75-
// auth_info is the authorization related content of the transaction,
76-
// specifically signers, signer modes and fee
77-
AuthInfo auth_info = 2;
78-
79-
// chain_id is the identifier of the chain this transaction targets.
80-
// It prevents signed transactions from being used on another chain by an
81-
// attacker
82-
string chain_id = 3;
83-
84-
// account_number is the account number of the signing account in state
85-
uint64 account_number = 4;
86-
87-
// sign_doc_sha256_hash is the SHA-256 hash of SignDoc. It is included here to
88-
// reduce the malleability attack surface of SIGN_MODE_DIRECT_JSON vs
89-
// SIGN_MODE_DIRECT to zero. Basically this means that any discrepancy between
90-
// protobuf bytes over the wire and protobuf bytes that are signed cannot be
91-
// exploited. This information is obviously redundant with information already
92-
// in SignDocJSON, but is included as a security check for scenarios where
93-
// this information may have inadvertently been excluded. We include the hash
94-
// of SignDoc rather than the full SignDoc bytes to reduce the size of
95-
// SignDocJSON for scenarios where large payloads could cause problems for
96-
// hardware wallets.
97-
bytes sign_doc_sha256_hash = 5;
98-
}
99-
10067
// SignDocDirectAux is the type used for generating sign bytes for
10168
// SIGN_MODE_DIRECT_AUX.
10269
message SignDocDirectAux {

types/tx/signing/signing.pb.go

+43-49
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)