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

Backport: Fix orphan pool issue for long pending tx #4208

Merged

Conversation

chenyukang
Copy link
Collaborator

What problem does this PR solve?

Project Godwoken found that some tx will stay in pending for a long time. After analyzing the log(at most 4 hours), we found tx may unexpectedly stay in orphan pool for the scenario transaction chain. For example, tx1 -> tx2, after tx1 is submitted tx2 stayed in pending for a long time, actually tx2 wasn't submitted into txpool.

Problem Summary:

What is changed and how it works?

Fix the issues in process_orphan_tx which may forget some txs in orphan pool. There are 3 issues this PR targeted to resolve:

    1. find_by_previous was only returning one tx by searching with input(because the tx in orphan pool may have conflicts), which may cause issue when there are multiple child tx for one parent tx, process_orphan_tx may can not process all of them.
    1. The evict time interval was 2 * max_block_interval, which is 96 seconds, this is too short for the delay of networking, and we didn't send Reject to filter, which may make the node don't broadcast them later.
    1. For the conflicted tx scenario, since we can not resolve all inputs in orphan pool, we can not add Replace-by-fee checking rules for them, so I change the code to use HashMap<OutPoint, HashSet<ProposalShortId>>, so we don't handle the conflict in orphan pool.

What's Changed:

Related changes

  • PR to update owner/repo:
  • Need to cherry-pick to the release branch

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

  • Performance regression
  • Breaking backward compatibility

Release note

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

@chenyukang chenyukang requested a review from a team as a code owner October 27, 2023 02:17
@chenyukang chenyukang requested a review from quake October 27, 2023 02:17
@eval-exec eval-exec added the hotfix Fixing that must be submit to RC branch. label Oct 27, 2023
@doitian
Copy link
Member

doitian commented Oct 27, 2023

Release RC2 for #4181

@doitian doitian merged commit d5868dd into nervosnetwork:rc/v0.112.x Oct 27, 2023
35 checks passed
@doitian doitian mentioned this pull request Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotfix Fixing that must be submit to RC branch.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants