Genesis block doesn't has chain root for all chains, so default value of MMR_ACTIVATED_BLOCK should be 1 not 0; and if user set it to be 0, then ckb should raise an error.
Two sampled difficulties maybe point to a same block.
So it shouldn't increase start_block_number in the method get_block_numbers_via_difficulties even we use it as the result of previous sampled difficulty.
The end_block_number for the method get_first_block_total_difficulty_is_not_less_than could NOT be returned.
So the end_block_number should be difficulty_boundary, not difficulty_boundary - 1.
A typo when check "the maximum difficulty should be less than the difficulty boundary".
What problem does this PR solve?
Problem Summary:
Genesis block doesn't has chain root for all chains, so default value of
MMR_ACTIVATED_BLOCK
should be 1 not 0; and if user set it to be0
, then ckb should raise an error.Two sampled difficulties maybe point to a same block.
So it shouldn't increase
start_block_number
in the methodget_block_numbers_via_difficulties
even we use it as the result of previous sampled difficulty.The
end_block_number
for the methodget_first_block_total_difficulty_is_not_less_than
could NOT be returned.So the
end_block_number
should bedifficulty_boundary
, notdifficulty_boundary - 1
.A typo when check "the maximum difficulty should be less than the difficulty boundary".