Skip to content

Proto: Split check endorsement_rights in 2 functions

Context

Baking.check_endorsement_rights checked all the aspect of the validity of an endorsement for an endorsement at any level. Among them, checking that the given slot is the minimal one requires to compute all the endorsement slots of the given level which is problematically expensive for endorsements that will later be rejected because they don't endorse the "current_level".

This MR cuts check_endorsement_rights in 2: the (not so expensive) checks that have to be made before checking the level of the endorsement is current head and the check of the slot/the computation of endorsing_power of the endorsement relevant only for the current level (and actually cheaper to compute in that case because cached in the context!)

This MR also removes the deprecated RPC POST .../endorsing_powers which is useless (and not used by clients) since the introduction of slots in endorsements.

Finally, a last semantic change is that Double_endorsement_evidence used to be valid only if they mentioned the smallest slot owned by the delegate, now any slot is OK. This has been discussed and considered as a feature but please raise your voice if you have a conter argument.

Manually testing the MR

Make a proof of semantic equivalence of apply_operation! :-p

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.rst for the protocol and the environment, the Development Version section of CHANGES.md for everything else).
  • Select suitable reviewers using the Reviewers field below.
  • Select as Assignee the next person who should take action on that MR

Merge request reports