From db1b4d3b504b56c061666f2d924c9926d1180817 Mon Sep 17 00:00:00 2001 From: mmsqe Date: Wed, 1 May 2024 09:36:02 +0800 Subject: [PATCH] fix: avoid packet message get removed before open channel --- CHANGELOG.md | 1 + relayer/processor/path_end_runtime.go | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 65a5dd6e42..fddb119740 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ * [\#1326](https://github.com/cosmos/relayer/pull/1326) Avoid sending channel close confirm message after channel get closed successfully. * [\#1364](https://github.com/cosmos/relayer/pull/1364) Include feegrant message when calculate gas. * [\#1390](https://github.com/cosmos/relayer/pull/1390) Avoid no concrete type registered for type URL error of EthAccount. +* [\#](https://github.com/cosmos/relayer/pull/) Allow retry for pathEnd to avoid packet message get removed before open channel. ## v0.9.3 diff --git a/relayer/processor/path_end_runtime.go b/relayer/processor/path_end_runtime.go index 687553eb64..412c0dcfca 100644 --- a/relayer/processor/path_end_runtime.go +++ b/relayer/processor/path_end_runtime.go @@ -59,6 +59,7 @@ type pathEndRuntime struct { metrics *PrometheusMetrics finishedProcessing chan messageToTrack + retryCount uint64 } func newPathEndRuntime(log *zap.Logger, pathEnd PathEnd, metrics *PrometheusMetrics) *pathEndRuntime { @@ -560,7 +561,11 @@ func (pathEnd *pathEndRuntime) shouldSendPacketMessage(message packetIBCMessage, zap.Uint64("sequence", sequence), zap.Inline(k), ) - pathEnd.removePacketRetention(counterparty, eventType, k, sequence) + pathEnd.retryCount++ + if pathEnd.retryCount >= maxMessageSendRetries { + pathEnd.removePacketRetention(counterparty, eventType, k, sequence) + pathEnd.retryCount = 0 + } return false } msgProcessCache, ok := pathEnd.packetProcessing[k]