From 4bf5d241e59db8d9ee349b7847aecc0212f42d48 Mon Sep 17 00:00:00 2001 From: Carlos Rodriguez Date: Mon, 31 Jul 2023 00:15:19 +0200 Subject: [PATCH 1/2] fix connection hops --- spec/core/ics-004-channel-and-packet-semantics/UPGRADES.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/spec/core/ics-004-channel-and-packet-semantics/UPGRADES.md b/spec/core/ics-004-channel-and-packet-semantics/UPGRADES.md index 1fa5567c5..20e9e36d6 100644 --- a/spec/core/ics-004-channel-and-packet-semantics/UPGRADES.md +++ b/spec/core/ics-004-channel-and-packet-semantics/UPGRADES.md @@ -825,12 +825,16 @@ function chanUpgradeOpen( // get upgrade since counterparty should have upgraded to these parameters upgrade = provableStore.get(channelUpgradePath(portIdentifier, channelIdentifier)) + // get the counterparty's connection hops for the proposed upgrade connection + proposedConnection = provableStore.get(connectionPath(upgrade.fields.connectionHops)) + counterpartyHops = [proposedConnection.counterpartyConnectionIdentifier] + counterpartyChannel = ChannelEnd{ state: OPEN, ordering: upgrade.fields.ordering, counterpartyPortIdentifier: portIdentifier, counterpartyChannelIdentifier: channelIdentifier, - connectionHops: upgrade.fields.connectionHops, + connectionHops: counterpartyHops, version: upgrade.fields.version, sequence: channel.upgradeSequence, } From f7b92cc52a5179d704cd342c6a85b3c206555cf2 Mon Sep 17 00:00:00 2001 From: Carlos Rodriguez Date: Mon, 31 Jul 2023 09:49:31 +0200 Subject: [PATCH 2/2] add clarification to comment --- spec/core/ics-004-channel-and-packet-semantics/UPGRADES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/core/ics-004-channel-and-packet-semantics/UPGRADES.md b/spec/core/ics-004-channel-and-packet-semantics/UPGRADES.md index 20e9e36d6..9d1849f89 100644 --- a/spec/core/ics-004-channel-and-packet-semantics/UPGRADES.md +++ b/spec/core/ics-004-channel-and-packet-semantics/UPGRADES.md @@ -965,7 +965,7 @@ function timeoutChannelUpgrade( // counterparty channel must be proved to not have completed flushing after timeout has passed abortTransactionUnless(counterpartyChannel.state !== FLUSHCOMPLETE) - // if counterparty channel state is OPEN, we should abort + // if counterparty channel state is OPEN, we should abort the tx // only if the counterparty has successfully completed upgrade if counterpartyChannel.state === OPEN { // get upgrade since counterparty should have upgraded to these parameters