Skip to content

Conversation

@f139975
Copy link

@f139975 f139975 commented Jul 18, 2016

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:

This should be backported to earlier versions, and especially for 0.13, as soon as possible the path is clear.

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.
@sipa
Copy link
Member

sipa commented Jul 18, 2016

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).

@f139975
Copy link
Author

f139975 commented Jul 18, 2016

This does not prevent the vulnerability, I think?

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.

AFAIK the only workable solution is to scale up the mempool transaction size to max(size, sigops * MAX_BLOCK_SIZE / MAX_SIGOPS).

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.

@sipa
Copy link
Member

sipa commented Jul 18, 2016

@f139975 I'll see what I can do. I understand the desire to have #8079 fixed, but not by reintroducing the attack that #7081 prevented.

@f139975
Copy link
Author

f139975 commented Jul 18, 2016

Thank you!

@btcdrak
Copy link
Contributor

btcdrak commented Jul 18, 2016

ping @rubensayshi @NicolasDorier

@luke-jr
Copy link
Member

luke-jr commented Jul 18, 2016

@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.

@sipa
Copy link
Member

sipa commented Jul 18, 2016

@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).

@gmaxwell
Copy link
Contributor

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.

@laanwj
Copy link
Member

laanwj commented Jul 26, 2016

Closing in favor of #8365, which was merged today

@laanwj laanwj closed this Jul 26, 2016
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bytespersigop prevents bare multisig in v0.12

7 participants