Skip to content

Commit

Permalink
fix: timeout not being called on cosmos because of requestTimeout on …
Browse files Browse the repository at this point in the history
…icon
  • Loading branch information
izyak committed Aug 10, 2023
1 parent 2fc35ae commit 136aa93
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 0 additions & 1 deletion relayer/chains/wasm/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
6 changes: 5 additions & 1 deletion relayer/processor/path_end_runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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),
Expand Down

0 comments on commit 136aa93

Please sign in to comment.