Skip to content

#218 Introduce new method for implementing application synchronization loop

Marcin requested to merge mi_new_application_loop into develop
  • Enable context to define loop stages, determining how many blocks can be processed in one turn.
  • Adjust processing based on application distance to the head block.
  • Add 'hive.app_next_iteration' procedure to automatically attach or detach context based on distance to the head block and predefined stages.
  • 'hive.app_next_iteration' returns the range of block numbers to process dynamically.
  • Applications can use the 'hive.get_stage' function to determine the current predefined stage of their context. Based on the stage, applications can perform actions such as enabling or disabling indices.
  • 'hive.app_next_iteration' now issues a 'COMMIT' command. Applications using this new sync loop method should not issue 'COMMIT' within their synchronization loop.
  • The previous method using 'hive.app_next_block' with explicit attach/detach calls remains valid and usable.
  • Mixing the old method with the new 'hive.app_next_iteration' approach will cause undesired behavior and should be avoided.

Here is an MR where hivemind works with the new sync loop: hivemind!701 (merged)

Here is an MR where haf_be uses the HAF with a new sync loop, but still uses old sync method (only HAF version was changed): haf_block_explorer!195

Edited by Marcin

Merge request reports