ICS 04(upgrades): missing setting counterparty's last packet sent
Closed this issue · 0 comments
crodriguezvega commented
In chanUpgradeAck
and chanUpgradeConfirm
we miss setting the counterparty's last packet sent in the private store. Something like this:
// store counterparty's sequence number of last packet sent
privateStore.set(
channelCounterpartyLastPacketSequencePath(portIdentifier, channelIdentifier),
counterpartyUpgrade.lastPacketSent
)
This is needed so that in recvPacket
it is possible to check that we receive packets that have been sent before the last packet sent by the counterparty:
counterpartyLastPacketSent = privateStore.get(channelCounterpartyLastPacketSequencePath(packet.destPort, packet.destChannel)
abortTransactionUnless(channel.state === OPEN || (channel.state === FLUSHING && packet.sequence <= counterpartyLastPacketSent))