Skip to content

Conversation

@jrick
Copy link
Member

@jrick jrick commented May 29, 2024

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.

@jrick jrick force-pushed the removeprsfromprevblock branch from e7d5403 to 2250529 Compare May 29, 2024 14:37
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.
@jrick jrick force-pushed the removeprsfromprevblock branch from 2250529 to ee8d2e0 Compare May 29, 2024 15:08
@davecgh davecgh added this to the 2.0.2 milestone May 29, 2024
Copy link
Member

@davecgh davecgh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@davecgh davecgh merged commit 9d590d1 into decred:master May 29, 2024
@jrick jrick deleted the removeprsfromprevblock branch May 29, 2024 22:20
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