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

ICS28: Sovereign to consumer chain transition #840

Merged
merged 22 commits into from
Dec 7, 2022

Conversation

mpoke
Copy link
Contributor

@mpoke mpoke commented Sep 19, 2022

Closes #834

Also closes #830

The protocol in a nutshell:

  • A sovereign chain sends a proposal with the following fields
    chainId: string // the ID of the chain
    spawnTime: Timestamp // the earliest time when the proposal can be handled 
    connId: Identifier // the ID of an existing connection end on the provider chain on top of which the CCV channel will be created
  • The provider only accepts proposal with chainIds not already in use
  • The provider validates connId
  • The provider creates a genesis state for the consumer CCV module with the following fields
      preCCV: true, // flag indicating that the consumer CCV module will start in a pre-CCV state, i.e., it doesn't provide valset updates to Tmint
      connId: connectionEnd.counterpartyConnectionIdentifier, // connection ID on the sovereign chain
      initialValSet: initialValSet, // the current validator set on the provider chain
  • The sovereign chain upgrades to add the consumer CCV module and initializing it using the genesis state queried from the provider

  • A relayer starts the channel opening handshake

  • On ACK, the sovereign chain calls the ReplaceValset method of the staking module which replaces the validator set with initialValSet from the genesis state.

  • Once the validator set in the header matches initialValSet (typically two heights later), the sovereign chain upgrades to a full consumer chain, i.e., preCCV = false and the staking module is replaced by the consumer CCV module (in other words, the pre-CCV state is over).

  • Note that the overview of the channel initialization protocol still needs to be updated.

@mpoke mpoke added the ready-for-review Pull requests which are ready for review. label Oct 14, 2022
@danwt danwt self-requested a review October 17, 2022 16:33
@josef-widder
Copy link
Contributor

I am lacking a bit of context here. From the diff, it looks like this method of becoming consumer chain replaces the idea of spawning. Is this right?

In theory we can completely swap out the valset from one block to the other. In practice, we would need that the new validators have synced to the system. I guess this requirement is captured somewhere else (a handbook) and is not part of the spec?

Copy link
Member

@AdityaSripal AdityaSripal left a comment

Choose a reason for hiding this comment

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

Nice work. I like the proposed protocol, have some nits

- `HtoVSC` for the current block is set to `0`.
- The `validatorSet` mapping is populated with the initial validator set.
- The `ccvValidatorSet` mapping is populated with the initial validator set.
- The ID of the distribution token transfer channel is set to `gs.distributionChannelId`.
Copy link
Member

Choose a reason for hiding this comment

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

if defined

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If it's not define, it will be set to "" (the default value of gs.distributionChannelId) and then a distribution channel will be created in onChanOpenAck.

Comment on lines +976 to +980
// send pending slash requests;
// note: this can happen only if preCCV == false, as the ABCI application
// can invoke SendSlashRequest only once the chain is upgraded to
// a consumer chain, see BeginBlockInit below
SendPendingSlashRequests()
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see exactly why this is necessary, it can be left to

SendPendingSlashRequests()

It will be later, but maybe that doesn't matter.

This is anyways far behind the current code, which only ever sends packets from the consumer in EndBlock https://github.com/cosmos/interchain-security/blob/4474a08a43feb8e8de227f6a7ee8b33f724ab9b5/x/ccv/consumer/keeper/relay.go

(Just FYI)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't see exactly why this is necessary, it can be left to

SendPendingSlashRequests()

The call to SendPendingSlashRequests was moved from onRecvVSCPacket to onChanOpenAck as from the consumer's perspective the CCV channel is established when it receives the first valid ChanOpenAck msg. Before, the CCV channel was established when receiving the first VSCPacket.

This is anyways far behind the current code, which only ever sends packets from the consumer in EndBlock https://github.com/cosmos/interchain-security/blob/4474a08a43feb8e8de227f6a7ee8b33f724ab9b5/x/ccv/consumer/keeper/relay.go

These changes in the code were not added to the spec yet.

@danwt
Copy link
Contributor

danwt commented Nov 29, 2022

It's quite hard for me to say anything precise about the changes. Overall, I didn't notice any mistakes, and I think the protocol concept is good.

Remark: maintaining this level of detail seems futile. The method.md file is essentially 2k+ lines of uncompilable code. Noone can read this and say that there are no mistakes.

Nice work though, the upgrade mechanism appears solid. I need to learn more ibc subtleties to be able to give more valuable feedback.

Copy link
Contributor

@josef-widder josef-widder left a comment

Choose a reason for hiding this comment

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

