-
Notifications
You must be signed in to change notification settings - Fork 3.8k
implement splitting/extracting block log for eosio_blocklog #10037
Conversation
Documentation related comments:
Or does this tool strictly work only with the full block.log file? |
So far, it only works with full block.log file. For more complex stride adjusting, it should be implemented as script instead of in the eosio_blocklog tool. |
libraries/chain/block_log.cpp
Outdated
EOS_ASSERT(start_block_num >= log_bundle.log_data.first_block_num(), block_log_exception, | ||
"The first available block is block ${first_block}.", ("first_block", log_bundle.log_data.first_block_num())); | ||
|
||
EOS_ASSERT(start_block_num + num_blocks -1 <= log_bundle.log_data.last_block_num(), block_log_exception, |
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.
"-1" => "- 1"
libraries/chain/block_log.cpp
Outdated
for (uint32_t i = first_block_num / stride; | ||
i < last_block_num / stride + 1; ++i) { | ||
uint32_t start_block_num = std::max(i * stride + 1, first_block_num); | ||
uint32_t num_blocks = std::min(stride, last_block_num - start_block_num + 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.
I think you need to start this loop with a little more complexity, if stride=1000, first_block_num=999, and last_block_num=2000 we will have
i=0 => start_block_num=999, num_blocks=1000
i=1 => start_block_num=1001, num_blocks=1000
i=2 => start_block_num=2001, num_blocks=0
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.
You were looking at outdated code
Change Description
implement splitting/extracting block log for eosio_blocklog
Change Type
Select ONE:
Testing Changes
Select ANY that apply:
Consensus Changes
API Changes
Documentation Additions
eosio_blocklog
added two new options