Skip to content

Draft: prevalidator: test recycle_operations

Fixes #1833 (closed)

Context

We are working on adding unit tests to the mempool, i.e. src/lib_shell/prevalidator.ml. Previous work on this topic includes !3380 (merged), !3483 (merged), and !3499 (merged). This MR continues this work by going up in the call hierarchy, i.e. by testing the largest shell subset of on_flush: recycle_operations. This MR tests:

  1. The specification of recyle_operations i.e. from which where returned operations come: the classification, the result of handle_live_operations and the pending operations. This is test test_recycle_operations_classification.
  2. That the classification is correctly trimmed: test test_recycle_operations_classification

What we don't do in this MR:

  • Refactor handle_live_operations so that it doesn't pass old_mempool around. This can be done by a union in its caller. This will be done in another MR.

Manually testing the MR

  • dune exec src/lib_shell/test/test_prevalidator_classification_recycle_operations.exe
  • I have successfully executed the tests on f66dfcfd with count=50_000

Checklist

  • NA Document the interface of any function added or modified (see the coding guidelines)
  • NA Document any change to the user interface, including configuration parameters (see node configuration)
  • Provide automatic testing (see the testing guide).
  • NA 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 Clément Hurlin

Merge request reports