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

worker enhancement: NewTxsEvent and triePrefetch reuse #1204

Merged
merged 2 commits into from
Nov 28, 2022

Conversation

setunapo
Copy link
Contributor

@setunapo setunapo commented Nov 25, 2022

Description

These two PRs is to enhance worker, after multi-fillTransactions(#1186) was introduced.
The node could have stress to handle huge transaction traffic.
This PR tries to reduce some CPU cost and improve the logic of NewTxsEvent Subscribe.

Rationale

Reused triePrefetch
1.reused triePrefetch when multi-fillTransactions to mine a block, to avoid too much trie prefetch routines when several fillTransactions are called.

Subscribe NewTxsEvent
1.remove the unnecessary NewTxsEvent subscriber, which was used for PoW resubmit check.
2.unsubscribe ASAP before another fillTransactions, to avoid block others.
3.double txChanSize to 4096 * 2, so it will less likely to block others when it is running fillTransactions(), which may take 1.5s at most.

Example

NA

Changes

NA

@brilliant-lx brilliant-lx changed the title two worker enhancement: NewTxsEvent subscribe and triePrefetch reuse two worker enhancement: NewTxsEvent and triePrefetch reuse Nov 25, 2022
@brilliant-lx brilliant-lx changed the title two worker enhancement: NewTxsEvent and triePrefetch reuse worker enhancement: NewTxsEvent and triePrefetch reuse Nov 25, 2022
@brilliant-lx brilliant-lx added enhancement New feature or request r4r ready for review labels Nov 25, 2022
avoid too much trie prefetch routines when several fillTransactions are called.
1.remove the unnecessary NewTxsEvent subscriber, which was used for PoW resubmit check.
2.unsubscribe ASAP before another fillTransactions, to avoid block others.
@brilliant-lx brilliant-lx merged commit 807d52e into bnb-chain:develop Nov 28, 2022
@setunapo setunapo deleted the work_reuse branch February 5, 2023 04:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request r4r ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants