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

Evict possible cell ref txs before submitting cell consuming transaction #4363

Merged
merged 11 commits into from
Mar 7, 2024

Conversation

chenyukang
Copy link
Collaborator

@chenyukang chenyukang commented Feb 23, 2024

What problem does this PR solve?

Problem Summary:

The are conflicts rule between cell dep reference and cell consume relationships.

Assume there are 3 transactions, B cell dep A(and there may be many transactions also cell dep A), C consumes A.

  • If C is committed first, B and all other transactions will be invalidated.
  • If there are too many transactions all cell dep A, transaction C can not be submitted to txpool.

What is changed and how it works?

This is an alternative solution with #4352
In this PR, we introduce these changes:

  • Add a new check_entry_ancestors_limit to find all candidates needed to evict due to cell ref conflicts, based on evict_score.
  • Remove DirectParents and direct_ancestors_count, we make sure an entry's ancestors number is valid after evicting conflicted cell ref transactions.
  • Move ExceededMaximumAncestorsCount check to place before inserting, so that we can assume there will no error report when committing a entry.

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 February 23, 2024 04:54
@chenyukang chenyukang requested review from doitian and removed request for a team February 23, 2024 04:54
@chenyukang chenyukang changed the title Evict possible cell ref txs before submit cell consuming transaction Evict possible cell ref txs before submitting cell consuming transaction Feb 23, 2024
@chenyukang chenyukang force-pushed the yukang-fix-cell-dep branch 8 times, most recently from e79121f to cd0c0aa Compare February 26, 2024 00:54
doitian
doitian previously approved these changes Feb 29, 2024
tx-pool/src/component/pool_map.rs Show resolved Hide resolved
doitian
doitian previously approved these changes Mar 5, 2024
@chenyukang chenyukang added this pull request to the merge queue Mar 7, 2024
Merged via the queue into nervosnetwork:develop with commit 0478dd8 Mar 7, 2024
32 checks passed
@doitian doitian mentioned this pull request Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🥳 Released
Development

Successfully merging this pull request may close these issues.

2 participants