Submitted by ciphermarco (1, 2), also found by deliriusz, and zhaojie
The message functions for certain types of voting allow only successful observation votes. This creates a problem if a compromised or faulty observer creates spam ballots with false observations. In this situation, honest observers have to spend resources processing the ballot but cannot cast an opposite vote to slash the spammer when the ballot reaches maturity.
Theoritically, a similar situation could happen with all ballots that do not reach the threshold. But in non-vulnerable cases, honest observer can cast an opposite vote to make the ballot reach threshold and be accounted for slashing. The real issue comes when honest observers cannot cast the honest opposite vote.
For certain types of votes, the only vote that is possible to be cast is an VoteType_SuccessObservation.
A compromised or faulty observer can then create ballots for spam observations that do not exist, and honest observers can never vote for the opposite option. Since the ballots threshold will never be reached, the ballot will remain with the status BallotStatus_BallotInProgress.
Eventually, the ballot will be processed when the DistributeObserverRewards function gathers the list of matured ballots.
But, since BuildRewardsDistribution does not account for ballots with status BallotStatus_BallotInProgress, the ballot spammer will have a totalRewardUnits == 0 instead of a negative value. This way, no slashing will be executed as a punishment for the false observation, but observers will have to process the spam observation ballot anyway.
The compromised observer is then free to create as many false observation ballots as he wishes, effectively spamming the network and draining honest observers resources without a punishment.
Besides wasting network participants execution resources, the ballots are never deleted from storage after the distribution. But there is a comment evidencing this is an obviously known issue and, thus, included as merely a reminder in this report.
Similarly to what happens in other types of votes, allow honest observers to cast a negative observation vote if they wish. Thus, when the ballot reaches maturity and is processed for reward distribution, the dishonest or faulty observer is slashed to pay for any resources spent with the false observation.
This is how msg_tss_voter.go and keeper_cross_chain_tx_vote_outbound_tx.go work:
Special attention must be give to ensure the corrected voting types Digest function output is generalised for all types of votes. Similarly to what is done with MsgVoteOnObservedOutboundTx.
lumtis (ZetaChain) acknowledged
