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

Fix tx-pool potential inconsistent after reorg occurs #3706

Merged
merged 3 commits into from
Nov 17, 2022

Conversation

zhangsoledad
Copy link
Member

@zhangsoledad zhangsoledad commented Nov 16, 2022

What problem does this PR solve?

Usually when a new transaction is added to the pool, it has no in-pool children (because any such children would be an orphan). In the event of a reorg, the assumption that a newly added tx has no in-pool children is false. In particular, the pool is in an inconsistent state while new transactions are being added.

What is changed and how it works?

When a reorg occurs and the tx-pool adds transactions from the disconnect block, it also updates the state of the corresponding descendants to ensure that the state is consistent.

Check List

Tests

  • Unit test
  • Integration test

Release note

Title Only: Include only the PR title in the release note.

@zhangsoledad zhangsoledad requested a review from a team as a code owner November 16, 2022 09:27
@zhangsoledad zhangsoledad requested review from doitian and removed request for a team November 16, 2022 09:27
@zhangsoledad zhangsoledad force-pushed the zhangsoledad/tx-pool-fix branch 4 times, most recently from 1aa6484 to d724ca4 Compare November 17, 2022 02:40
@zhangsoledad zhangsoledad force-pushed the zhangsoledad/tx-pool-fix branch from d724ca4 to 6b6b72a Compare November 17, 2022 02:53
@zhangsoledad
Copy link
Member Author

bors r+

@bors bors bot merged commit ad00909 into nervosnetwork:develop Nov 17, 2022
@zhangsoledad zhangsoledad deleted the zhangsoledad/tx-pool-fix branch November 17, 2022 06:59
@doitian doitian mentioned this pull request Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants