-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[5.0] Replaced cpu-effort-percent
with produce-block-offset-ms
#1800
Conversation
…ge meaning to be over complete round
docs/01_nodeos/03_plugins/producer_plugin/10_block-producing-explained.md
Show resolved
Hide resolved
docs/01_nodeos/03_plugins/producer_plugin/10_block-producing-explained.md
Show resolved
Hide resolved
docs/01_nodeos/03_plugins/producer_plugin/10_block-producing-explained.md
Show resolved
Hide resolved
|
||
Peer validation for similar hardware/version/config will be <= `m` | ||
|
||
**Let's consider for exemplification the following two BPs and their network topology as depicted in the below diagram** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why exemplification
is used here instead of just for example
is beyond me. Seems like we are trying to sound smart.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'd write:
Let's consider the example of the following two BPs and their network topology as depicted in the below diagram
docs/01_nodeos/03_plugins/producer_plugin/10_block-producing-explained.md
Outdated
Show resolved
Hide resolved
This document |
docs/01_nodeos/03_plugins/producer_plugin/10_block-producing-explained.md
Outdated
Show resolved
Hide resolved
* `BP-A` sends b1 at `t1-17ms` => `BP-A-Peer` processes `h=10ms`, sends at `t-7ms` =(200ms)> `BP-B-Peer` processes `h=10ms`, sends at `t+203ms` => arrives at `BP-B` at `t+203ms`. | ||
* `BP-A` starts b2 at `t1-17ms`, sends b2 at `t2-34ms` => `BP-A-Peer` processes `h=10ms`, sends at `t2-24ms` =(200ms)> `BP-B-Peer` processes `h=10ms`, sends at `t2+186ms` => arrives at `BP-B` at `t2+186ms`. | ||
* `BP-A` starts b3 at `t2-34ms`, ... | ||
* `BP-A` starts b12 at `t11-187ms`, sends b12 at `t12-204ms` => `BP-A-Peer` processes `h=10ms`, sends at `t12-194ms` =(200ms)> `BP-B-Peer` processes `h=10ms`, sends at `t12+16ms` => arrives at `BP-B` at `t12-16ms` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it be arriving at B at t12+16ms
? (the +
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Thanks.
plugins/producer_plugin/include/eosio/producer_plugin/block_timing_util.hpp
Outdated
Show resolved
Hide resolved
plugins/producer_plugin/include/eosio/producer_plugin/block_timing_util.hpp
Outdated
Show resolved
Hide resolved
plugins/producer_plugin/include/eosio/producer_plugin/block_timing_util.hpp
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I don't see in the code where you send out a block right away after it is produced.
- Should some new tests be added for this change?
_produce_block_cpu_effort_us = fc::milliseconds( config::block_interval_ms - produce_block_offset_ms / config::producer_repetitions ); | ||
} | ||
|
||
fc::microseconds get_produce_block_offset() const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the first glance, I think this returns the user supplied value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does. We do not have a milliseconds
type only a microseconds
type.
@@ -17,7 +17,7 @@ class producer_plugin : public appbase::plugin<producer_plugin> { | |||
struct runtime_options { | |||
std::optional<int32_t> max_transaction_time; | |||
std::optional<int32_t> max_irreversible_block_age; | |||
std::optional<int32_t> cpu_effort_us; | |||
std::optional<int32_t> produce_block_offset_ms; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd add the comment here as well
std::optional<int32_t> produce_block_offset_ms; | |
std::optional<int32_t> produce_block_offset_ms; // minimum time to reserve at the end of a production round for blocks to propagate to the next block producer. |
See leap/plugins/producer_plugin/producer_plugin.cpp Line 2527 in 54e42bc
leap/plugins/producer_plugin/producer_plugin.cpp Line 2494 in 54e42bc
This is not new behavior, it has shipped a block off early since v2.0.4. See EOSIO/eos#8651 |
|
|
See #867 which is the change to calculations on when to start a block. |
Replaced
cpu-effort-percent
withproduce-block-offset-ms
.produce-block-offset-ms
specifies how much time to leave at the end of the 12 block production round for the blocks (mainly the last block) to reach the next block producer. This value can be specified as larger than 500ms if needed. The default is 450ms.Updated documentation: https://docs.eosnetwork.com/manuals/leap/latest/nodeos/plugins/producer_plugin/block-producing-explained/
from: https://github.com/AntelopeIO/leap/blob/39327d80665dd275680b58587e89fac3a3b90891/docs/01_nodeos/03_plugins/producer_plugin/10_block-producing-explained.md
Resolves #1784