Skip to content

Optimized flow of block processing and block statistics

Andrzej Lisak requested to merge abw_block_flow_control into develop

The change contains remaining optimizations from experiments in !451 (closed) as well as code for collecting block statistics. As usual it is the best to review the changes commit by commit (almost each commit should compile and even work). Up to "add code collecting statistics for block flow" all the changes are just preparation, like changing routine interfaces to push new classes around or removing obsolete API calls related to pushing JSON form of block (it would not work correctly anyway).

  • "add code collecting statistics for block flow" - contains code for collecting statistics (added first to allow collecting baseline values for future comparisons)
  • "broadcast new block as soon as it is inserted into fork db without waiting for full reapplication" - contains optimization for block production: block is broadcast as soon as it is produced and inserted into fork db (related promise is only triggered after block reapplication, otherwise witness thread could request production of the same block again) - this way time spent on block reapplication and pending transactions is not increasing block offset
  • "trigger promise for block coming from p2p right after its reapplication" - contains optimization for blocks coming from p2p: block is accepted as valid (related promise triggered) as soon as it ends its application without waiting for pending transactions - this way (especially during times of high traffic) we gain up to 200ms on each hop of p2p block travel

Merge request reports