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

Tx pool Replace-by-fee #4079

Merged
merged 60 commits into from
Aug 17, 2023

Conversation

chenyukang
Copy link
Collaborator

@chenyukang chenyukang commented Jul 26, 2023

What problem does this PR solve?

Add feature of Replace-by-fee for tx-pool.

Fixes #3734

What is changed and how it works?

What's Changed:

This RBF feature enables users to replace a transaction with a higher fee rate when pending in tx-pool, which is useful when the transaction is stuck in the tx-pool:

  • Add min_rbf_rate in ckb.toml with default value 1500, which means the minimum extra fee rate for RBF, the unit is shannons/KB
  • Add fields fee and min_replace_fee in get_transaction, which means the the minimal fee need to pay for RBF for a specific transaction
  • min_replace_fee = sum(replaced_tx_fee) + (min_rbf_rate * size)
  • The replaced transaction will be removed from tx-pool and with the status Rejected.

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.
Note: Add a note under the PR title in the release note.

@chenyukang chenyukang requested a review from a team as a code owner July 26, 2023 03:46
@chenyukang chenyukang requested review from quake and removed request for a team July 26, 2023 03:46
@chenyukang chenyukang force-pushed the tx_pool_rbf branch 3 times, most recently from fcd4307 to feb4728 Compare July 26, 2023 04:31
@chenyukang chenyukang changed the base branch from tx_pool_refactor to develop August 7, 2023 15:39
@chenyukang chenyukang changed the base branch from develop to tx_pool_refactor August 7, 2023 15:39
tx-pool/src/process.rs Outdated Show resolved Hide resolved
tx-pool/src/component/pool_map.rs Outdated Show resolved Hide resolved
tx-pool/src/pool.rs Show resolved Hide resolved
tx-pool/src/pool.rs Outdated Show resolved Hide resolved
tx-pool/src/pool.rs Outdated Show resolved Hide resolved
tx-pool/src/pool.rs Outdated Show resolved Hide resolved
tx-pool/src/pool.rs Outdated Show resolved Hide resolved
@zhangsoledad zhangsoledad merged commit 835fc8e into nervosnetwork:tx_pool_refactor Aug 17, 2023
34 checks passed
@doitian doitian mentioned this pull request Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants