cosmos / relayer

An IBC relayer for ibc-go
Apache License 2.0
390 stars 1.71k forks source link

Inconsistency between needsClientUpdate and mp.msgUpdateClient resulting in potential nil message issue #1405

Closed LeTrongDat closed 8 months ago

LeTrongDat commented 9 months ago

The issue lies within this function processMessages when needsClientUpdate and mp.msgUpdateClient are not synchronized with each other, specifically, there can be a scenario where needsClientUpdate is true and mp.msgUpdateClient is nil. The reason is that in the function assembleMsgUpdateClient, it uses the condition !trustedConsensusHeight.EQ(clientConsensusHeight) however, this condition is absent in shouldUpdateClientNow. This leads to the scenario in trackAndSendMessages where it will call mp.sendClientUpdate with a nil msg.