From 136aa935768913304594dad0ca0afd542e67d225 Mon Sep 17 00:00:00 2001 From: izyak Date: Thu, 10 Aug 2023 15:19:04 +0545 Subject: [PATCH] fix: timeout not being called on cosmos because of requestTimeout on icon --- relayer/chains/wasm/tx.go | 1 - relayer/processor/path_end_runtime.go | 6 +++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/relayer/chains/wasm/tx.go b/relayer/chains/wasm/tx.go index fdd7f7581..711fe02ee 100644 --- a/relayer/chains/wasm/tx.go +++ b/relayer/chains/wasm/tx.go @@ -214,7 +214,6 @@ func (ap *WasmProvider) ValidatePacket(msgTransfer provider.PacketInfo, latest p revisionNumber := 0 latestClientTypesHeight := clienttypes.NewHeight(uint64(revisionNumber), latest.Height) if !msgTransfer.TimeoutHeight.IsZero() && latestClientTypesHeight.GTE(msgTransfer.TimeoutHeight) { - fmt.Println("packet timeout failed finally ", msgTransfer.TimeoutHeight) return provider.NewTimeoutHeightError(latest.Height, msgTransfer.TimeoutHeight.RevisionHeight) } diff --git a/relayer/processor/path_end_runtime.go b/relayer/processor/path_end_runtime.go index d4a8445aa..c81e2c19f 100644 --- a/relayer/processor/path_end_runtime.go +++ b/relayer/processor/path_end_runtime.go @@ -450,6 +450,10 @@ func (pathEnd *pathEndRuntime) shouldSendPacketMessage(message packetIBCMessage, pathEndForHeight = pathEnd } + if eventType == chantypes.EventTypeTimeoutPacket && IsBTPLightClient(pathEnd.clientState) { + pathEndForHeight = counterparty + } + if message.info.Height >= pathEndForHeight.latestBlock.Height { pathEnd.log.Debug("Waiting to relay packet message until counterparty height has incremented", zap.String("event_type", eventType), @@ -462,7 +466,7 @@ func (pathEnd *pathEndRuntime) shouldSendPacketMessage(message packetIBCMessage, } // allow to send only counterparty chain has consensusState - if IsBTPLightClient(pathEnd.clientState) && common.EventRequiresClientUpdate[message.eventType] == true { + if IsBTPLightClient(pathEnd.clientState) && common.EventRequiresClientUpdate[eventType] { if pathEnd.clientState.ConsensusHeight.RevisionHeight < message.info.Height { pathEnd.log.Debug("Waiting to relay packet message until clientState is updated", zap.Inline(message),