-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Conversation
…k does not depend on lib and we should ship out block as soon as possible
libraries/chain/controller.cpp
Outdated
@@ -2697,12 +2697,12 @@ block_id_type controller::last_irreversible_block_id() const { | |||
if( block_header::num_from_id(tapos_block_summary.block_id) == lib_num ) | |||
return tapos_block_summary.block_id; | |||
|
|||
auto signed_blk = my->blog.read_block_by_num( lib_num ); | |||
auto id = my->blog.read_block_id_by_num( lib_num ); |
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.
Could we change the contents of this method to just call get_block_id_for_num?
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 agree with Brian, It was fixed IIRC in 1.8.x but we used to have a situation where the LIB was not guaranteed to be in the block-log (it was still in the fork DB due to a slow pruning process). Even with that fixed, this method (as-spoke) tightly couples to the expectation that the block-log always contains the LIB and I can think of several reasons why we'd want to break that assumption in the future. (like throwing block.log writes to a background thread).
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.
Moved the check for id in tapos block summary to get_block_id_for_num
since might as well have that optimization there and modified last_irreversiable_block_id
to call get_block_id_for_num
.
libraries/chain/controller.cpp
Outdated
@@ -2697,12 +2697,12 @@ block_id_type controller::last_irreversible_block_id() const { | |||
if( block_header::num_from_id(tapos_block_summary.block_id) == lib_num ) | |||
return tapos_block_summary.block_id; | |||
|
|||
auto signed_blk = my->blog.read_block_by_num( lib_num ); | |||
auto id = my->blog.read_block_id_by_num( lib_num ); |
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 agree with Brian, It was fixed IIRC in 1.8.x but we used to have a situation where the LIB was not guaranteed to be in the block-log (it was still in the fork DB due to a slow pruning process). Even with that fixed, this method (as-spoke) tightly couples to the expectation that the block-log always contains the LIB and I can think of several reasons why we'd want to break that assumption in the future. (like throwing block.log writes to a background thread).
…optimized get_block_id_for_num to check tapos_block_summary first
Change Description
net_plugin
to start sending out the block sooner.block_id
viablock_num
out of block log by reading only theblock_header
instead of the entire block.head_id
of block log instead of calculating it from thehead
block.Consensus Changes
API Changes
Documentation Additions