Proto: mempool check for consensus vote's minimal slots
What
Under aggregate_attestation feature flag, the mempool is computing each delegate minimal slots when flushing and use this pre-computed data structure to refuse consensus operations with non-minimal slots.
Note that computing minimal slots for all 3 allowed levels takes around 15ms on my laptop (m3 macbook).
Why
It is necessary to prevent a malicious peer to flood the network with consensus operations with non-minimal slots. The previous solution to prevent this behaviour was to slash delegates sending consensus operations with non-minimal slots. Since we are removing slots from the signed payload for consensus operations signed by BLS keys, we cannot rely on this solution anymore.
This requirement is temporary and won't be necessary once "all baker attest all block" is activated.
Closes #7652 (closed)
How
Manually testing the MR
Checklist
-
Document the interface of any function added or modified (see the coding guidelines) -
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). -
Select suitable reviewers using the Reviewersfield below. -
Select as Assigneethe next person who should take action on that MR