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

Add in-place and genesis migrations #205

Merged
merged 27 commits into from
Jun 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
4f874d9
add in-place migrations
colin-axner May 31, 2021
f8ca013
update migrations
colin-axner Jun 2, 2021
29c1c48
migrate solomachine from v1 to v2 during in place migration
colin-axner Jun 7, 2021
db0db21
fix build
colin-axner Jun 7, 2021
972ca3c
add genesis migration
colin-axner Jun 7, 2021
314aaba
code cleanup
colin-axner Jun 8, 2021
40a30fa
Merge branch 'main' into colin/11-migration-scripts
colin-axner Jun 8, 2021
863fdbd
add store migration test for expired tendermint consensus states
colin-axner Jun 8, 2021
a36801f
Merge branch 'colin/11-migration-scripts' of github.com:cosmos/ibc-go…
colin-axner Jun 8, 2021
863b50a
finish adding in place migration store tests
colin-axner Jun 9, 2021
545056e
add genesis test for solo machines
colin-axner Jun 9, 2021
40484bb
fix genesis migration bug, add tendermint tests
colin-axner Jun 9, 2021
a24618d
test fix, changelog, migration docs
colin-axner Jun 9, 2021
6d9bcdd
Apply suggestions from code review
colin-axner Jun 9, 2021
6c6fc52
Merge branch 'main' into colin/11-migration-scripts
colin-axner Jun 9, 2021
a67102f
Update docs/migrations/ibc-migration-043.md
AdityaSripal Jun 9, 2021
7e1f40f
apply Aditya's review suggestions
colin-axner Jun 10, 2021
3896a2a
Merge branch 'colin/11-migration-scripts' of github.com:cosmos/ibc-go…
colin-axner Jun 10, 2021
7edac1e
fix tests
colin-axner Jun 10, 2021
e326f74
add genesis json unmarshal test
colin-axner Jun 10, 2021
a970700
Merge branch 'main' into colin/11-migration-scripts
colin-axner Jun 10, 2021
7ceca61
add migration support for max expected time per block
colin-axner Jun 15, 2021
ca070bd
Merge branch 'colin/11-migration-scripts' of github.com:cosmos/ibc-go…
colin-axner Jun 15, 2021
0fcd0c4
fix docs
colin-axner Jun 15, 2021
900b907
fix bug found by Aditya
colin-axner Jun 16, 2021
fed9443
remove unnecessary code
colin-axner Jun 16, 2021
e595b11
apply Aditya review suggestions, fix bug
colin-axner Jun 17, 2021
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

### Improvements

