Ensure that block_assembler
's Snapshot.tip_number
reaches shared.snapshot().tip_number
before tx_pool.plug_entry
#4277
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
shared.Snapshot.tip_number
beforetx_pool.plug_entry
What problem does this PR solve?
This PR want to fix #4252
Issue Number: close #4252
Problem Summary:
In the
fn test_package_multi_best_scores
function, we generate three blocks in quick succession. This could potentially lead to thesnapshot.tip_number
of theblock_assembler
lagging behindshared.snapshot.tip_number
.Consequently, in the
BlockAssembler::calc_dao
function, the following scenario may occur:The
snapshot.tip_number
is 3, butcalc_dao
is processing a transaction that is packed in block 4. As a result, the transactions in block 4 fail to be resolved.So, I want to make sure the block_assembler's snapshot.tip_number is larger than shared.snapshot.tip_number before
tx_pool.plug_entry
.What is changed and how it works?
What's Changed:
Related changes
block_assembler
's snapshot.tip_number reach overshared.snapshot().tip_number()
before executingtx_pool.plug_entry
Check List
Tests
Side effects
Release note