Closed cmjc closed 5 months ago
Originally raised in autonity
repo - transferred here per comment by @Jason-Zhangxin-Chen , see closed issue https://github.com/autonity/autonity/issues/954
Hi @cmjc, from your context, rule NO. 10 is not defined in the rule set:
// Must match autonity/types.go enum Rule { PN, PO, PVN, PVO, PVO12, C, C1,
InvalidProposal, // The value proposed by proposer cannot pass the blockchain's validation.
InvalidProposer, // A proposal sent from none proposer nodes of the committee.
Equivocation // Multiple distinguish votes(proposal, prevote, precommit) sent by validator.
}
// @dev return true if sending the event can lead to slashing
function canSlash(address _offender, Rule _rule, uint256 _block) public view returns (bool) {
uint256 _severity = _ruleSeverity(_rule);
uint256 _epoch = autonity.getEpochFromBlock(_block);
return slashingHistory[_offender][_epoch] < _severity ;
}
>As the typing system limits the input of _rule should be a type of Rule, from inside the canSlash funtion we cannot capture such error. Thus from AUT tool side, we can do some check on it. This issue so move to Aut tool.
@cmjc I'm not satisfied that this is an autcli issue and so I'm reopening the original ticket.
Description
Calling
canSlash
with autcli to see if a validator is slashable:returns reverted, but without a revert reason:
If calling
getValidatorAccusation
and there are no accusations, a revert reason ofno accusation
is returned:System Information
Rationale
Returning a revert reason would be more informative to the user.