-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Conversation
…ts own watermarks the same way any producer plugin would, fix off-by-one caused by not accounting for a block confirming itself; fix off-by-one caused by propagating the value of dpos-lib before it was updated; decoupled dpos-lib from bft-lib though controller still returns the max of them
…needed at the time a block was made instead of how many are active at the time we are updating confirmations
@@ -22,10 +23,6 @@ struct block_header_state { | |||
public_key_type block_signing_key; | |||
vector<uint8_t> confirm_count; | |||
|
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.
Move confirmations up to here.
@@ -60,7 +57,7 @@ struct block_header_state { | |||
} } /// namespace eosio::chain | |||
|
|||
FC_REFLECT( eosio::chain::block_header_state, | |||
(id)(block_num)(header)(dpos_last_irreversible_blocknum) | |||
(id)(block_num)(header)(dpos_irreversible_blocknum) | |||
(pending_schedule_lib_num)(pending_schedule_hash) | |||
(pending_schedule)(active_schedule)(blockroot_merkle) | |||
(producer_to_last_produced)(block_signing_key) |
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.
Missing confirm_count. Also I would put these in the same order as declared.
} | ||
} | ||
result.producer_to_last_produced = move( new_producer_to_last_produced ); | ||
result.producer_to_last_produced[prokey.producer_name] = result.block_num; | ||
} | ||
|
||
/// grow the confirmed count | ||
uint8_t required_confs = (result.active_schedule.producers.size() * 2 / 3) + 1; | ||
if( confirm_count.size() < 1024 ) { |
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 1024, comment would be good.
@@ -85,36 +85,19 @@ namespace eosio { namespace chain { | |||
result.block_num = block_num + 1; | |||
result.producer_to_last_produced = producer_to_last_produced; | |||
result.producer_to_last_produced[prokey.producer_name] = result.block_num; | |||
// result.dpos_last_irreversible_blocknum = result.calc_dpos_last_irreversible(); | |||
// result.dpos_irreversible_blocknum = result.calc_dpos_last_irreversible(); |
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.
Can we remove this commented out code.
int32_t i = confirm_count.size() - 2; | ||
while( i >= 0 && num_prev_blocks ) { | ||
++confirm_count[i]; | ||
int32_t i = (int32_t)(confirm_count.size() - 1); |
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.
Should we assert confirm_count.size() != 0
… in anticipation of PR #2740 which should fix the test.
I have a question that why eos changes last_irreversible_block_num from bft_irreversible_blocknum to this ? |
@luomeiqin |
No description provided.