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

server: Cache advertised txns. #3362

Merged
merged 1 commit into from
Jun 15, 2024

Conversation

davecgh
Copy link
Member

@davecgh davecgh commented Jun 10, 2024

This requires #3360.

This adds a cache to house transactions that have recently been advertised to other peers. 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 transaction and then claim it is not found when the corresponding request arrives. Maintaining a separate cache of advertised transactions for a short period of time after they were advertised significantly increases the probability they are available to serve when a request for the advertisement arrives of the current status of the unconfirmed transaction mempool.

@davecgh davecgh added this to the 2.1.0 milestone Jun 10, 2024
@davecgh davecgh force-pushed the server_cache_advertised_txns branch from 65d9342 to 5a38261 Compare June 11, 2024 23:25
@davecgh davecgh force-pushed the server_cache_advertised_txns branch 2 times, most recently from 5cde9e0 to 76ed582 Compare June 12, 2024 23:37
@davecgh davecgh force-pushed the server_cache_advertised_txns branch 2 times, most recently from 0dc79ba to 0498261 Compare June 14, 2024 16:00
This adds a cache to house transactions that have recently been
advertised to other peers.  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 transaction and then claim it is not found when the
corresponding request arrives.  Maintaining a separate cache of
advertised transactions for a short period of time after they were
advertised significantly increases the probability they are available to
serve when a request for the advertisement arrives independent of the
current status of the unconfirmed transaction mempool.
@davecgh davecgh force-pushed the server_cache_advertised_txns branch from 0498261 to 0eb577e Compare June 14, 2024 22:53
@davecgh davecgh merged commit 0eb577e into decred:master Jun 15, 2024
2 checks passed
@davecgh davecgh deleted the server_cache_advertised_txns branch June 15, 2024 00:12
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