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

CPU block effort - develop - #8579

Merged
heifner merged 14 commits into
developfrom
duty-cycle-dev
Feb 6, 2020
Merged

heifner merged 14 commits into
developfrom
duty-cycle-dev

Conversation

@heifner

@heifner heifner commented Feb 6, 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.

@arhag arhag left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved as a port of #8571, but #8578 will also need to be ported to develop after this.

@heifner
heifner merged commit 54c7673 into develop Feb 6, 2020
@heifner
heifner deleted the duty-cycle-dev branch February 6, 2020 13:42
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