Skip to content
This repository was archived by the owner on Aug 2, 2022. It is now read-only.

CPU block effort - 2.0 - #8571

Merged
heifner merged 14 commits into
release/2.0.xfrom
duty-cycle-2.0
Feb 5, 2020
Merged

heifner merged 14 commits into
release/2.0.xfrom
duty-cycle-2.0

Conversation

@heifner

@heifner heifner commented Feb 4, 2020

Copy link
Copy Markdown
Contributor

Change Description

CPU block effort provides a mechanism to restrict the amount of time a producer is processing transactions for inclusion into a block. It also controls the time a producer will finalize/produce and transmit a block. Block construction now always begins at whole or half seconds for the next block.

Added new options cpu-effort-percent & last-block-cpu-effort-percent defaulted to 80%. Percentage of cpu block production time used to produce block. Whole number percentages, e.g. 80 for 80%.

These options allow time outside of start_block for other system activity such as net_plugin sending/receiving blocks, signing of block, etc.

Existing options produce-time-offset-us & last-block-time-offset-us have been modified to constrain configurable values from 0 .. -block_time_interval where currently block_time_interval is 500,000us. Positive values are no longer allowed.

The default value of produce-time-offset-us is now effectively -100000 since cpu-effort-percent is defaulted to 80%.

These four options now all fold into restricting the amount of time spent processing transactions into a block. The last-block-* options constrain the final 12th block of the producer's round. The other two options constrain the remaining blocks of the round, 1-11. The more constraining amount is used. For example, --cpu-effort-percent 80 --produce-time-offset-us -300000 will constrain transaction processing to 200ms as 80% x 500ms = 400ms and 500ms - 300ms = 200ms.

Other examples:
--cpu-effort-percent 70 --produce-time-offset-us -100000 provides 350ms for transaction processing.
--last-block-cpu-effort-percent 70 --last-block-time-offset-us -400000 provides 100ms for transaction processing for the last block of the round

Consensus Changes

  • Consensus Changes

API Changes

  • API Changes

Documentation Additions

  • Documentation Additions

See above.

โ€ฆock-time-offset-us & last-block-cpu-duty-cycle-pct together. These config options now specify the amount of time of the 500ms block interval to use for producing a block. The existing options produce-time-offset-us & last-block-time-offset-us are now restricted to the 500ms block interval; they no longer allow positive offsets. Offsets are now always in term of the block time.
โ€ฆy-cyle-pct to last-block-cpu-effort-percent to better describe the options.
@heifner
heifner merged commit 979bf70 into release/2.0.x Feb 5, 2020
@heifner
heifner deleted the duty-cycle-2.0 branch February 5, 2020 00:59
@heifner heifner mentioned this pull request Feb 6, 2020
3 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants