Skip to content

Conversation

@davecgh
Copy link
Member

@davecgh davecgh commented Jun 12, 2024

This requires #3360 and is rebased on #3362.

This adds a cache to house mix messages that have recently been removed from the mixpool. It makes use of the new container/lru module to handle automatic expiration of entries and maximum entry limiting.

The rationale for this change is that it is considered misbehavior to advertise a mix message and then claim it is not found when the corresponding request arrives. Maintaining a separate cache of mix messages recently removed from the mixpool for a short period of time significantly increases the probability they are available to serve when a request for the advertisement arrives independent of the current status of the mixpool.

@davecgh davecgh added this to the 2.0.3 milestone Jun 12, 2024
@davecgh davecgh force-pushed the mixpool_cache_recently_removed_msgs branch from a4cb1a3 to c5c898a Compare June 12, 2024 03:54
@davecgh davecgh marked this pull request as draft June 12, 2024 03:55
@davecgh davecgh force-pushed the mixpool_cache_recently_removed_msgs branch 3 times, most recently from 23bde48 to 7b2ac5e Compare June 13, 2024 00:08
@davecgh davecgh marked this pull request as ready for review June 13, 2024 00:08
Copy link
Member

@jrick jrick left a comment

Choose a reason for hiding this comment

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

code-wise with the exception of the nitpick i had on the comment wording, this looks ok.

@davecgh davecgh force-pushed the mixpool_cache_recently_removed_msgs branch 4 times, most recently from c85b955 to 2f79a9c Compare June 15, 2024 03:20
This adds a cache to house mix messages that have recently been removed
from the mixpool.  It makes use of the new container/lru module to
handle automatic expiration of entries and maximum entry limiting.

The rationale for this change is that it is considered misbehavior to
advertise a mix message and then claim it is not found when the
corresponding request arrives.  Maintaining a separate cache of mix
messages recently removed from the mixpool for a short period of time
significantly increases the probability they are available to serve when
a request for the advertisement arrives independent of the current
status of the mixpool.
@davecgh davecgh force-pushed the mixpool_cache_recently_removed_msgs branch from 2f79a9c to e1569fd Compare June 17, 2024 16:06
@davecgh davecgh merged commit e1569fd into decred:master Jun 17, 2024
@davecgh davecgh deleted the mixpool_cache_recently_removed_msgs branch June 17, 2024 16:09
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