[go: up one dir, main page]

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_preattesting in misbehaviour_repr.ml to be able to distinguish preattesting from attesting when tracking which double signing events have already been denounced.
  • Then we add a separate for_double_preattesting field to Storage.denounced, and fill it according to the Misbehaviour_repr.kind.
    • During stitching, we set both for_double_preattesting and for_double_attesting to the old for_double_attesting since we don't know which operation kind it came from.
  • We also need to update the conflict map Double_attesting_evidence_map in validate.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 the Misbehaviour.kind to the keys of Double_attesting_evidence_map (which is renamed to Double_operation_evidence_map). (Note: this also makes it possible to insert keys containing Double_baking into 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.rst for the protocol and the environment, CHANGES.rst at the root of the repository for everything else).
Edited by Diane Gallois-Wong

Merge request reports

Loading