-
Notifications
You must be signed in to change notification settings - Fork 117
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
Make Mempool eviction compliant with ZIP-401 #2744
Comments
Hey team! Please add your planning poker estimate with ZenHub @conradoplg @dconnolly @jvff @oxarbitrage @upbqdn |
ZIP-401 says:
and
We were discussing that it might be a bit of a pain to deal with time in Zebra. Today I noticed Zebra actually deals with time already in order to implement the following from the protocol:
The implementation of that is here zebra/zebra-consensus/src/block/check.rs Line 159 in 1ccb2de
zebra/zebra-chain/src/block/header.rs Line 102 in 2f0f379
|
I wouldn't worry about the exact contents of the rejected set - ZIP-401 is not consensus-critical, so there's no requirement for exact conformance. But having a single rejected set will make the code much simpler, easier to test, and less likely to have security issues. |
There are actually 3 kinds of time here:
Picking the right kind of time is a tricky edge-case, which is why we try to avoid dealing with time as much as possible in Zebra. |
This ticket's dependencies conflict with the NU5 block validation code freeze, so it needs to be done after NU5 testnet activation in sprint 19. |
Changed to epic and removed from Sprint 20 since all relevant child issues are already in that sprint |
We are done here 🎉 |
Motivation
ZIP-401 has some recommendations on how to mitigate DoS attacks on mempool implementations, including how many rejected tx's to track and for how long, and how to select a victim tx to evict from the mempool when out of space (we currently evict the oldest, they recommend a somewhat weighted random choice).
Specifications
https://zips.z.cash/zip-0401
Designs
Rejected set is recommended capped at 40K, we should check if everything we currently put in the rejected set maps to what ZIP-401 considers part of that 40K.
Sub-Tickets
UnminedTx
#2778verify_transparent_inputs_and_outputs
#2440The text was updated successfully, but these errors were encountered: