From 120c29a732d38c3d7934f4d457a722f744757b72 Mon Sep 17 00:00:00 2001 From: chatton Date: Wed, 29 Nov 2023 11:31:30 +0000 Subject: [PATCH 1/2] chore: added docstring with state explainations --- modules/core/04-channel/keeper/upgrade.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/core/04-channel/keeper/upgrade.go b/modules/core/04-channel/keeper/upgrade.go index 68666acb8c6..e0581c7d355 100644 --- a/modules/core/04-channel/keeper/upgrade.go +++ b/modules/core/04-channel/keeper/upgrade.go @@ -211,6 +211,11 @@ func (k Keeper) WriteUpgradeTryChannel(ctx sdk.Context, portID, channelID string // This method should only be called by the IBC core msg server. // This method will verify that the counterparty has called the ChanUpgradeTry handler. // and that its own upgrade is compatible with the selected counterparty version. +// NOTE: the channel may be in either the OPEN or FLUSHING state. +// The channel may be in OPEN if we are in the happy path. +// A -> Init (OPEN), B -> Try (FLUSHING), A -> Ack (begins in OPEN) +// The channel may be in FLUSHING if we are in a crossing hellos situation. +// A -> Init (OPEN), B -> Init (OPEN) -> A -> Try (FLUSHING), B -> Try (FLUSHING), A -> Ack (begins in FLUSHING) func (k Keeper) ChanUpgradeAck( ctx sdk.Context, portID, From 09083bb41610b93edd8a340a860b8d896853b1c4 Mon Sep 17 00:00:00 2001 From: chatton Date: Wed, 29 Nov 2023 12:48:49 +0000 Subject: [PATCH 2/2] chore: fix linter --- modules/core/04-channel/keeper/upgrade.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/core/04-channel/keeper/upgrade.go b/modules/core/04-channel/keeper/upgrade.go index e0581c7d355..7d54724f762 100644 --- a/modules/core/04-channel/keeper/upgrade.go +++ b/modules/core/04-channel/keeper/upgrade.go @@ -213,9 +213,12 @@ func (k Keeper) WriteUpgradeTryChannel(ctx sdk.Context, portID, channelID string // and that its own upgrade is compatible with the selected counterparty version. // NOTE: the channel may be in either the OPEN or FLUSHING state. // The channel may be in OPEN if we are in the happy path. -// A -> Init (OPEN), B -> Try (FLUSHING), A -> Ack (begins in OPEN) +// +// A -> Init (OPEN), B -> Try (FLUSHING), A -> Ack (begins in OPEN) +// // The channel may be in FLUSHING if we are in a crossing hellos situation. -// A -> Init (OPEN), B -> Init (OPEN) -> A -> Try (FLUSHING), B -> Try (FLUSHING), A -> Ack (begins in FLUSHING) +// +// A -> Init (OPEN), B -> Init (OPEN) -> A -> Try (FLUSHING), B -> Try (FLUSHING), A -> Ack (begins in FLUSHING) func (k Keeper) ChanUpgradeAck( ctx sdk.Context, portID,