Skip to content

Commit b0a58a8

Browse files
refactor: solomachine generic verification methods and signbytes simplification (#1687)
* adding new SignBytes type, generic membership verification implementation and tests * adding protodocs * updating comment * refactor: solomachine misbehaviour checking (#1715) * adding SignatureAndDataV2 proto message type * updating misbehaviour checking * removing dead solomachine code (#1716) * updating tests with concrete ibc core types * refactor: solomachine generic VerifyNonMembership (#1720) * adding verification of non-membership with tests * refactor common code to produceVerificationArgs * removing unused produce args func * Update modules/light-clients/06-solomachine/client_state_test.go Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com> Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com> * removing V2 suffix from SignBytes and SignatureAndData types * use current diversifier when verifying header details * Add test for new diversifier for solomachine (#1860) * add test for successful new diversifier * add changelog entry * fix tests * restoring solomachine/v2 protos, updadting v2 codegen path and adding solomachine/v3 protobuf defs * adding changelog entries Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
1 parent d3d91ed commit b0a58a8

File tree

24 files changed

+5718
-4375
lines changed

24 files changed

+5718
-4375
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ Ref: https://keepachangelog.com/en/1.0.0/
4545
* (transfer) [\#1250](https://github.com/cosmos/ibc-go/pull/1250) Deprecate `GetTransferAccount` since the `transfer` module account is never used.
4646
* (06-solomachine) [\#1679](https://github.com/cosmos/ibc-go/pull/1679) Remove `types` sub-package from `06-solomachine` lightclient directory.
4747
* (07-tendermint) [\#1677](https://github.com/cosmos/ibc-go/pull/1677) Remove `types` sub-package from `07-tendermint` lightclient directory.
48+
* (06-solomachine) [\#1687](https://github.com/cosmos/ibc-go/pull/1687) Bump `06-solomachine` protobuf version from `v2` to `v3`.
49+
* (06-solomachine) [\#1687](https://github.com/cosmos/ibc-go/pull/1687) Removed `DataType` enum and associated message types from `06-solomachine`. `DataType` has been removed from `SignBytes` and `SignatureAndData` in favour of `path`.
4850

4951
### State Machine Breaking
5052

@@ -79,6 +81,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
7981

8082
### Bug Fixes
8183

84+
* (light-clients/solomachine) [#1839](https://github.com/cosmos/ibc-go/issues/1839) Fixed usage of the new diversifier in validation of changing diversifiers for the solo machine. The current diversifier must sign over the new diversifier.
8285
* (modules/core/04-channel) [\#1130](https://github.com/cosmos/ibc-go/pull/1130) Call `packet.GetSequence()` rather than passing func in `WriteAcknowledgement` log output
8386
* (apps/29-fee) [\#1278](https://github.com/cosmos/ibc-go/pull/1278) The URI path for the query to get all incentivized packets for a specifc channel did not follow the same format as the rest of queries.
8487
* (07-tendermint) [\#1674](https://github.com/cosmos/ibc-go/pull/1674) Submitted ClientState is zeroed out before checking the proof in order to prevent the proposal from containing information governance is not actually voting on.

docs/ibc/proto-docs.md

Lines changed: 174 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,16 @@
326326

327327
- [DataType](#ibc.lightclients.solomachine.v2.DataType)
328328

329+
- [ibc/lightclients/solomachine/v3/solomachine.proto](#ibc/lightclients/solomachine/v3/solomachine.proto)
330+
- [ClientState](#ibc.lightclients.solomachine.v3.ClientState)
331+
- [ConsensusState](#ibc.lightclients.solomachine.v3.ConsensusState)
332+
- [Header](#ibc.lightclients.solomachine.v3.Header)
333+
- [HeaderData](#ibc.lightclients.solomachine.v3.HeaderData)
334+
- [Misbehaviour](#ibc.lightclients.solomachine.v3.Misbehaviour)
335+
- [SignBytes](#ibc.lightclients.solomachine.v3.SignBytes)
336+
- [SignatureAndData](#ibc.lightclients.solomachine.v3.SignatureAndData)
337+
- [TimestampedSignatureData](#ibc.lightclients.solomachine.v3.TimestampedSignatureData)
338+
329339
- [ibc/lightclients/tendermint/v1/tendermint.proto](#ibc/lightclients/tendermint/v1/tendermint.proto)
330340
- [ClientState](#ibc.lightclients.tendermint.v1.ClientState)
331341
- [ConsensusState](#ibc.lightclients.tendermint.v1.ConsensusState)
@@ -4641,7 +4651,7 @@ of a sequence and two signatures over different messages at that sequence.
46414651

46424652
| Field | Type | Label | Description |
46434653
| ----- | ---- | ----- | ----------- |
4644-
| `client_id` | [string](#string) | | **Deprecated.** ClientID is deprecated |
4654+
| `client_id` | [string](#string) | | |
46454655
| `sequence` | [uint64](#uint64) | | |
46464656
| `signature_one` | [SignatureAndData](#ibc.lightclients.solomachine.v2.SignatureAndData) | | |
46474657
| `signature_two` | [SignatureAndData](#ibc.lightclients.solomachine.v2.SignatureAndData) | | |
@@ -4803,6 +4813,169 @@ to preserve uniqueness of different data sign byte encodings.
48034813

48044814

48054815

4816+
<a name="ibc/lightclients/solomachine/v3/solomachine.proto"></a>
4817+
<p align="right"><a href="#top">Top</a></p>
4818+
4819+
## ibc/lightclients/solomachine/v3/solomachine.proto
4820+
4821+
4822+
4823+
<a name="ibc.lightclients.solomachine.v3.ClientState"></a>
4824+
4825+
### ClientState
4826+
ClientState defines a solo machine client that tracks the current consensus
4827+
state and if the client is frozen.
4828+
4829+
4830+
| Field | Type | Label | Description |
4831+
| ----- | ---- | ----- | ----------- |
4832+
| `sequence` | [uint64](#uint64) | | latest sequence of the client state |
4833+
| `is_frozen` | [bool](#bool) | | frozen sequence of the solo machine |
4834+
| `consensus_state` | [ConsensusState](#ibc.lightclients.solomachine.v3.ConsensusState) | | |
4835+
| `allow_update_after_proposal` | [bool](#bool) | | when set to true, will allow governance to update a solo machine client. The client will be unfrozen if it is frozen. |
4836+
4837+
4838+
4839+
4840+
4841+
4842+
<a name="ibc.lightclients.solomachine.v3.ConsensusState"></a>
4843+
4844+
### ConsensusState
4845+
ConsensusState defines a solo machine consensus state. The sequence of a
4846+
consensus state is contained in the "height" key used in storing the
4847+
consensus state.
4848+
4849+
4850+
| Field | Type | Label | Description |
4851+
| ----- | ---- | ----- | ----------- |
4852+
| `public_key` | [google.protobuf.Any](#google.protobuf.Any) | | public key of the solo machine |
4853+
| `diversifier` | [string](#string) | | diversifier allows the same public key to be re-used across different solo machine clients (potentially on different chains) without being considered misbehaviour. |
4854+
| `timestamp` | [uint64](#uint64) | | |
4855+
4856+
4857+
4858+
4859+
4860+
4861+
<a name="ibc.lightclients.solomachine.v3.Header"></a>
4862+
4863+
### Header
4864+
Header defines a solo machine consensus header
4865+
4866+
4867+
| Field | Type | Label | Description |
4868+
| ----- | ---- | ----- | ----------- |
4869+
| `sequence` | [uint64](#uint64) | | sequence to update solo machine public key at |
4870+
| `timestamp` | [uint64](#uint64) | | |
4871+
| `signature` | [bytes](#bytes) | | |
4872+
| `new_public_key` | [google.protobuf.Any](#google.protobuf.Any) | | |
4873+
| `new_diversifier` | [string](#string) | | |
4874+
4875+
4876+
4877+
4878+
4879+
4880+
<a name="ibc.lightclients.solomachine.v3.HeaderData"></a>
4881+
4882+
### HeaderData
4883+
HeaderData returns the SignBytes data for update verification.
4884+
4885+
4886+
| Field | Type | Label | Description |
4887+
| ----- | ---- | ----- | ----------- |
4888+
| `new_pub_key` | [google.protobuf.Any](#google.protobuf.Any) | | header public key |
4889+
| `new_diversifier` | [string](#string) | | header diversifier |
4890+
4891+
4892+
4893+
4894+
4895+
4896+
<a name="ibc.lightclients.solomachine.v3.Misbehaviour"></a>
4897+
4898+
### Misbehaviour
4899+
Misbehaviour defines misbehaviour for a solo machine which consists
4900+
of a sequence and two signatures over different messages at that sequence.
4901+
4902+
4903+
| Field | Type | Label | Description |
4904+
| ----- | ---- | ----- | ----------- |
4905+
| `client_id` | [string](#string) | | **Deprecated.** ClientID is deprecated |
4906+
| `sequence` | [uint64](#uint64) | | |
4907+
| `signature_one` | [SignatureAndData](#ibc.lightclients.solomachine.v3.SignatureAndData) | | |
4908+
| `signature_two` | [SignatureAndData](#ibc.lightclients.solomachine.v3.SignatureAndData) | | |
4909+
4910+
4911+
4912+
4913+
4914+
4915+
<a name="ibc.lightclients.solomachine.v3.SignBytes"></a>
4916+
4917+
### SignBytes
4918+
SignBytes defines the signed bytes used for signature verification.
4919+
4920+
4921+
| Field | Type | Label | Description |
4922+
| ----- | ---- | ----- | ----------- |
4923+
| `sequence` | [uint64](#uint64) | | the sequence number |
4924+
| `timestamp` | [uint64](#uint64) | | the proof timestamp |
4925+
| `diversifier` | [string](#string) | | the public key diversifier |
4926+
| `path` | [bytes](#bytes) | | the standardised path bytes |
4927+
| `data` | [bytes](#bytes) | | the marshaled data bytes |
4928+
4929+
4930+
4931+
4932+
4933+
4934+
<a name="ibc.lightclients.solomachine.v3.SignatureAndData"></a>
4935+
4936+
### SignatureAndData
4937+
SignatureAndData contains a signature and the data signed over to create that
4938+
signature.
4939+
4940+
4941+
| Field | Type | Label | Description |
4942+
| ----- | ---- | ----- | ----------- |
4943+
| `signature` | [bytes](#bytes) | | |
4944+
| `path` | [bytes](#bytes) | | |
4945+
| `data` | [bytes](#bytes) | | |
4946+
| `timestamp` | [uint64](#uint64) | | |
4947+
4948+
4949+
4950+
4951+
4952+
4953+
<a name="ibc.lightclients.solomachine.v3.TimestampedSignatureData"></a>
4954+
4955+
### TimestampedSignatureData
4956+
TimestampedSignatureData contains the signature data and the timestamp of the
4957+
signature.
4958+
4959+
4960+
| Field | Type | Label | Description |
4961+
| ----- | ---- | ----- | ----------- |
4962+
| `signature_data` | [bytes](#bytes) | | |
4963+
| `timestamp` | [uint64](#uint64) | | |
4964+
4965+
4966+
4967+
4968+
4969+
<!-- end messages -->
4970+
4971+
<!-- end enums -->
4972+
4973+
<!-- end HasExtensions -->
4974+
4975+
<!-- end services -->
4976+
4977+
4978+
48064979
<a name="ibc/lightclients/tendermint/v1/tendermint.proto"></a>
48074980
<p align="right"><a href="#top">Top</a></p>
48084981

0 commit comments

Comments
 (0)