Skip to content

Commit

Permalink
query for ibc header if trusted consensus height is zero. (cosmos#857)
Browse files Browse the repository at this point in the history
  • Loading branch information
agouin authored Jul 19, 2022
1 parent f39f61b commit 88d38b9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion relayer/processor/path_processor_internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,8 @@ func (pp *PathProcessor) assembleMsgUpdateClient(ctx context.Context, src, dst *
// the latest block, we cannot send a MsgUpdateClient until another block is observed on the counterparty.
// If the client state height is in the past, beyond ibcHeadersToCache, then we need to query for it.
if !trustedConsensusHeight.EQ(clientConsensusHeight) {
if int64(clientConsensusHeight.RevisionHeight)-int64(trustedConsensusHeight.RevisionHeight) <= clientConsensusHeightUpdateThresholdBlocks {
deltaConsensusHeight := int64(clientConsensusHeight.RevisionHeight) - int64(trustedConsensusHeight.RevisionHeight)
if trustedConsensusHeight.RevisionHeight != 0 && deltaConsensusHeight <= clientConsensusHeightUpdateThresholdBlocks {
return nil, fmt.Errorf("observed client trusted height: %d does not equal latest client state height: %d",
trustedConsensusHeight.RevisionHeight, clientConsensusHeight.RevisionHeight)
}
Expand Down

0 comments on commit 88d38b9

Please sign in to comment.