Proto/Scoru: re-design the way the proof sliding window is handled
Context
Related to #2981 (closed)
This MR re-designs the way the proof sliding window is handled in the inbox. This is done by:
- Adding a field
sizeto track the number of elements in the history structure - Adding a field
oldest_indexto track the oldest entry that has been added to the history (and that is still present there) - Adapting the
rememberfunction to add new entries and GC old one when the structure "overflows" correctly - Adapting the
history_hashesfunction used for test to return the entries' hashes in the correct insertion order.
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
Edited by Mohamed IGUERNLALA