I have reviews the changes since our last synchronous discussion. In particular the overview. Looks great. I think the transition from sovereign to consumer might also have interesting applications in the future.

Comment on lines +1018 to +1019
// - for safety, the existing staking module must be kept
// for at least the unbonding period
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this the only place where this requirement is captured? Would it make sense to have it also somewhere in the properties?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. I added a note to the Bond-Based Consumer Voting Power property.

@mpoke mpoke merged commit 4345a32 into main Dec 7, 2022
@mpoke mpoke deleted the marius/834-sovereign-to-consumer branch December 7, 2022 09:20
dshiell pushed a commit to polymerdao/ibc that referenced this pull request Dec 16, 2022
* update CreateConsumerClient for sovereign chains

* update InitGenesis for sovereign chains

* establish CCV on ACK and handle preCCV completion

* update Channel Uniqueness Correctness Reasoning

* add pre-CCV module interface with staking

* add clarifications

* add overview TODO

* fix pendingChanges bug

* refactor proposal names (cosmos#855)

* Update spec/app/ics-028-cross-chain-validation/system_model_and_properties.md

Co-authored-by: Daniel T <30197399+danwt@users.noreply.github.com>

* enable optimistic opening handshakes

* remove ConsumerAdditionProposal.initialHeight

* handle proposals in BeginBlock

* pass consumer unbonding period via gov proposal

* update channel init overview - wip

* update overview

* update modified date

* add note re. the existing staking module

Co-authored-by: Daniel T <30197399+danwt@users.noreply.github.com>
dshiell added a commit to polymerdao/ibc that referenced this pull request Dec 16, 2022
* ICS20: Replace Metadata with Memo (cosmos#877)

* memo string replacement

* formatting

Co-authored-by: Carlos Rodriguez <carlos@interchain.io>

* ICS9: remove localhost client (cosmos#878)

* remove localhost client

* Update CHANGELOG.md

* Update README.md

* fix: update comment about channel state check in `sendPacket` (cosmos#865)

* update comment

* typo

* remove comment

Co-authored-by: Carlos Rodriguez <crodveg@gmail.com>

* ICS5: fix releasePort signature (cosmos#885)

Signed-off-by: Jun Kimura <junkxdev@gmail.com>

Signed-off-by: Jun Kimura <junkxdev@gmail.com>

* ICS721: Add tokenData to PacketData (cosmos#876)

* add tokenData to PacketData; improve TypeScript formatting

* revert else style

* extend 03-connection with a proof object for chains that can't introspect their own consensus state. (cosmos#839)

* extend 03-connection with HostConsensusStateProof

* make hostConsensusStateProof optional

* ICS28: Reflect deferred unbonding completion in spec (cosmos#826)

* call UnbondingCanComplete in EndBlock

* update README

* update ics23 link (cosmos#891)

* update eli5 blog post link (cosmos#892)

* ICS28: Sovereign to consumer chain transition (cosmos#840)

* update CreateConsumerClient for sovereign chains

* update InitGenesis for sovereign chains

* establish CCV on ACK and handle preCCV completion

* update Channel Uniqueness Correctness Reasoning

* add pre-CCV module interface with staking

* add clarifications

* add overview TODO

* fix pendingChanges bug

* refactor proposal names (cosmos#855)

* Update spec/app/ics-028-cross-chain-validation/system_model_and_properties.md

Co-authored-by: Daniel T <30197399+danwt@users.noreply.github.com>

* enable optimistic opening handshakes

* remove ConsumerAdditionProposal.initialHeight

* handle proposals in BeginBlock

* pass consumer unbonding period via gov proposal

* update channel init overview - wip

* update overview

* update modified date

* add note re. the existing staking module

Co-authored-by: Daniel T <30197399+danwt@users.noreply.github.com>

* ICS28: VSCPackets should have timeout on provider (cosmos#858)

* update CreateConsumerClient for sovereign chains

* update InitGenesis for sovereign chains

* establish CCV on ACK and handle preCCV completion

* update Channel Uniqueness Correctness Reasoning

* add pre-CCV module interface with staking

* add clarifications

* add overview TODO

* fix pendingChanges bug

* refactor proposal names

* add VSC timeout

* refactor proposal names (cosmos#855)

* Update spec/app/ics-028-cross-chain-validation/system_model_and_properties.md

Co-authored-by: Daniel T <30197399+danwt@users.noreply.github.com>

* enable optimistic opening handshakes

* remove ConsumerAdditionProposal.initialHeight

* handle proposals in BeginBlock

* pass consumer unbonding period via gov proposal

* update channel init overview - wip

* update overview

* update modified date

* ICS28: Channel initialization should have a timeout (cosmos#860)

* add init timeout

* fix typo

* add note on timed out channel init

* update vsc timeout as per implementation

Co-authored-by: Daniel T <30197399+danwt@users.noreply.github.com>

* add angbrav as code owner (cosmos#895)

Co-authored-by: Carlos Rodriguez <carlos@interchain.com>

* save progress

* start adding proof generation logic and update graphical_proof.jpg

* rm spec/.DS_Store

Signed-off-by: Jun Kimura <junkxdev@gmail.com>
Co-authored-by: Aditya <adityasripal@gmail.com>
Co-authored-by: Carlos Rodriguez <carlos@interchain.io>
Co-authored-by: Carlos Rodriguez <crodveg@gmail.com>
Co-authored-by: Jun Kimura <junkxdev@gmail.com>
Co-authored-by: Haifeng Xi <haifeng@bianjie.ai>
Co-authored-by: Web3 Philosopher <seunlanlege@gmail.com>
Co-authored-by: Marius Poke <marius.poke@posteo.de>
Co-authored-by: Daniel T <30197399+danwt@users.noreply.github.com>
Co-authored-by: Carlos Rodriguez <carlos@interchain.com>
dshiell added a commit to polymerdao/ibc that referenced this pull request Feb 13, 2023
* ICS20: Replace Metadata with Memo (cosmos#877)

* memo string replacement

* formatting

Co-authored-by: Carlos Rodriguez <carlos@interchain.io>

* ICS9: remove localhost client (cosmos#878)

* remove localhost client

* Update CHANGELOG.md

* Update README.md

* fix: update comment about channel state check in `sendPacket` (cosmos#865)

* update comment

* typo

* remove comment

Co-authored-by: Carlos Rodriguez <crodveg@gmail.com>

* ICS5: fix releasePort signature (cosmos#885)

Signed-off-by: Jun Kimura <junkxdev@gmail.com>

Signed-off-by: Jun Kimura <junkxdev@gmail.com>

* ICS721: Add tokenData to PacketData (cosmos#876)

* add tokenData to PacketData; improve TypeScript formatting

* revert else style

* extend 03-connection with a proof object for chains that can't introspect their own consensus state. (cosmos#839)

* extend 03-connection with HostConsensusStateProof

* make hostConsensusStateProof optional

* ICS28: Reflect deferred unbonding completion in spec (cosmos#826)

* call UnbondingCanComplete in EndBlock

* update README

* update ics23 link (cosmos#891)

* update eli5 blog post link (cosmos#892)

* ICS28: Sovereign to consumer chain transition (cosmos#840)

* update CreateConsumerClient for sovereign chains

* update InitGenesis for sovereign chains

* establish CCV on ACK and handle preCCV completion

* update Channel Uniqueness Correctness Reasoning

* add pre-CCV module interface with staking

* add clarifications

* add overview TODO

* fix pendingChanges bug

* refactor proposal names (cosmos#855)

* Update spec/app/ics-028-cross-chain-validation/system_model_and_properties.md

Co-authored-by: Daniel T <30197399+danwt@users.noreply.github.com>

* enable optimistic opening handshakes

* remove ConsumerAdditionProposal.initialHeight

* handle proposals in BeginBlock

* pass consumer unbonding period via gov proposal

* update channel init overview - wip

* update overview

* update modified date

* add note re. the existing staking module

Co-authored-by: Daniel T <30197399+danwt@users.noreply.github.com>

* ICS28: VSCPackets should have timeout on provider (cosmos#858)

* update CreateConsumerClient for sovereign chains

* update InitGenesis for sovereign chains

* establish CCV on ACK and handle preCCV completion

* update Channel Uniqueness Correctness Reasoning

* add pre-CCV module interface with staking

* add clarifications

* add overview TODO

* fix pendingChanges bug

* refactor proposal names

* add VSC timeout

* refactor proposal names (cosmos#855)

* Update spec/app/ics-028-cross-chain-validation/system_model_and_properties.md

Co-authored-by: Daniel T <30197399+danwt@users.noreply.github.com>

* enable optimistic opening handshakes

* remove ConsumerAdditionProposal.initialHeight

* handle proposals in BeginBlock

* pass consumer unbonding period via gov proposal

* update channel init overview - wip

* update overview

* update modified date

* ICS28: Channel initialization should have a timeout (cosmos#860)

* add init timeout

* fix typo

* add note on timed out channel init

* update vsc timeout as per implementation

Co-authored-by: Daniel T <30197399+danwt@users.noreply.github.com>

* add angbrav as code owner (cosmos#895)

Co-authored-by: Carlos Rodriguez <carlos@interchain.com>

* save progress

* start adding proof generation logic and update graphical_proof.jpg

* rm spec/.DS_Store

Signed-off-by: Jun Kimura <junkxdev@gmail.com>
Co-authored-by: Aditya <adityasripal@gmail.com>
Co-authored-by: Carlos Rodriguez <carlos@interchain.io>
Co-authored-by: Carlos Rodriguez <crodveg@gmail.com>
Co-authored-by: Jun Kimura <junkxdev@gmail.com>
Co-authored-by: Haifeng Xi <haifeng@bianjie.ai>
Co-authored-by: Web3 Philosopher <seunlanlege@gmail.com>
Co-authored-by: Marius Poke <marius.poke@posteo.de>
Co-authored-by: Daniel T <30197399+danwt@users.noreply.github.com>
Co-authored-by: Carlos Rodriguez <carlos@interchain.com>
dshiell added a commit to polymerdao/ibc that referenced this pull request Mar 8, 2023
* ICS20: Replace Metadata with Memo (cosmos#877)

* memo string replacement

* formatting

Co-authored-by: Carlos Rodriguez <carlos@interchain.io>

* ICS9: remove localhost client (cosmos#878)

* remove localhost client

* Update CHANGELOG.md

* Update README.md

* fix: update comment about channel state check in `sendPacket` (cosmos#865)

* update comment

* typo

* remove comment

Co-authored-by: Carlos Rodriguez <crodveg@gmail.com>

* ICS5: fix releasePort signature (cosmos#885)

Signed-off-by: Jun Kimura <junkxdev@gmail.com>

Signed-off-by: Jun Kimura <junkxdev@gmail.com>

* ICS721: Add tokenData to PacketData (cosmos#876)

* add tokenData to PacketData; improve TypeScript formatting

* revert else style

* extend 03-connection with a proof object for chains that can't introspect their own consensus state. (cosmos#839)

* extend 03-connection with HostConsensusStateProof

* make hostConsensusStateProof optional

* ICS28: Reflect deferred unbonding completion in spec (cosmos#826)

* call UnbondingCanComplete in EndBlock

* update README

* update ics23 link (cosmos#891)

* update eli5 blog post link (cosmos#892)

* ICS28: Sovereign to consumer chain transition (cosmos#840)

* update CreateConsumerClient for sovereign chains

* update InitGenesis for sovereign chains

* establish CCV on ACK and handle preCCV completion

* update Channel Uniqueness Correctness Reasoning

* add pre-CCV module interface with staking

* add clarifications

* add overview TODO

* fix pendingChanges bug

* refactor proposal names (cosmos#855)

* Update spec/app/ics-028-cross-chain-validation/system_model_and_properties.md

Co-authored-by: Daniel T <30197399+danwt@users.noreply.github.com>

* enable optimistic opening handshakes

* remove ConsumerAdditionProposal.initialHeight

* handle proposals in BeginBlock

* pass consumer unbonding period via gov proposal

* update channel init overview - wip

* update overview

* update modified date

* add note re. the existing staking module

Co-authored-by: Daniel T <30197399+danwt@users.noreply.github.com>

* ICS28: VSCPackets should have timeout on provider (cosmos#858)

* update CreateConsumerClient for sovereign chains

* update InitGenesis for sovereign chains

* establish CCV on ACK and handle preCCV completion

* update Channel Uniqueness Correctness Reasoning

* add pre-CCV module interface with staking

* add clarifications

* add overview TODO

* fix pendingChanges bug

* refactor proposal names

* add VSC timeout

* refactor proposal names (cosmos#855)

* Update spec/app/ics-028-cross-chain-validation/system_model_and_properties.md

Co-authored-by: Daniel T <30197399+danwt@users.noreply.github.com>

* enable optimistic opening handshakes

* remove ConsumerAdditionProposal.initialHeight

* handle proposals in BeginBlock

* pass consumer unbonding period via gov proposal

* update channel init overview - wip

* update overview

* update modified date

* ICS28: Channel initialization should have a timeout (cosmos#860)

* add init timeout

* fix typo

* add note on timed out channel init

* update vsc timeout as per implementation

Co-authored-by: Daniel T <30197399+danwt@users.noreply.github.com>

* add angbrav as code owner (cosmos#895)

Co-authored-by: Carlos Rodriguez <carlos@interchain.com>

* save progress

* start adding proof generation logic and update graphical_proof.jpg

* rm spec/.DS_Store

Signed-off-by: Jun Kimura <junkxdev@gmail.com>
Co-authored-by: Aditya <adityasripal@gmail.com>
Co-authored-by: Carlos Rodriguez <carlos@interchain.io>
Co-authored-by: Carlos Rodriguez <crodveg@gmail.com>
Co-authored-by: Jun Kimura <junkxdev@gmail.com>
Co-authored-by: Haifeng Xi <haifeng@bianjie.ai>
Co-authored-by: Web3 Philosopher <seunlanlege@gmail.com>
Co-authored-by: Marius Poke <marius.poke@posteo.de>
Co-authored-by: Daniel T <30197399+danwt@users.noreply.github.com>
Co-authored-by: Carlos Rodriguez <carlos@interchain.com>
dshiell added a commit to polymerdao/ibc that referenced this pull request May 15, 2023
* ICS20: Replace Metadata with Memo (cosmos#877)

* memo string replacement

* formatting

Co-authored-by: Carlos Rodriguez <carlos@interchain.io>

* ICS9: remove localhost client (cosmos#878)

* remove localhost client

* Update CHANGELOG.md

* Update README.md

* fix: update comment about channel state check in `sendPacket` (cosmos#865)

* update comment

* typo

* remove comment

Co-authored-by: Carlos Rodriguez <crodveg@gmail.com>

* ICS5: fix releasePort signature (cosmos#885)

Signed-off-by: Jun Kimura <junkxdev@gmail.com>

Signed-off-by: Jun Kimura <junkxdev@gmail.com>

* ICS721: Add tokenData to PacketData (cosmos#876)

* add tokenData to PacketData; improve TypeScript formatting

* revert else style

* extend 03-connection with a proof object for chains that can't introspect their own consensus state. (cosmos#839)

* extend 03-connection with HostConsensusStateProof

* make hostConsensusStateProof optional

* ICS28: Reflect deferred unbonding completion in spec (cosmos#826)

* call UnbondingCanComplete in EndBlock

* update README

* update ics23 link (cosmos#891)

* update eli5 blog post link (cosmos#892)

* ICS28: Sovereign to consumer chain transition (cosmos#840)

* update CreateConsumerClient for sovereign chains

* update InitGenesis for sovereign chains

* establish CCV on ACK and handle preCCV completion

* update Channel Uniqueness Correctness Reasoning

* add pre-CCV module interface with staking

* add clarifications

* add overview TODO

* fix pendingChanges bug

* refactor proposal names (cosmos#855)

* Update spec/app/ics-028-cross-chain-validation/system_model_and_properties.md

Co-authored-by: Daniel T <30197399+danwt@users.noreply.github.com>

* enable optimistic opening handshakes

* remove ConsumerAdditionProposal.initialHeight

* handle proposals in BeginBlock

* pass consumer unbonding period via gov proposal

* update channel init overview - wip

* update overview

* update modified date

* add note re. the existing staking module

Co-authored-by: Daniel T <30197399+danwt@users.noreply.github.com>

* ICS28: VSCPackets should have timeout on provider (cosmos#858)

* update CreateConsumerClient for sovereign chains

* update InitGenesis for sovereign chains

* establish CCV on ACK and handle preCCV completion

* update Channel Uniqueness Correctness Reasoning

* add pre-CCV module interface with staking

* add clarifications

* add overview TODO

* fix pendingChanges bug

* refactor proposal names

* add VSC timeout

* refactor proposal names (cosmos#855)

* Update spec/app/ics-028-cross-chain-validation/system_model_and_properties.md

Co-authored-by: Daniel T <30197399+danwt@users.noreply.github.com>

* enable optimistic opening handshakes

* remove ConsumerAdditionProposal.initialHeight

* handle proposals in BeginBlock

* pass consumer unbonding period via gov proposal

* update channel init overview - wip

* update overview

* update modified date

* ICS28: Channel initialization should have a timeout (cosmos#860)

* add init timeout

* fix typo

* add note on timed out channel init

* update vsc timeout as per implementation

Co-authored-by: Daniel T <30197399+danwt@users.noreply.github.com>

* add angbrav as code owner (cosmos#895)

Co-authored-by: Carlos Rodriguez <carlos@interchain.com>

* save progress

* start adding proof generation logic and update graphical_proof.jpg

* rm spec/.DS_Store

Signed-off-by: Jun Kimura <junkxdev@gmail.com>
Co-authored-by: Aditya <adityasripal@gmail.com>
Co-authored-by: Carlos Rodriguez <carlos@interchain.io>
Co-authored-by: Carlos Rodriguez <crodveg@gmail.com>
Co-authored-by: Jun Kimura <junkxdev@gmail.com>
Co-authored-by: Haifeng Xi <haifeng@bianjie.ai>
Co-authored-by: Web3 Philosopher <seunlanlege@gmail.com>
Co-authored-by: Marius Poke <marius.poke@posteo.de>
Co-authored-by: Daniel T <30197399+danwt@users.noreply.github.com>
Co-authored-by: Carlos Rodriguez <carlos@interchain.com>
dshiell added a commit to polymerdao/ibc that referenced this pull request Aug 2, 2023
* ICS20: Replace Metadata with Memo (cosmos#877)

* memo string replacement

* formatting

Co-authored-by: Carlos Rodriguez <carlos@interchain.io>

* ICS9: remove localhost client (cosmos#878)

* remove localhost client

* Update CHANGELOG.md

* Update README.md

* fix: update comment about channel state check in `sendPacket` (cosmos#865)

* update comment

* typo

* remove comment

Co-authored-by: Carlos Rodriguez <crodveg@gmail.com>

* ICS5: fix releasePort signature (cosmos#885)

Signed-off-by: Jun Kimura <junkxdev@gmail.com>

Signed-off-by: Jun Kimura <junkxdev@gmail.com>

* ICS721: Add tokenData to PacketData (cosmos#876)

* add tokenData to PacketData; improve TypeScript formatting

* revert else style

* extend 03-connection with a proof object for chains that can't introspect their own consensus state. (cosmos#839)

* extend 03-connection with HostConsensusStateProof

* make hostConsensusStateProof optional

* ICS28: Reflect deferred unbonding completion in spec (cosmos#826)

* call UnbondingCanComplete in EndBlock

* update README

* update ics23 link (cosmos#891)

* update eli5 blog post link (cosmos#892)

* ICS28: Sovereign to consumer chain transition (cosmos#840)

* update CreateConsumerClient for sovereign chains

* update InitGenesis for sovereign chains

* establish CCV on ACK and handle preCCV completion

* update Channel Uniqueness Correctness Reasoning

* add pre-CCV module interface with staking

* add clarifications

* add overview TODO

* fix pendingChanges bug

* refactor proposal names (cosmos#855)

* Update spec/app/ics-028-cross-chain-validation/system_model_and_properties.md

Co-authored-by: Daniel T <30197399+danwt@users.noreply.github.com>

* enable optimistic opening handshakes

* remove ConsumerAdditionProposal.initialHeight

* handle proposals in BeginBlock

* pass consumer unbonding period via gov proposal

* update channel init overview - wip

* update overview

* update modified date

* add note re. the existing staking module

Co-authored-by: Daniel T <30197399+danwt@users.noreply.github.com>

* ICS28: VSCPackets should have timeout on provider (cosmos#858)

* update CreateConsumerClient for sovereign chains

* update InitGenesis for sovereign chains

* establish CCV on ACK and handle preCCV completion

* update Channel Uniqueness Correctness Reasoning

* add pre-CCV module interface with staking

* add clarifications

* add overview TODO

* fix pendingChanges bug

* refactor proposal names

* add VSC timeout

* refactor proposal names (cosmos#855)

* Update spec/app/ics-028-cross-chain-validation/system_model_and_properties.md

Co-authored-by: Daniel T <30197399+danwt@users.noreply.github.com>

* enable optimistic opening handshakes

* remove ConsumerAdditionProposal.initialHeight

* handle proposals in BeginBlock

* pass consumer unbonding period via gov proposal

* update channel init overview - wip

* update overview

* update modified date

* ICS28: Channel initialization should have a timeout (cosmos#860)

* add init timeout

* fix typo

* add note on timed out channel init

* update vsc timeout as per implementation

Co-authored-by: Daniel T <30197399+danwt@users.noreply.github.com>

* add angbrav as code owner (cosmos#895)

Co-authored-by: Carlos Rodriguez <carlos@interchain.com>

* save progress

* start adding proof generation logic and update graphical_proof.jpg

* rm spec/.DS_Store

Signed-off-by: Jun Kimura <junkxdev@gmail.com>
Co-authored-by: Aditya <adityasripal@gmail.com>
Co-authored-by: Carlos Rodriguez <carlos@interchain.io>
Co-authored-by: Carlos Rodriguez <crodveg@gmail.com>
Co-authored-by: Jun Kimura <junkxdev@gmail.com>
Co-authored-by: Haifeng Xi <haifeng@bianjie.ai>
Co-authored-by: Web3 Philosopher <seunlanlege@gmail.com>
Co-authored-by: Marius Poke <marius.poke@posteo.de>
Co-authored-by: Daniel T <30197399+danwt@users.noreply.github.com>
Co-authored-by: Carlos Rodriguez <carlos@interchain.com>
AdityaSripal added a commit that referenced this pull request Sep 14, 2023
* feat: add spec for multi-hop channels

* chore: naming

* chore: add notes on chain registry

* Polymer/multihop (#1)

* ICS20: Replace Metadata with Memo (#877)

* memo string replacement

* formatting

Co-authored-by: Carlos Rodriguez <carlos@interchain.io>

* ICS9: remove localhost client (#878)

* remove localhost client

* Update CHANGELOG.md

* Update README.md

* fix: update comment about channel state check in `sendPacket` (#865)

* update comment

* typo

* remove comment

Co-authored-by: Carlos Rodriguez <crodveg@gmail.com>

* ICS5: fix releasePort signature (#885)

Signed-off-by: Jun Kimura <junkxdev@gmail.com>

Signed-off-by: Jun Kimura <junkxdev@gmail.com>

* ICS721: Add tokenData to PacketData (#876)

* add tokenData to PacketData; improve TypeScript formatting

* revert else style

* extend 03-connection with a proof object for chains that can't introspect their own consensus state. (#839)

* extend 03-connection with HostConsensusStateProof

* make hostConsensusStateProof optional

* ICS28: Reflect deferred unbonding completion in spec (#826)

* call UnbondingCanComplete in EndBlock

* update README

* update ics23 link (#891)

* update eli5 blog post link (#892)

* ICS28: Sovereign to consumer chain transition (#840)

* update CreateConsumerClient for sovereign chains

* update InitGenesis for sovereign chains

* establish CCV on ACK and handle preCCV completion

* update Channel Uniqueness Correctness Reasoning

* add pre-CCV module interface with staking

* add clarifications

* add overview TODO

* fix pendingChanges bug

* refactor proposal names (#855)

* Update spec/app/ics-028-cross-chain-validation/system_model_and_properties.md

Co-authored-by: Daniel T <30197399+danwt@users.noreply.github.com>

* enable optimistic opening handshakes

* remove ConsumerAdditionProposal.initialHeight

* handle proposals in BeginBlock

* pass consumer unbonding period via gov proposal

* update channel init overview - wip

* update overview

* update modified date

* add note re. the existing staking module

Co-authored-by: Daniel T <30197399+danwt@users.noreply.github.com>

* ICS28: VSCPackets should have timeout on provider (#858)

* update CreateConsumerClient for sovereign chains

* update InitGenesis for sovereign chains

* establish CCV on ACK and handle preCCV completion

* update Channel Uniqueness Correctness Reasoning

* add pre-CCV module interface with staking

* add clarifications

* add overview TODO

* fix pendingChanges bug

* refactor proposal names

* add VSC timeout

* refactor proposal names (#855)

* Update spec/app/ics-028-cross-chain-validation/system_model_and_properties.md

Co-authored-by: Daniel T <30197399+danwt@users.noreply.github.com>

* enable optimistic opening handshakes

* remove ConsumerAdditionProposal.initialHeight

* handle proposals in BeginBlock

* pass consumer unbonding period via gov proposal

* update channel init overview - wip

* update overview

* update modified date

* ICS28: Channel initialization should have a timeout (#860)

* add init timeout

* fix typo

* add note on timed out channel init

* update vsc timeout as per implementation

Co-authored-by: Daniel T <30197399+danwt@users.noreply.github.com>

* add angbrav as code owner (#895)

Co-authored-by: Carlos Rodriguez <carlos@interchain.com>

* save progress

* start adding proof generation logic and update graphical_proof.jpg

* rm spec/.DS_Store

Signed-off-by: Jun Kimura <junkxdev@gmail.com>
Co-authored-by: Aditya <adityasripal@gmail.com>
Co-authored-by: Carlos Rodriguez <carlos@interchain.io>
Co-authored-by: Carlos Rodriguez <crodveg@gmail.com>
Co-authored-by: Jun Kimura <junkxdev@gmail.com>
Co-authored-by: Haifeng Xi <haifeng@bianjie.ai>
Co-authored-by: Web3 Philosopher <seunlanlege@gmail.com>
Co-authored-by: Marius Poke <marius.poke@posteo.de>
Co-authored-by: Daniel T <30197399+danwt@users.noreply.github.com>
Co-authored-by: Carlos Rodriguez <carlos@interchain.com>

* update to ics-033

* start updating channel spec for multihop; add diagram for relayer proof querying

* chore: update spec history

* chore: spacing

* remove TODO comment; per PR feedback, connection proof not require for channel INIT

* add comment to MultihopProof struct making the proof ordering more clear; update proof generation logic to not include the key which should be generated during verification

* add verification proof pseudo code

* add/update multihop proof verification logic

* Update spec/core/ics-004-channel-and-packet-semantics/README.md

Co-authored-by: Aditya <adityasripal@gmail.com>

* Update spec/core/ics-033-multi-hop/README.md

Co-authored-by: Aditya <adityasripal@gmail.com>

* remove consState var to simplify consensusState update assignment

* rename VerifyMultihopConsensusStateProof --> VerifyMultihopConsensusAndConnectionStateProofs to better reflect the function logic; further simplify the function logic and update comments

* simplify multihop proof logic steps further

* Ds/multihop (#4)

update multi-hop diagrams and remove old diagrams

* start updating multihop spec to include client state information in the proof

* check consensus/connection proof lengths immediately

* update spec with latest multihop solution

* remove client state from multihop proofs

* update spec with chanCloseFrozen; fix/update other parts of multihop spec

* revise and update multihop spec details

* add check to match client id in ConnectionEnd with client id in subsequent consensus state key

* fix indentation

* Update spec/core/ics-033-multi-hop/README.md

Co-authored-by: Anca Zamfir <ancazamfir@users.noreply.github.com>

* Update spec/core/ics-033-multi-hop/README.md

Co-authored-by: Anca Zamfir <ancazamfir@users.noreply.github.com>

* Update spec/core/ics-033-multi-hop/README.md

Co-authored-by: Anca Zamfir <ancazamfir@users.noreply.github.com>

* Update spec/core/ics-004-channel-and-packet-semantics/README.md

Co-authored-by: Anca Zamfir <ancazamfir@users.noreply.github.com>

* Update spec/core/ics-004-channel-and-packet-semantics/README.md

Co-authored-by: Anca Zamfir <ancazamfir@users.noreply.github.com>

* Update spec/core/ics-004-channel-and-packet-semantics/README.md

Co-authored-by: Anca Zamfir <ancazamfir@users.noreply.github.com>

* fix typo prevChain --> previousChain

* add comments for connection and multihopConnectionEnd

* Update spec/core/ics-003-connection-semantics/README.md

Co-authored-by: Aditya <adityasripal@gmail.com>

* add frozen channel proof generation logic

* refactor getMaxDelayPeriod to return the time and block delay

* use Identifier type instead of string for connectionHops array

* cleanup proof gen pseudo code

* check proof heights for consensus and connection states during multihop proof generation; use "proofHeight" instead of "keyHeight" for consistency

* Update spec/core/ics-033-multi-hop/README.md

Co-authored-by: Anca Zamfir <ancazamfir@users.noreply.github.com>

* cleanup multihop proof gen pseudo code

* remove trailing whitespace; refactor multihop proof generation and add proof gen helper function descriptions

* add extra info about connectionHops ordering; update proof ordering to match connectionHops (receiver --> sender)

* clarify multi-hop proof verification now that proof ordering matches the connectionHops ordering (receiver --> sender)

* address latest PR feedback

* more pr feedback

* address more multihop PR feedback

* update multi-hop proof query/verification specs and add frozen channel proof logic

* update multi-hop proof diagrams

* wip address latest PR feedback

* add more clarifying comments/explanations and incorporate more PR feedback

---------

Signed-off-by: Jun Kimura <junkxdev@gmail.com>
Co-authored-by: Derek <derek@polymerlabs.org>
Co-authored-by: Aditya <adityasripal@gmail.com>
Co-authored-by: Carlos Rodriguez <carlos@interchain.io>
Co-authored-by: Carlos Rodriguez <crodveg@gmail.com>
Co-authored-by: Jun Kimura <junkxdev@gmail.com>
Co-authored-by: Haifeng Xi <haifeng@bianjie.ai>
Co-authored-by: Web3 Philosopher <seunlanlege@gmail.com>
Co-authored-by: Marius Poke <marius.poke@posteo.de>
Co-authored-by: Daniel T <30197399+danwt@users.noreply.github.com>
Co-authored-by: Carlos Rodriguez <carlos@interchain.com>
Co-authored-by: Anca Zamfir <ancazamfir@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-review Pull requests which are ready for review.
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

ICS28: Sovereign to consumer chain transition ICS28: Handling packets recv on unknown channels
4 participants