Skip to content

Draft: Shell/Prevalidator: Different operations precheck/prevalidation strategies

Context

This MR is a follow-up of !4026 (merged). It aims at introducing different strategies (currently four) for operations selection/precheck/prevalidation in the mempool.

  • Originally, operations were selected (by batches of 50) from a map ordered by operations' hashes.
  • With MR !4026 (merged), operations selection is prioritization by their validation pass (so consensus operations are selected first)
  • This MR generalizes this and introduces four distinct methods to select batchs of operations to precheck/(pre)validate in the mempool:
    • PrioByVPass: We select as much as possible of operations from lower validation passes before selecting from higher passes if limit is not reached
    • Fairness: We select approximately the same number of operations from each valitation pass
    • WeightedByBPass: Lower validation passes are favored: we select 2 more operations from validation passe N than from validation pass N+1
    • Consensus: We only select consensus operations. Other validation passes are ignored

The last strategy may for instance be interesting for Tenderbake: Deploy some nodes and activate this strategy to process and propagate consensus operations faster.

Related issues: #1790 (closed)

Manually Testing the MR

Some benchmarking will be done with the upcoming reset of idiazabelnet.

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
Edited by Mohamed IGUERNLALA

Merge request reports