[go: up one dir, main page]

Proto/AI/validate: allow denunciations about same delegate, same level, but distinct rounds

What

Let the protocol validate and apply several denunciations about the same delegate and same level, as long as the rounds are different.

Why

This makes the validation of operations more consistent with Adaptive Slashing, in which events that happen at the same level but distinct rounds are considered separately.

How

The storage map which is used to prevent duplicate denunciations was indexed by level and delegate; it is now indexed by round too.

This requires converting the keys during the migration from Oxford. During this stitching, existing denunciations are assigned the round 0, because greater rounds are rare. Warning: if a delegate double bakes or double attests a block at round 1 or higher during the last cycle before the activation of P, there is a risk that they get slashed twice for this, once during the last cycle of Oxford and once during the first cycle of P. --> this is fixed in !11898 (merged)

This MR also renames Storage.Slashed_deposits to Storage.Already_denounced to stress that this is about witnessing denunciation operations even if the slashing of the deposits has not been applied yet, and to prevent a possible confusion with Storage.Contract.Slashed_deposits.

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