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

feat: reannounce local pending transactions #2

Merged
merged 2 commits into from
Jun 15, 2023

Conversation

j75689
Copy link
Contributor

@j75689 j75689 commented Jun 13, 2023

Description

This feature is copied from BSC: bnb-chain/bsc#570

When the network traffic is heavy, transactions that have been broadcast may be truncated in peers' tx_pools, while these local pending transactions have been marked as known, the source node won't broadcast them again, so they have no chance to be mined.

We add a timer to check whether the local pending transactions stay in tx_pool exceed a threshold, once transactions exceed the threshold, they will be announced to some peers again. The TxPool.ReannounceTime is used to control the threshold, the default value of TxPool.ReannounceTime is too big to be exceeded, users can config this parameter to enable this feature.

Also need to pay attention, this feature only announce the local pending transactions. If your node is configured TxPool.NoLocals=false, then the transactions sent to this RPC node will be treated as local transactions, otherwise you should add your addresses to the TxPool.Locals, only the transactions from the local addresses will be treated as local transactions.

Rationale

This feature is introduced to handle some extreme situations, it won't affect the original function, and it is disabled by default. Users can enable this feature by setting TxPool.ReannouceTime according to their needs.

Example

Set TxPool.ReannounceTime to 5 minutes:
geth --config ./config.toml --datadir ./node --cache 8000 --rpc.allow-unprotected-txs --txlookuplimit 0 --txpool.reannouncetime 5m

Changes

Notable changes:

  • add --txpool.reannouncetime parameter, default value is 10 years, minimum value is 1 minute.

@j75689 j75689 force-pushed the feat/txpool.reannouncetime branch from 57a7293 to 32a4112 Compare June 15, 2023 08:04
@j75689 j75689 requested a review from owen-reorg June 15, 2023 08:05
@owen-reorg owen-reorg merged commit 174353d into develop Jun 15, 2023
welkin22 added a commit that referenced this pull request Jun 20, 2023
* ci: add docker release workflow to build and release docker image (#1)

Co-authored-by: Welkin <[email protected]>

* try to use cache for docker build (#2)

Co-authored-by: Welkin <[email protected]>

---------

Co-authored-by: Welkin <[email protected]>
@sysvm sysvm deleted the feat/txpool.reannouncetime branch July 29, 2024 09:07
sunny2022da pushed a commit that referenced this pull request Aug 14, 2024
Fix an issue of incorrectly set the origin storage at parallel stateDB's
GetState(). Remove this code because it is already solved by lightCopy

PR: #2
sunny2022da pushed a commit that referenced this pull request Sep 26, 2024
Fix an issue of incorrectly set the origin storage at parallel stateDB's
GetState(). Remove this code because it is already solved by lightCopy

PR: #2
welkin22 pushed a commit that referenced this pull request Oct 22, 2024
Fix an issue of incorrectly set the origin storage at parallel stateDB's
GetState(). Remove this code because it is already solved by lightCopy

PR: #2
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.

2 participants