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

Add conflicts cache for tx_pool to record conflicted transactions #4339

Merged
merged 21 commits into from
Mar 12, 2024

Conversation

chenyukang
Copy link
Collaborator

@chenyukang chenyukang commented Feb 1, 2024

What problem does this PR solve?

Problem Summary:

Starting from 112.0, we don't allow conflicted transactions stay in txpool at the same time, this may have a regression impact for compact block replay, since we reject any double-spending transaction when RBF is disable or RBF check failed.

What is changed and how it works?

We add a new pool called conflicts_cache into TxPool in this PR, we record the conflicted transaction in these scenarios:

  1. RBF is enabled, record those replaced transactions into conflicts_cache
  2. RBF is enabled, but RBF check rule failed with conflicts, record old transaction into conflicts_cache
  3. RBF is disabled, but there is a conflict happening when pre_check, add the new transaction into conflicts_cache after verification.

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 1, 2024 10:01
@chenyukang chenyukang requested review from doitian and removed request for a team February 1, 2024 10:01
@chenyukang chenyukang marked this pull request as draft February 1, 2024 10:02
@chenyukang chenyukang force-pushed the yukang-conflicted-pool branch 2 times, most recently from 598fa60 to 500a32b Compare February 1, 2024 10:15
@eval-exec eval-exec added m:tx-pool t:enhancement Type: Feature, refactoring. labels Feb 1, 2024
@chenyukang chenyukang force-pushed the yukang-conflicted-pool branch 2 times, most recently from bca49cc to fad9bd3 Compare February 5, 2024 05:51
@chenyukang chenyukang marked this pull request as ready for review February 5, 2024 09:33
@chenyukang chenyukang force-pushed the yukang-conflicted-pool branch 2 times, most recently from 9566108 to f279cde Compare February 7, 2024 12:33
sync/src/relayer/mod.rs Outdated Show resolved Hide resolved
tx-pool/src/process.rs Outdated Show resolved Hide resolved
@chenyukang chenyukang force-pushed the yukang-conflicted-pool branch 3 times, most recently from 7b85496 to d0e74c7 Compare February 19, 2024 10:15
@chenyukang chenyukang force-pushed the yukang-conflicted-pool branch 2 times, most recently from 3611e18 to 9f5bd7d Compare March 5, 2024 11:31
@chenyukang chenyukang force-pushed the yukang-conflicted-pool branch 4 times, most recently from 123a3a8 to 31263a2 Compare March 7, 2024 03:39
eval-exec
eval-exec previously approved these changes Mar 7, 2024
@chenyukang chenyukang force-pushed the yukang-conflicted-pool branch 3 times, most recently from da11fc0 to 662ca3e Compare March 7, 2024 06:49
@chenyukang chenyukang force-pushed the yukang-conflicted-pool branch from 535013a to f7a7703 Compare March 7, 2024 10:52
doitian
doitian previously approved these changes Mar 8, 2024
@chenyukang chenyukang added this pull request to the merge queue Mar 8, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 8, 2024
@chenyukang chenyukang added this pull request to the merge queue Mar 8, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 8, 2024
@chenyukang chenyukang force-pushed the yukang-conflicted-pool branch from f7a7703 to 39daa1f Compare March 9, 2024 13:43
@chenyukang chenyukang enabled auto-merge March 9, 2024 13:43
@chenyukang chenyukang added this pull request to the merge queue Mar 12, 2024
Merged via the queue into develop with commit 0ad645f Mar 12, 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
m:tx-pool t:enhancement Type: Feature, refactoring.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants