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

fix: remove delegator addess from MsgCreateValidator #14567

Merged
merged 25 commits into from
Jan 17, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
399ed1b
remove delegate address
0xbala-k Jan 10, 2023
fd49247
Merge branch 'cosmos:main' into murali/staking
0xbala-k Jan 10, 2023
1c10167
proto-gen
0xbala-k Jan 10, 2023
6c49ce7
Merge branch 'murali/staking' of https://github.com/0xmuralik/cosmos-…
0xbala-k Jan 10, 2023
c0dc0e2
fix errors
0xbala-k Jan 10, 2023
d500d90
deprecate delegator address in proto
0xbala-k Jan 11, 2023
8f930fa
proto-gen
0xbala-k Jan 11, 2023
eb357ba
proto docs
0xbala-k Jan 12, 2023
9634364
feat: create config fix tool (#14342)
julienrbrt Jan 10, 2023
c6f3d03
refactor: migrate `e2e/evidence` away from testify suite (#14553)
samricotta Jan 10, 2023
ef2671d
chore: add action to add issues to project board when labeled (#14570)
tac0turtle Jan 10, 2023
b44a871
refactor: migrate calls from alias file to appropriate store/types (#…
noelukwa Jan 10, 2023
021aefd
feat(mempool): priority nonce mempool option with tx replacement (#14…
JayT106 Jan 10, 2023
c9c5a77
docs: new key type for keyring (#14573)
JulianToledano Jan 11, 2023
c31fe30
feat(textual): Add Tx envelope Value Renderer (#13600)
amaury1093 Jan 11, 2023
b476810
chore: Replace testify with gotest.tools in staking integration tests…
likhita-809 Jan 11, 2023
771a623
chore: Replace testify with gotest.tools in bank integration tests (#…
likhita-809 Jan 11, 2023
e2bef8f
build(deps): Bump google.golang.org/grpc from 1.51.0 to 1.52.0 (#14580)
dependabot[bot] Jan 11, 2023
4f2eda3
test: Added test cases for precisionMultiplier (#14576)
aeharvlee Jan 12, 2023
cf166e1
proto docs
0xbala-k Jan 12, 2023
6b32a32
fix simulation test
0xbala-k Jan 12, 2023
e878b9a
Merge branch 'main' into murali/staking
0xbala-k Jan 12, 2023
78aac0a
Merge branch 'main' into murali/staking
alexanderbez Jan 16, 2023
bff845a
Merge branch 'main' into murali/staking
tac0turtle Jan 16, 2023
3a01ff4
changelog
0xbala-k Jan 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat(textual): Add Tx envelope Value Renderer (#13600)
  • Loading branch information
amaury1093 authored and 0xbala-k committed Jan 12, 2023
commit c31fe307dafde2dd1fef87641d861b6399e0169b
346 changes: 29 additions & 317 deletions docs/architecture/adr-050-sign-mode-textual.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* Sep 07, 2022: Add custom `Msg`-renderers.
* Sep 18, 2022: Structured format instead of lines of text
* Nov 23, 2022: Specify CBOR encoding.
* Dec 01, 2022: Link to examples in separate JSON file.
* Dec 06, 2022: Re-ordering of envelope screens.
* Dec 14, 2022: Mention exceptions for invertability.

## Status
Expand Down Expand Up @@ -176,29 +178,30 @@ We define "transaction envelope" as all data in a transaction that is not in the
```
Chain ID: <string>
Account number: <uint64>
*Public Key: <hex_string>
Sequence: <uint64>
<TxBody> // See #8.
Fee: <coins> // See value renderers for coins encoding.
*Fee payer: <string> // Skipped if no fee_payer set
*Fee granter: <string> // Skipped if no fee_granter set
Memo: <string> // Skipped if no memo set
Address: <string>
*Public Key: <Any>
This transaction has <int> Message(s) // Pluralize "Message" only when int>1
> Message (<int>/<int>): <Any> // See value renderers for Any rendering.
End of Message
Memo: <string> // Skipped if no memo set.
Fee: <coins> // See value renderers for coins rendering.
*Fee payer: <string> // Skipped if no fee_payer set.
*Fee granter: <string> // Skipped if no fee_granter set.
Tip: <coins> // Skippted if no tip.
Tipper: <string>
*Gas Limit: <uint64>
*Timeout Height: <uint64> // Skipped if no timeout_height set
Tipper: <string> // If there's a tip
Tip: <string>
*This transaction has <int> body extension: // Skipped if no body extension options
*<repeated Any>
*This transaction has <int> body non-critical extensions: // Skipped if no body non-critical extension options
*<repeated Any> // See value renderers for Any and array encoding.
*This transaction has <int> body auth info extensions: // Skipped if no auth info extension options
*<repeated Any>
*This transaction has <int> other signers: // Skipped if there is only one signer
*Signer (<int>/<int>):
*Public Key: <hex_string>
*Sequence: <uint64>
*Timeout Height: <uint64> // Skipped if no timeout_height set.
*Other signer: <int> SignerInfo // Skipped if the transaction only has 1 signer.
*> Other signer (<int>/<int>): <SignerInfo>
*End of other signers
*Hash of raw bytes: <hex_string> // Hex encoding of bytes defined in #10, to prevent tx hash malleability.
*Extension options: <int> Any: // Skipped if no body extension options
*> Extension options (<int>/<int>): <Any>
*End of extension options
*Non critical extension options: <int> Any: // Skipped if no body non critical extension options
*> Non critical extension options (<int>/<int>): <Any>
*End of Non critical extension options
*Hash of raw bytes: <hex_string> // Hex encoding of bytes defined, to prevent tx hash malleability.
```

### Encoding of the Transaction Body
Expand Down Expand Up @@ -289,304 +292,13 @@ See [annex 2](./adr-050-sign-mode-textual-annex2.md).

## Examples

#### Example 1: Simple `MsgSend`

JSON:

```json
{
"body": {
"messages": [
{
"@type": "/cosmos.bank.v1beta1.MsgSend",
"from": "cosmos1...abc",
"to": "cosmos1...def",
"amount": [
{
"denom": "uatom",
"amount": 10000000
}
]
}
]
},
"auth_info": {
"signer_infos": [
{
"public_key": "iQ...==",
"mode_info": { "single": { "mode": "SIGN_MODE_TEXTUAL" } },
"sequence": 2
}
],
"fee": {
"amount": [
{
"denom": "atom",
"amount": 0.002
}
],
"gas_limit": 100000
}
},
// Additional SignerData.
"chain_id": "simapp-1",
"account_number": 10
}
```

SIGN_MODE_TEXTUAL:

```
Chain ID: simapp-1
Account number: 10
*Public Key: iQ...== // Hex pubkey
Sequence: 2
This transaction has 1 message:
Message (1/1): bank v1beta1 send coins
From: cosmos1...abc
To: cosmos1...def
Amount: 10 atom // Conversion from uatom to atom using value renderers
End of transaction messages
Fee: 0.002 atom
*Gas: 100'000
*Hash of raw bytes: <hex_string>
```

#### Example 2: Multi-Msg Transaction with 3 signers

#### Example 3: Legacy Multisig

#### Example 4: Fee Payer with Tips

```json
{
"body": {
"messages": [
{
"@type": "/cosmos.bank.v1beta1.MsgSend",
"from": "cosmos1...tipper",
"to": "cosmos1...abc",
"amount": [
{
"denom": "uatom",
"amount": 10000000
}
]
}
]
},
"auth_info": {
"signer_infos": [
{
"public_key": "iQ...==",
"mode_info": { "single": { "mode": "SIGN_MODE_DIRECT_AUX" } },
"sequence": 42
},
{
"public_key": "iR...==",
"mode_info": { "single": { "mode": "SIGN_MODE_TEXTUAL" } },
"sequence": 2
}
],
"fee": {
"amount": [
{
"denom": "atom",
"amount": 0.002
}
],
"gas_limit": 100000,
"payer": "cosmos1...feepayer"
},
"tip": {
"amount": [
{
"denom": "ibc/CDC4587874B85BEA4FCEC3CEA5A1195139799A1FEE711A07D972537E18FDA39D",
"amount": 200
}
],
"tipper": "cosmos1...tipper"
}
},
// Additional SignerData.
"chain_id": "simapp-1",
"account_number": 10
}
```

SIGN_MODE_TEXTUAL for the feepayer:

```
Chain ID: simapp-1
Account number: 10
*Public Key: iR...==
Sequence: 2
This transaction has 1 message:
Message (1/1): bank v1beta1 send coins
From: cosmos1...abc
To: cosmos1...def
Amount: 10 atom
End of transaction messages
Fee: 0.002 atom
Fee Payer: cosmos1...feepayer
Tipper: cosmos1...tipper
Tip: 200 ibc/CDC4587874B85BEA4FCEC3CEA5A1195139799A1FEE711A07D972537E18FDA39D
*Gas: 100'000
*This transaction has 1 other signer:
*Signer (1/2):
*Public Key: iQ...==
*Sign mode: SIGN_MODE_DIRECT_AUX
*Sequence: 42
*End of other signers
*Hash of raw bytes: <hex_string>
```

#### Example 5: Complex Transaction with Nested Messages

JSON:

```json
{
"body": {
"messages": [
{
"@type": "/cosmos.bank.v1beta1.MsgSend",
"from": "cosmos1...abc",
"to": "cosmos1...def",
"amount": [
{
"denom": "uatom",
"amount": 10000000
}
]
},
{
"@type": "/cosmos.gov.v1.MsgSubmitProposal",
"proposer": "cosmos1...ghi",
"messages": [
{
"@type": "/cosmos.bank.v1beta1.MsgSend",
"from": "cosmos1...jkl",
"to": "cosmos1...mno",
"amount": [
{
"denom": "uatom",
"amount": 20000000
}
]
},
{
"@type": "/cosmos.authz.v1beta1.MsgExec",
"grantee": "cosmos1...pqr",
"msgs": [
{
"@type": "/cosmos.bank.v1beta1.MsgSend",
"from": "cosmos1...stu",
"to": "cosmos1...vwx",
"amount": [
{
"denom": "uatom",
"amount": 30000000
}
]
},
{
"@type": "/cosmos.bank.v1beta1.MsgSend",
"from": "cosmos1...abc",
"to": "cosmos1...def",
"amount": [
{
"denom": "uatom",
"amount": 40000000
}
]
}
]
}
],
"initial_deposit": [
{
"denom": "atom",
"amount": 100.01
}
]
}
]
},
"auth_info": {
"signer_infos": [
{
"public_key": "iQ...==",
"mode_info": { "single": { "mode": "SIGN_MODE_TEXTUAL" } },
"sequence": 2
},
{
"public_key": "iR...==",
"mode_info": { "single": { "mode": "SIGN_MODE_DIRECT" } },
"sequence": 42
}
],
"fee": {
"amount": [
{
"denom": "atom",
"amount": 0.002
}
],
"gas_limit": 100000
}
},
// Additional SignerData.
"chain_id": "simapp-1",
"account_number": 10
}
}
```

SIGN_MODE_TEXTUAL for 1st signer `cosmos1...abc`:
1. A minimal MsgSend: [see transaction](https://github.com/cosmos/cosmos-sdk/blob/094abcd393379acbbd043996024d66cd65246fb1/tx/textual/internal/testdata/e2e.json#L2-L70).
2. A transaction with a bit of everything: [see transaction](https://github.com/cosmos/cosmos-sdk/blob/094abcd393379acbbd043996024d66cd65246fb1/tx/textual/internal/testdata/e2e.json#L71-L270).

```
Chain ID: simapp-1
Account number: 10
*Public Key: iQ...==
Sequence: 2
This transaction has 2 messages:
Message (1/2): bank v1beta1 send coins
From: cosmos1...abc
To: cosmos1...def
Amount: 10 atom
Message (2/2): gov v1 submit proposal
Messages: 2 Messages
> Message (1/2): bank v1beta1 send coins
> From: cosmos1...jkl
> To: cosmos1...mno
> Amount: 20 atom
> Message (2/2): authz v1beta exec
> Grantee: cosmos1...pqr
> Msgs: 2 Msgs
>> Msg (1/2): bank v1beta1 send coins
>> From: cosmos1...stu
>> To: cosmos1...vwx
>> Amount: 30 atom
>> Msg (2/2): bank v1beta1 send coins
>> From: cosmos1...abc
>> To: cosmos1...def
>> Amount: 40 atom
> End of Msgs
End of transaction messages
Proposer: cosmos1...ghi
Initial Deposit: 100.01 atom
End of transaction messages
Fee: 0.002 atom
*Gas: 100'000
*This transaction has 1 other signer:
*Signer (2/2):
*Public Key: iR...==
*Sign mode: SIGN_MODE_DIRECT
*Sequence: 42
*End of other signers
*Hash of raw bytes: <hex_string>
```
The examples below are stored in a JSON file with the following fields:
- `proto`: the representation of the transaction in ProtoJSON,
- `screens`: the transaction rendered into SIGN_MODE_TEXTUAL screens,
- `cbor`: the sign bytes of the transaction, which is the CBOR encoding of the screens.

## Consequences

Expand Down
Loading