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

ICS 04: timeoutChannelUpgrade should write error receipt #986

Closed
colin-axner opened this issue Jun 19, 2023 · 1 comment
Closed

ICS 04: timeoutChannelUpgrade should write error receipt #986

colin-axner opened this issue Jun 19, 2023 · 1 comment
Labels
bug tao Transport, authentication, & ordering layer.

Comments

@colin-axner
Copy link
Contributor

The timeoutChannelUpgrade should write an error receipt upon successfully timing out an upgrade. While not strictly necessary, it potentially reduces handshake steps by 1. In the case of crossing INIT's, 1 side might timeout before the other. If this occurs, without the error receipt, the counterparty would either need to force a error receipt by calling the TRY step or wait for it's own timeout to exceed its deadline.

By writing the error receipt upon timeout, you don't require a TRY to be executed just to obtain an error receipt to cancel the upgrade

In the non-crossing INIT case, such as a single chain calling INIT and then timeout, an error receipt isn't useful, but it should not cause any issues either. In fact, it could simply allow a chain to synchronize upgrade sequences:
chain A, sequence 1, INIT, moves to sequence 2
chain A, timeout, error receipt for sequence 2 written

chain B, INIT, moves to sequence 2
chain B, cancel on error receipt, write error receipt

(without the error receipt written on timeout, chain A would have needed to call TRY to force an error receipt for sequence 2, note chain A could not respond to sequence 2 since it already attempted that sequence for a different upgrade)

chain B, INIT, moves to sequence 3
chain A, TRY, success

@crodriguezvega crodriguezvega added tao Transport, authentication, & ordering layer. bug labels Jun 24, 2023
@crodriguezvega crodriguezvega changed the title timeoutChannelUpgrade should write error receipt ICS 04: timeoutChannelUpgrade should write error receipt Jun 24, 2023
@crodriguezvega
Copy link
Contributor

As it stands now timeoutChannelUpgrade does write an error receipt, but the channel state must be FLUSHING or FLUSHCOMPLETE. Therefore it would not be possible to call timeoutChannelUpgrade after INIT. Since INIT only increments the upgrade sequence and stores the upgrade info, I believe it is fine not to allow to call timeoutChannelUpgrade when the channel state is OPEN, since there is no channel state to revert to. I will then close the issue; please reopen if you think these changes would still be needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug tao Transport, authentication, & ordering layer.
Projects
Status: Backlog
Development

No branches or pull requests

2 participants