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

Fix bug with tracking processing channel msgs #970

Merged
merged 25 commits into from
Sep 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
e22a1a6
add debug output
jtieri Aug 31, 2022
d044b81
add more debug output
jtieri Aug 31, 2022
a21df7f
NEEDS MOAR DEBUG OUTPUT
jtieri Aug 31, 2022
a7f7b8c
test purging MsgTimeout on src vs. counterparty
jtieri Aug 31, 2022
15fed43
reverse channel close msg purging
jtieri Aug 31, 2022
048a28d
don't delete channel close msgs until another iteration in getUnrelay…
jtieri Aug 31, 2022
a2c7df3
add debug output
jtieri Aug 31, 2022
beb4fc5
add more debug output
jtieri Aug 31, 2022
6629f57
NEEDS MOAR DEBUG OUTPUT
jtieri Aug 31, 2022
035a5a6
test purging MsgTimeout on src vs. counterparty
jtieri Aug 31, 2022
57240a4
reverse channel close msg purging
jtieri Aug 31, 2022
9ad0abf
don't delete channel close msgs until another iteration in getUnrelay…
jtieri Aug 31, 2022
9648747
reverse channel close msg purging
jtieri Aug 31, 2022
635903e
don't delete channel close msgs until another iteration in getUnrelay…
jtieri Aug 31, 2022
940a8b5
Merge remote-tracking branch 'origin/justin/ica-debug' into justin/ic…
jtieri Aug 31, 2022
7cee464
undo previous changes regarding purging cache on max retries
jtieri Aug 31, 2022
1dc8f24
undo more changes made in shouldSendChannelMessage
jtieri Aug 31, 2022
45a3438
more undo
jtieri Aug 31, 2022
99981d8
add debug output on msg send and channel cache purge
jtieri Aug 31, 2022
968a2d0
add debug output
jtieri Aug 31, 2022
c66a2c2
remove pointless log
jtieri Aug 31, 2022
af77967
add logs in process latest msgs
jtieri Aug 31, 2022
add0d5a
more logs
jtieri Aug 31, 2022
386fa2a
logs
jtieri Sep 1, 2022
c4410b0
remove all debug logs and implement fix for tracking processing packe…
jtieri Sep 2, 2022
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
2 changes: 1 addition & 1 deletion relayer/processor/path_end_runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ func (pathEnd *pathEndRuntime) mergeMessageCache(messageCache IBCMessagesCache,
}
// can complete channel handshakes on this client
// since PathProcessor holds reference to the counterparty chain pathEndRuntime.

