Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure that block_assembler's Snapshot.tip_number reaches shared.snapshot().tip_number before tx_pool.plug_entry #4277

Conversation

eval-exec
Copy link
Collaborator

@eval-exec eval-exec commented Dec 25, 2023

shared.Snapshot.tip_number before tx_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 the snapshot.tip_number of the block_assembler lagging behind shared.snapshot.tip_number.

Consequently, in the BlockAssembler::calc_dao function, the following scenario may occur:
The snapshot.tip_number is 3, but calc_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

  • Wait block_assembler's snapshot.tip_number reach over shared.snapshot().tip_number() before executing tx_pool.plug_entry

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code ci-runs-only: [ quick_checks,linters ]

Side effects

  • None

Release note

None: Exclude this PR from the release note.

`shared.Snapshot.tip_number` before `tx_pool.plug_entry`
@eval-exec eval-exec requested a review from a team as a code owner December 25, 2023 16:44
@eval-exec eval-exec changed the title Ensure block_assembler's Snapshot.tip_number reach over shared.snapshot().tip_number before tx_pool.plug_entry Ensure that block_assembler's Snapshot.tip_number reaches shared.snapshot().tip_number before tx_pool.plug_entry Dec 25, 2023
@eval-exec eval-exec added t:ci Type: CI t:test: Integration Test Type: This issue is related to test. labels Dec 25, 2023
@quake quake added this pull request to the merge queue Dec 26, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 26, 2023
@eval-exec
Copy link
Collaborator Author

eval-exec commented Dec 26, 2023

CI failed on ubuntu, but no erorr message. https://github.com/nervosnetwork/ckb/actions/runs/7327527043/job/19954521419

Screenshot_20231226_155349

@eval-exec eval-exec added this pull request to the merge queue Dec 26, 2023
Merged via the queue into nervosnetwork:develop with commit 125d723 Dec 26, 2023
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t:ci Type: CI t:test: Integration Test Type: This issue is related to test.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tests::block_assembler::test_package_multi_best_scores failed with a probability about 10%
3 participants