netsync: Remove spent PRs from prev block txs#3334
Merged
davecgh merged 1 commit intodecred:masterfrom May 29, 2024
Merged
Conversation
e7d5403 to
2250529
Compare
Instead of removing PRs spent by the latest tip block attached to the main chain, use the previous block. The goal of this is to avoid immediately removing mixpool messages that are still propagating the network when a block was quickly mined which includes transactions created from those very same mix messages. After taking a second look at this, this method of removing completed sessions from mixpool does not deal well with reorgs. Using the previous block for every main chain tip extension or reorg will work better, but will still not handle a 2+ block reorg properly. However, these mixpool messages are only removed to avoid a memory leak, and the messages would simply be removed at a later time due to PR expiry.
2250529 to
ee8d2e0
Compare
davecgh
approved these changes
May 29, 2024
Member
davecgh
left a comment
There was a problem hiding this comment.
This looks fine for a quick way to help address the stated reason. I'm working on a more elaborate method currently that will likely replace this in the future.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Instead of removing PRs spent by the latest tip block attached to the main chain, use the previous block. The goal of this is to avoid immediately removing mixpool messages that are still propagating the network when a block was quickly mined which includes transactions created from those very same mix messages.
After taking a second look at this, this method of removing completed sessions from mixpool does not deal well with reorgs. Using the previous block for every main chain tip extension or reorg will work better, but will still not handle a 2+ block reorg properly. However, these mixpool messages are only removed to avoid a memory leak, and the messages would simply be removed at a later time due to PR expiry.