if eventType == chantypes.EventTypeChannelOpenInit {
// CounterpartyConnectionID is needed to construct MsgChannelOpenTry.
for k := range pathEnd.connectionStateCache {
Expand All @@ -145,6 +144,7 @@ func (pathEnd *pathEndRuntime) mergeMessageCache(messageCache IBCMessagesCache,
if len(newCmc) == 0 {
continue
}

channelHandshakeMessages[eventType] = newCmc
}
pathEnd.messageCache.ChannelHandshake.Merge(channelHandshakeMessages)
Expand Down
5 changes: 1 addition & 4 deletions relayer/processor/path_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,7 @@ func (pp *PathProcessor) channelPairs() []channelPair {
}
pairs := make([]channelPair, len(channels))
i := 0
for k, open := range channels {
if !open {
continue
}
for k, _ := range channels {
pairs[i] = channelPair{
pathEnd1ChannelKey: k,
pathEnd2ChannelKey: k.Counterparty(),
Expand Down
16 changes: 7 additions & 9 deletions relayer/processor/path_processor_internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ MsgTransferLoop:
},
}

if pathEndPacketFlowMessages.Src.shouldSendChannelMessage(closeChan, pathEndPacketFlowMessages.Dst) {
if pathEndPacketFlowMessages.Dst.shouldSendChannelMessage(closeChan, pathEndPacketFlowMessages.Src) {
res.DstChannelMessage = append(res.DstChannelMessage, closeChan)
}
} else {
Expand Down Expand Up @@ -160,14 +160,7 @@ MsgTransferLoop:
res.ToDeleteSrc[chantypes.EventTypeAcknowledgePacket] = append(res.ToDeleteSrc[chantypes.EventTypeAcknowledgePacket], ackSeq)
}
for timeoutSeq, msgTimeout := range pathEndPacketFlowMessages.SrcMsgTimeout {
if msgTimeout.ChannelOrder == chantypes.ORDERED.String() {
if pathEndPacketFlowMessages.DstMsgChannelCloseConfirm != nil {
// For ordered channel packets, flow is not done until channel-close-confirm is observed.
res.ToDeleteDstChannel[chantypes.EventTypeChannelCloseConfirm] = append(res.ToDeleteDstChannel[chantypes.EventTypeChannelCloseConfirm], pathEndPacketFlowMessages.ChannelKey.Counterparty())
res.ToDeleteSrc[chantypes.EventTypeSendPacket] = append(res.ToDeleteSrc[chantypes.EventTypeSendPacket], timeoutSeq)
res.ToDeleteSrc[chantypes.EventTypeTimeoutPacket] = append(res.ToDeleteSrc[chantypes.EventTypeTimeoutPacket], timeoutSeq)
}
} else {
if msgTimeout.ChannelOrder != chantypes.ORDERED.String() {
res.ToDeleteSrc[chantypes.EventTypeSendPacket] = append(res.ToDeleteSrc[chantypes.EventTypeSendPacket], timeoutSeq)
res.ToDeleteSrc[chantypes.EventTypeTimeoutPacket] = append(res.ToDeleteSrc[chantypes.EventTypeTimeoutPacket], timeoutSeq)
}
Expand All @@ -176,6 +169,7 @@ MsgTransferLoop:
res.ToDeleteSrc[chantypes.EventTypeSendPacket] = append(res.ToDeleteSrc[chantypes.EventTypeSendPacket], timeoutOnCloseSeq)
res.ToDeleteSrc[chantypes.EventTypeTimeoutPacketOnClose] = append(res.ToDeleteSrc[chantypes.EventTypeTimeoutPacketOnClose], timeoutOnCloseSeq)
}

return res
}

Expand Down Expand Up @@ -980,10 +974,14 @@ func (pp *PathProcessor) packetMessagesToSend(
pathEnd2ChannelMessage = append(pathEnd2ChannelMessage, pathEnd1ProcessRes[i].DstChannelMessage...)

pp.pathEnd1.messageCache.ChannelHandshake.DeleteMessages(pathEnd2ProcessRes[i].ToDeleteDstChannel)
pp.pathEnd1.channelProcessing.deleteMessages(pathEnd2ProcessRes[i].ToDeleteDstChannel)

pp.pathEnd2.messageCache.ChannelHandshake.DeleteMessages(pathEnd1ProcessRes[i].ToDeleteDstChannel)
pp.pathEnd2.channelProcessing.deleteMessages(pathEnd1ProcessRes[i].ToDeleteDstChannel)

pp.pathEnd1.messageCache.PacketFlow[channelPair.pathEnd1ChannelKey].DeleteMessages(pathEnd1ProcessRes[i].ToDeleteSrc, pathEnd2ProcessRes[i].ToDeleteDst)
pp.pathEnd2.messageCache.PacketFlow[channelPair.pathEnd2ChannelKey].DeleteMessages(pathEnd2ProcessRes[i].ToDeleteSrc, pathEnd1ProcessRes[i].ToDeleteDst)

pp.pathEnd1.packetProcessing[channelPair.pathEnd1ChannelKey].deleteMessages(pathEnd1ProcessRes[i].ToDeleteSrc, pathEnd2ProcessRes[i].ToDeleteDst)
pp.pathEnd2.packetProcessing[channelPair.pathEnd2ChannelKey].deleteMessages(pathEnd2ProcessRes[i].ToDeleteSrc, pathEnd1ProcessRes[i].ToDeleteDst)
}
Expand Down