Skip to content

Draft: pacemaker plugin

Andrzej Lisak requested to merge abw_pacemaker into develop

It is a basic substitute for not yet implemented mock-peer tool. The plugin can only pull blocks from separate block log and pass them to node as if they arrived from p2p. Works only in testnet and only when there is just one pacemaker and no witness plugin in whole network.

Draft: only very basic tests were run with it, so it should be treated as experiment.

How to use:

  • you need separate block_log file and associated block_log.artifacts to act as a source of blocks
  • add plugin = pacemaker to config.ini and make sure there is no witness
  • add pacemaker-source = <SOURCE_BLOCK_LOG_PATH> pointing to above mentioned block_log
  • you can also add pacemaker-min-offset = <OFFSET_FROM_BLOCK_TS> - pacemaker will wait until block.timestamp + min_offset before emitting the block; default value is -300 meaning blocks can be emitted up to -300ms before their timestamp (which is typical value for healthy network) but you can emulate lagging node by setting the value to some big positive number
  • you can add pacemaker-max-offset = <OFFSET_FROM_BLOCK_TS> - pacemaker will stop the node in case it didn't manage to emit the block before block.timestamp + max_offset indicating either wrong starting time (when it happens on startup) or too big processing lag (when it happens later); default value is 20000 which is 20 seconds
  • you have to run the node with faketime setting time prior to first_block_to_emit.timestamp + max_offset; if time is too early, the node will idly wait until the time is right (see log message: First block to emit is #<BLOCK_NUM> with timestamp <BLOCK_TS>; Current time: <TIME>); for this reason it is better to be a bit late (but not too much or the node will fail on startup), because pacemaker will try to catch up by emitting blocks at max processing speed (emulating "sync mode")

Merge request reports