-
Notifications
You must be signed in to change notification settings - Fork 111
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
change(mempool): Re-verify mempool transactions after a chain fork, rather than re-downloading them all #5841
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
And add a marker struct for mempool download cancellation.
teor2345
added
A-consensus
Area: Consensus rule updates
C-enhancement
Category: This is an improvement
P-Medium ⚡
I-slow
Problems with performance or responsiveness
I-remote-node-overload
Zebra can overload other nodes on the network
A-rpc
Area: Remote Procedure Call interfaces
A-concurrency
Area: Async code, needs extra work to make it work properly.
labels
Dec 12, 2022
github-actions
bot
added
the
C-trivial
Category: A trivial change that is not worth mentioning in the CHANGELOG
label
Dec 12, 2022
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #5841 +/- ##
==========================================
+ Coverage 78.70% 78.72% +0.01%
==========================================
Files 308 308
Lines 38786 38836 +50
==========================================
+ Hits 30528 30573 +45
- Misses 8258 8263 +5 |
teor2345
removed
the
C-trivial
Category: A trivial change that is not worth mentioning in the CHANGELOG
label
Dec 12, 2022
oxarbitrage
approved these changes
Dec 12, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks for the fix.
teor2345
added a commit
that referenced
this pull request
Feb 6, 2023
…ather than re-downloading them all (#5841) - git cherry-pick --strategy=ort --strategy-option=ours * Move Drop from mempool::ActiveState to mempool::Downloads, to avoid bugs * Re-verify mempool transactions after a fork And add a marker struct for mempool download cancellation. * Update README based on recent mitigations for some issues, tidy format * Make mempool proptests easier to debug * Make UnminedTx Display text much smaller * Update tests for mempool transaction re-verification after forks * Retry all stored and pending transactions * Fix a test to check for mempool reset retries
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-concurrency
Area: Async code, needs extra work to make it work properly.
A-consensus
Area: Consensus rule updates
A-rpc
Area: Remote Procedure Call interfaces
C-enhancement
Category: This is an improvement
I-remote-node-overload
Zebra can overload other nodes on the network
I-slow
Problems with performance or responsiveness
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Zebra drops all its mempool transactions when there is a chain fork. But it would be faster and put less load on the network if we re-verified them instead.
I discovered this bug while testing the
getblocktemplate
RPC.Complex Code or Requirements
We need to make sure we clear the mempool, then re-verify all the stored or pending transactions.
Otherwise, we could break a consensus rule.
Solution
Related bug fixes:
Related cleanups:
This doesn't need to be behind a feature, because it's a bug fix for the production mempool as well.
Review
This is a routine bug fix.
Reviewer Checklist