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: timeout not being called on cosmos because of requestTimeout on icon #134

Merged
merged 1 commit into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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