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.
The issue lies within this function processMessages when
needsClientUpdate
andmp.msgUpdateClient
are not synchronized with each other, specifically, there can be a scenario whereneedsClientUpdate
istrue
andmp.msgUpdateClient
isnil
. 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.