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 (upgrades): fix counterparty connection hops in chanUpgradeOpen #1008

Merged
Changes from all commits
Commits
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
8 changes: 6 additions & 2 deletions spec/core/ics-004-channel-and-packet-semantics/UPGRADES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down Expand Up @@ -961,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
Expand Down