* (core/02-client) [\#205](https://github.com/cosmos/ibc-go/pull/205) Add in-place and genesis migrations from SDK v0.42.0 to ibc-go v1.0.0. Solo machine protobuf defintions are migrated from v1 to v2. All solo machine consensus states are pruned. All expired tendermint consensus states are pruned.
* (modules/core) [\#184](https://github.com/cosmos/ibc-go/pull/184) Improve error messages. Uses unique error codes to indicate already relayed packets.
* (07-tendermint) [\#182](https://github.com/cosmos/ibc-go/pull/182) Remove duplicate checks in upgrade logic.
* (modules/core/04-channel) [\#7949](https://github.com/cosmos/cosmos-sdk/issues/7949) Standardized channel `Acknowledgement` moved to its own file. Codec registration redundancy removed.
Expand Down
340 changes: 339 additions & 1 deletion docs/ibc/proto-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,26 @@
- [ibc/lightclients/localhost/v1/localhost.proto](#ibc/lightclients/localhost/v1/localhost.proto)
- [ClientState](#ibc.lightclients.localhost.v1.ClientState)

- [ibc/lightclients/solomachine/v1/solomachine.proto](#ibc/lightclients/solomachine/v1/solomachine.proto)
- [ChannelStateData](#ibc.lightclients.solomachine.v1.ChannelStateData)
- [ClientState](#ibc.lightclients.solomachine.v1.ClientState)
- [ClientStateData](#ibc.lightclients.solomachine.v1.ClientStateData)
- [ConnectionStateData](#ibc.lightclients.solomachine.v1.ConnectionStateData)
- [ConsensusState](#ibc.lightclients.solomachine.v1.ConsensusState)
- [ConsensusStateData](#ibc.lightclients.solomachine.v1.ConsensusStateData)
- [Header](#ibc.lightclients.solomachine.v1.Header)
- [HeaderData](#ibc.lightclients.solomachine.v1.HeaderData)
- [Misbehaviour](#ibc.lightclients.solomachine.v1.Misbehaviour)
- [NextSequenceRecvData](#ibc.lightclients.solomachine.v1.NextSequenceRecvData)
- [PacketAcknowledgementData](#ibc.lightclients.solomachine.v1.PacketAcknowledgementData)
- [PacketCommitmentData](#ibc.lightclients.solomachine.v1.PacketCommitmentData)
- [PacketReceiptAbsenceData](#ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData)
- [SignBytes](#ibc.lightclients.solomachine.v1.SignBytes)
- [SignatureAndData](#ibc.lightclients.solomachine.v1.SignatureAndData)
- [TimestampedSignatureData](#ibc.lightclients.solomachine.v1.TimestampedSignatureData)

- [DataType](#ibc.lightclients.solomachine.v1.DataType)

- [ibc/lightclients/solomachine/v2/solomachine.proto](#ibc/lightclients/solomachine/v2/solomachine.proto)
- [ChannelStateData](#ibc.lightclients.solomachine.v2.ChannelStateData)
- [ClientState](#ibc.lightclients.solomachine.v2.ClientState)
Expand Down Expand Up @@ -2405,7 +2425,7 @@ Params defines the set of Connection parameters.

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `max_expected_time_per_block` | [uint64](#uint64) | | maximum expected time per block, used to enforce block delay. This parameter should reflect the largest amount of time that the chain might reasonably take to produce the next block under normal operating conditions. A safe choice is 3-5x the expected time per block. |
| `max_expected_time_per_block` | [uint64](#uint64) | | maximum expected time per block (in nanoseconds), used to enforce block delay. This parameter should reflect the largest amount of time that the chain might reasonably take to produce the next block under normal operating conditions. A safe choice is 3-5x the expected time per block. |



Expand Down Expand Up @@ -2919,6 +2939,324 @@ access to keys outside the client prefix.



<a name="ibc/lightclients/solomachine/v1/solomachine.proto"></a>
<p align="right"><a href="#top">Top</a></p>

## ibc/lightclients/solomachine/v1/solomachine.proto



<a name="ibc.lightclients.solomachine.v1.ChannelStateData"></a>

### ChannelStateData
ChannelStateData returns the SignBytes data for channel state
verification.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `path` | [bytes](#bytes) | | |
| `channel` | [ibc.core.channel.v1.Channel](#ibc.core.channel.v1.Channel) | | |






<a name="ibc.lightclients.solomachine.v1.ClientState"></a>

### ClientState
ClientState defines a solo machine client that tracks the current consensus
state and if the client is frozen.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `sequence` | [uint64](#uint64) | | latest sequence of the client state |
| `frozen_sequence` | [uint64](#uint64) | | frozen sequence of the solo machine |
| `consensus_state` | [ConsensusState](#ibc.lightclients.solomachine.v1.ConsensusState) | | |
| `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. |






<a name="ibc.lightclients.solomachine.v1.ClientStateData"></a>

### ClientStateData
ClientStateData returns the SignBytes data for client state verification.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `path` | [bytes](#bytes) | | |
| `client_state` | [google.protobuf.Any](#google.protobuf.Any) | | |






<a name="ibc.lightclients.solomachine.v1.ConnectionStateData"></a>

### ConnectionStateData
ConnectionStateData returns the SignBytes data for connection state
verification.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `path` | [bytes](#bytes) | | |
| `connection` | [ibc.core.connection.v1.ConnectionEnd](#ibc.core.connection.v1.ConnectionEnd) | | |






<a name="ibc.lightclients.solomachine.v1.ConsensusState"></a>

### ConsensusState
ConsensusState defines a solo machine consensus state. The sequence of a
consensus state is contained in the "height" key used in storing the
consensus state.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `public_key` | [google.protobuf.Any](#google.protobuf.Any) | | public key of the solo machine |
| `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. |
| `timestamp` | [uint64](#uint64) | | |






<a name="ibc.lightclients.solomachine.v1.ConsensusStateData"></a>

### ConsensusStateData
ConsensusStateData returns the SignBytes data for consensus state
verification.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `path` | [bytes](#bytes) | | |
| `consensus_state` | [google.protobuf.Any](#google.protobuf.Any) | | |






<a name="ibc.lightclients.solomachine.v1.Header"></a>

### Header
Header defines a solo machine consensus header


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `sequence` | [uint64](#uint64) | | sequence to update solo machine public key at |
| `timestamp` | [uint64](#uint64) | | |
| `signature` | [bytes](#bytes) | | |
| `new_public_key` | [google.protobuf.Any](#google.protobuf.Any) | | |
| `new_diversifier` | [string](#string) | | |






<a name="ibc.lightclients.solomachine.v1.HeaderData"></a>

### HeaderData
HeaderData returns the SignBytes data for update verification.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `new_pub_key` | [google.protobuf.Any](#google.protobuf.Any) | | header public key |
| `new_diversifier` | [string](#string) | | header diversifier |






<a name="ibc.lightclients.solomachine.v1.Misbehaviour"></a>

### Misbehaviour
Misbehaviour defines misbehaviour for a solo machine which consists
of a sequence and two signatures over different messages at that sequence.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `client_id` | [string](#string) | | |
| `sequence` | [uint64](#uint64) | | |
| `signature_one` | [SignatureAndData](#ibc.lightclients.solomachine.v1.SignatureAndData) | | |
| `signature_two` | [SignatureAndData](#ibc.lightclients.solomachine.v1.SignatureAndData) | | |






<a name="ibc.lightclients.solomachine.v1.NextSequenceRecvData"></a>

### NextSequenceRecvData
NextSequenceRecvData returns the SignBytes data for verification of the next
sequence to be received.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `path` | [bytes](#bytes) | | |
| `next_seq_recv` | [uint64](#uint64) | | |






<a name="ibc.lightclients.solomachine.v1.PacketAcknowledgementData"></a>

### PacketAcknowledgementData
PacketAcknowledgementData returns the SignBytes data for acknowledgement
verification.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `path` | [bytes](#bytes) | | |
| `acknowledgement` | [bytes](#bytes) | | |






<a name="ibc.lightclients.solomachine.v1.PacketCommitmentData"></a>

### PacketCommitmentData
PacketCommitmentData returns the SignBytes data for packet commitment
verification.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `path` | [bytes](#bytes) | | |
| `commitment` | [bytes](#bytes) | | |






<a name="ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData"></a>

### PacketReceiptAbsenceData
PacketReceiptAbsenceData returns the SignBytes data for
packet receipt absence verification.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `path` | [bytes](#bytes) | | |






<a name="ibc.lightclients.solomachine.v1.SignBytes"></a>

### SignBytes
SignBytes defines the signed bytes used for signature verification.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `sequence` | [uint64](#uint64) | | |
| `timestamp` | [uint64](#uint64) | | |
| `diversifier` | [string](#string) | | |
| `data_type` | [DataType](#ibc.lightclients.solomachine.v1.DataType) | | type of the data used |
| `data` | [bytes](#bytes) | | marshaled data |






<a name="ibc.lightclients.solomachine.v1.SignatureAndData"></a>

### SignatureAndData
SignatureAndData contains a signature and the data signed over to create that
signature.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `signature` | [bytes](#bytes) | | |
| `data_type` | [DataType](#ibc.lightclients.solomachine.v1.DataType) | | |
| `data` | [bytes](#bytes) | | |
| `timestamp` | [uint64](#uint64) | | |






<a name="ibc.lightclients.solomachine.v1.TimestampedSignatureData"></a>

### TimestampedSignatureData
TimestampedSignatureData contains the signature data and the timestamp of the
signature.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `signature_data` | [bytes](#bytes) | | |
| `timestamp` | [uint64](#uint64) | | |





<!-- end messages -->


<a name="ibc.lightclients.solomachine.v1.DataType"></a>

### DataType
DataType defines the type of solo machine proof being created. This is done
to preserve uniqueness of different data sign byte encodings.

| Name | Number | Description |
| ---- | ------ | ----------- |
| DATA_TYPE_UNINITIALIZED_UNSPECIFIED | 0 | Default State |
| DATA_TYPE_CLIENT_STATE | 1 | Data type for client state verification |
| DATA_TYPE_CONSENSUS_STATE | 2 | Data type for consensus state verification |
| DATA_TYPE_CONNECTION_STATE | 3 | Data type for connection state verification |
| DATA_TYPE_CHANNEL_STATE | 4 | Data type for channel state verification |
| DATA_TYPE_PACKET_COMMITMENT | 5 | Data type for packet commitment verification |
| DATA_TYPE_PACKET_ACKNOWLEDGEMENT | 6 | Data type for packet acknowledgement verification |
| DATA_TYPE_PACKET_RECEIPT_ABSENCE | 7 | Data type for packet receipt absence verification |
| DATA_TYPE_NEXT_SEQUENCE_RECV | 8 | Data type for next sequence recv verification |
| DATA_TYPE_HEADER | 9 | Data type for header verification |


<!-- end enums -->

<!-- end HasExtensions -->

<!-- end services -->



<a name="ibc/lightclients/solomachine/v2/solomachine.proto"></a>
<p align="right"><a href="#top">Top</a></p>

Expand Down
Loading