-
Notifications
You must be signed in to change notification settings - Fork 116
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
Relay and accept mempool transactions based on the ZIP-317 fee rules #5336
Comments
'The eviction weight is already proportional to the size of the transaction in bytes', so we should be able to deploy these changes before wallets do without negative effect (per daira). What will happen in practice is regardless of whether an attacker chooses big transactions or lots of smaller transactions, the total size of their transactions will be large compared to the legitimate ones, it will always be more likely that the adv. 's transactions will be dropped vs legitimate ones. // @daira |
@dconnolly you wrote in the description:
But the advice in the ZIP is to coordinate deployment of relaying changes with |
Hey team! Please add your planning poker estimate with Zenhub @arya2 @conradoplg @oxarbitrage @teor2345 @upbqdn |
This was about mempool eviction (i.e. ZIP 401), not relaying. |
This ticket is currently blocked by the deployment of similar changes to wallets. |
@mpguerra this ticket is ready to go, it would be good to get it in a release soon, so Zebra can stop storing and relaying spam transactions. It should be very quick, we can just copy the existing check in the mining code to the mempool transaction validator. |
I will schedule this in for next sprint (2023 Sprint 8) We should make more progress with the audit findings first. |
For compatibility it should be per 1000 bytes, and at most 1000 zatoshi. In In |
Thanks, I think @oxarbitrage will appreciate these details. I don't think we want any free transactions in Zebra, we can just apply the relay fee to all mempool transactions. |
Motivation
We want to deploy the new relaying rules in ZIP-317, once enough wallets have updated:
https://zips.z.cash/zip-0317#deployment
This should be released in Zebra around the time of the
zcashd
release that implements ZIP-317, which is release 5.5.0 in April 2023.We're also adding a minimum fee rate to match
zcashd
.Specification
ZIP 317
The relay parts of:
Minimum Fee Rate
zcashd
also enforces a standard rule:size
, with a maximum fee of 1000 zatoshiszcashd
this is DEFAULT_MIN_RELAY_TX_FEEIn Zebra, we can directly enforce this minimum fee rate during mempool transaction validation.
zcashd details
We don't need to implement exactly what
zcashd
does.See Daira's summary here:
#5336 (comment)
Their code is much more complicated:
https://github.com/zcash/zcash/blob/adfc7218435faa1c8985a727f997a795dcffa0c7/src/main.h#L71-L72
https://github.com/zcash/zcash/blob/6ebf01fa831c02c18d6c2cf76c15b0cd2a1fe978/src/main.cpp#L1967-L1971
Design
Zebra currently relays all valid transactions.
We should try to match what
zcashd
does for their ZIP 317 implementation:The simplest way to do this in Zebra is to add the ZIP-317 check to mempool transaction validation as a standard rule. Then they won't be relayed, because they won't be in the mempool.
Completed
ZIP 401 changes
As part of this ticket, we updated some of the ZIP-401 constants:
zcash/zips#565 (comment)
This was done in
Outdated
Here is the previous behaviour:
Daira says that:
https://discord.com/channels/809218587167293450/809251050741170187/1047520100967780375
The text was updated successfully, but these errors were encountered: