Skip to content

Commit

Permalink
use counterparty key for remove packet retention
Browse files Browse the repository at this point in the history
  • Loading branch information
agouin committed Feb 1, 2024
1 parent a782141 commit 8b7184b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion relayer/processor/path_end_runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,7 @@ func (pathEnd *pathEndRuntime) removePacketRetention(
toDelete[preInitKey] = []uint64{sequence}
case chantypes.EventTypeRecvPacket:
toDelete[eventType] = []uint64{sequence}
toDelete[chantypes.EventTypeWriteAck] = []uint64{sequence}
toDeleteCounterparty[chantypes.EventTypeSendPacket] = []uint64{sequence}
case chantypes.EventTypeAcknowledgePacket:
toDelete[eventType] = []uint64{sequence}
Expand All @@ -625,13 +626,15 @@ func (pathEnd *pathEndRuntime) removePacketRetention(
toDelete[eventType] = []uint64{sequence}
toDelete[chantypes.EventTypeSendPacket] = []uint64{sequence}
}

// delete in progress send for this specific message
pathEnd.packetProcessing[k].deleteMessages(map[string][]uint64{
eventType: {sequence},
})

// delete all packet flow retention history for this sequence
pathEnd.messageCache.PacketFlow[k].DeleteMessages(toDelete)
counterparty.messageCache.PacketFlow[k].DeleteMessages(toDeleteCounterparty)
counterparty.messageCache.PacketFlow[k.Counterparty()].DeleteMessages(toDeleteCounterparty)
}

// shouldSendConnectionMessage determines if the connection handshake message should be sent now.
Expand Down

0 comments on commit 8b7184b

Please sign in to comment.