-
Notifications
You must be signed in to change notification settings - Fork 38.1k
Change sigops cost to sigops weight #8844
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
I've noticed there are more sigopsCost variables that I haven't renamed. Marking this PR as WIP until I've also fixed those. |
5659b07
to
2fb71e4
Compare
Ready for review. I've tested with |
2fb71e4
to
ea3ee6a
Compare
rebased. @laanwj - can I get a concept ACK/NACK for this? Do you think it's worth considering? I personally think it's a good idea to have consistent terminology between block/sigops weight, but other people may not think it's worth the code churn. |
Should just go back to simply "sigops". Old sigop counting is dead once segwit activates. |
Thanks for the input @luke-jr . I'd be worried that calling SigOpsWeight just "sigops" would be confusing, as people reading the code might think that it refers to the number of signature operations (it doesn't since the the sigops in the scriptSig and scriptPubKey are multiplied by the witness scaling factor, and the sigops in the witness aren't) |
ea3ee6a
to
f119ec2
Compare
bad rebase. Should be fixed now. |
This needs a rebase. |
I'm not convinced that we need to do this inside the codebase, but no objection. |
Closing. There doesn't seem to be much appetite to make this change. |
BIP 141 (#8149) introduced a new metric for counting block size. This was initially called 'block cost', but was renamed to 'block weight' in 2c06bae (and is referred to as 'block weight' in https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki)
BIP 141 also changed the way that sigops are counted in transactions and blocks in exactly the same way - the limit was increased 4x, sigops in the main tx structure are counted 4x and sigops in the witness are counted 1x (essentially giving sigops in the witness a discount). This new metric was initially called SIGOPS_COST in the code. This PR changes the name to SIGOPS_WEIGHT to bring it in line with transaction/block weight.