-
Notifications
You must be signed in to change notification settings - Fork 106
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
Limit the size and age of the ZIP-401 rejected transaction ID list #2759
Comments
Are we already doing this? It was in the list of mempool tasks but did not have an issue number assigned |
This is part of #2744:
|
Hey team! Please add your planning poker estimate with ZenHub @conradoplg @dconnolly @jvff @oxarbitrage @upbqdn |
I think that doesn't work because I've searched a bit and couldn't find any library that would solve that, so I think the solution is to have another list ( |
Yeah, I think you're right. Here's one way we could implement this
Here's how we could implement the operations: Add or update the age of an entry - Remove the oldest entries when they have expired -
Remove the oldest entry when the list is too long -
|
Motivation
ZIP-401 limits the number of transactions in the rejected list, and the age of the entries in that list.
This Ticket Depends On
RecentlyEvicted
:UnminedTx
#2778verify_transparent_inputs_and_outputs
#2440Specification
The checked items are covered by other tickets.
https://zips.z.cash/zip-0401#specification
Design
The ZIP-401 reject list must be implemented as a new list in
MempoolStorage
. This avoids bugs that confuse different rejection rules.Since this time is only used by the local node, it should be monotonic (strictly increasing):
https://docs.rs/tokio/1.11.0/tokio/time/struct.Instant.html
If we use an
IndexMap<transaction::Hash, Instant>
, we can efficiently evict transaction IDs by usingIndexMap::pop
, until we reach a transaction that's below the eviction limit:https://docs.rs/indexmap/1.7.0/indexmap/map/struct.IndexMap.html#order
The text was updated successfully, but these errors were encountered: