-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Fix counting of sigops cost in mempool check #8364
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
Conversation
The new "bytespersigop" limit introduced the side effect of making most multisig transactions non-standard. This fixes the issue by accurately counting the sigops cost, solely for the newly introduced check.
|
This does not prevent the vulnerability, I think? Someone can still create a large number of high-(legacy)sigops transactions, and the mining code will include them, resulting in a very small block. AFAIK the only workable solution is to treat transactions in the mempool as if their size was max(size, sigops * MAX_BLOCK_SIZE / MAX_SIGOPS). |
That's not the objective of this submission, but to remove the side effect of making multisig transactions non-standard, which was introduced by #7081, while leaving #7081 as intact as possible.
I'd be happy, if there is a better solution, and I'd be very glad, if you could push one. My primary goal was to present something that may still be merged into 0.13. |
|
Thank you! |
|
@sipa The DoS being addressed here was based on actual verification time, not the miner limit. So this fix (at least as described; have not reviewed the code) should be okay. Whether the mining code wants to demand a higher fee or not, is a separate (and perhaps reasonable) issue. Concept ACK. Would be nice if someone reopened and/or merged #5231 at the same time. |
|
@luke-jr 20000 verification operations are allowed, and that is not currently changed by any of the proposals (neither #7081, this PR, or #8365). If that is a problem, we should propose a softfork to reduce the sigops limit, not change relay policy (which only prevents it in an easily-avoided case). |
|
I don't see what use this serves. It makes the code more complex and doesn't constrain anyone's ability to cause computation. #8365 is sensible. |
|
Closing in favor of #8365, which was merged today |
The new "bytespersigop" limit introduced the side effect of making most multisig transactions non-standard.
This fixes #8079 by accurately counting the sigops cost, solely for the newly introduced check.
As alternative I see two options:
DEFAULT_BYTES_PER_SIGOPsignifically so that there is no longer a side effectThis should be backported to earlier versions, and especially for 0.13, as soon as possible the path is clear.