Proto/AI: validate two denunciations for same delegate level round if op kinds are distinct
This MR is rebased on !11854 (merged)
What
Allow the denunciation of a double attesting even if a double preattesting has already been denounced at the same level and round, and vice versa.
Why
Same as !11826 (merged): adaptive slashing considers double preattesting and double attesting separately when computing the slashing percentage, so it makes sense to make their denunciations independent too.
How
- We need a separate kind for
Double_preattestinginmisbehaviour_repr.mlto be able to distinguish preattesting from attesting when tracking which double signing events have already been denounced. - Then we add a separate
for_double_preattestingfield toStorage.denounced, and fill it according to theMisbehaviour_repr.kind.- During stitching, we set both
for_double_preattestingandfor_double_attestingto the oldfor_double_attestingsince we don't know which operation kind it came from.
- During stitching, we set both
- We also need to update the conflict map
Double_attesting_evidence_mapinvalidate.ml, which is relevant when both denunciations for a double preattestation and a double attestation at the same level and round are both included in the same block, or when both denunciations are in the same mempool. To be able to distinguish between these two kinds of double operation, we add theMisbehaviour.kindto the keys ofDouble_attesting_evidence_map(which is renamed toDouble_operation_evidence_map). (Note: this also makes it possible to insert keys containingDouble_bakinginto the map, but in practice we never insert nor look for such keys.)
Manually testing the MR
CI
Checklist
-
Document the interface of any function added or modified (see the coding guidelines) - [N/A] Document any change to the user interface, including configuration parameters (see node configuration)
-
Provide automatic testing (see the testing guide). -
For new features and bug fixes, add an item in the appropriate changelog ( docs/protocols/alpha.rstfor the protocol and the environment,CHANGES.rstat the root of the repository for everything else).
Edited by Diane Gallois-Wong