Vigilante makes an unnecessary report to Babylon
Description
The vigilante module's atomicslasher component detects selective slashing by finality providers. It does this in the following way:
In every block, it searches for transaction hashes that match tracked delegation slashing TX hashes.
If one is found, it treats it as selective slashing anyway and reports it to the Babylon chain using the
MsgSelectiveSlashingEvidencemessage.
This works fine because there are only two scenarios here:
The finality provider actually selectively slashed a delegator, in which case the
MsgSelectiveSlashingEvidenceexecution on Babylon will succeed.The finality provider equivocated and was slashed previously, in which case the
MsgSelectiveSlashingEvidenceexecution on Babylon will revert because the FP will have already been slashed on Babylon through theMsgAddFinalitySighandler + the BeginBlocker.
Impact
The issue here is that the vigilante technically does not need to report the evidence in the second case, because the finality provider has already been slashed due to a different offence.
This leads to the vigilante essentially wasting gas trying to report to Babylon.
Since the vigilante is run by Babylon validators and finality providers, they end up losing some gas, which we will assume is medium in severity.
However, this issue will not occur often. Finality providers are not expected to perform an equivocation offence often, and so the likelihood of this occurring is low.
Therefore, the impact from this issue is also considered to be low.
Recommendations
Add a check to the vigilante's atomicslasher component. Ensure that the finality provider being reported has not already been slashed prior to reporting selective slashing evidence to Babylon.
Remediation
Tracked by https://github.com/babylonchain/vigilante/issues/224↗