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
[script] Add method count_sigops #1890
Conversation
A preview of what's to come: junderw/rust-bitcoin@feat/getsigopcount...feat/wip-sigop-tx This is very rough, and I'm assuming it will need to be behind the consensus flag and needs tests... but this is a rough WIP idea of where I'm trying to go with this. Eventually, we want Esplora to return sigop based vSize as well (if it's higher). But for now (this PR) I'm putting it off until we discuss here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept ACK
Continuing on the thread of things that aren't rust-like, perhaps we should make two methods, Either that or create a bool-enum that's more descriptive, like |
I'd prefer two methods to an enum, but I don't feel strongly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution!
Its no biggy but I'd prefer it all in one patch because later patches change earlier patches. I added a rustdoc suggestion to test for off-by-one errors.
Now we definitely want a single commit, this is going to be annoying for others to review :) |
4dcb149
to
85e4672
Compare
Done. |
hmmm, I don't really like the co-authored-by tag but because you put it in it forced me to look a lot closer at the code so I guess that's a win. (All I did was give some review suggestions so I totally don't need attribution, but thanks for the thought.) To the best of my knowledge this PR mirrors the behavior in Core ACK 85e4672 |
I think I just invented a new underhanded way to get a review! hahahahahah /s |
I like changing it to two methods, I was thinking about it before but forgot to mention it. Bit more bikeshedding: in Rust we tend to not use the (Also @tcharding you forgot to hit approve) |
85e4672
to
638445f
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 638445f
Can be improved in a followup PR.
Follow up PR started here: 24a3352 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 638445f
post merge ACK 1a1fe0e. Double checked with bitcoin core source. |
d961b9c Fix minor comments on count_sigops PR (junderw) Pull request description: Fixing some comments that were left on #1890 ACKs for top commit: yancyribbens: ACK d961b9c apoelstra: ACK d961b9c tcharding: ACK d961b9c Tree-SHA512: caa04428eb7c09915964e4a7bae2d1fca2426317f3620d16e73e992269a99d7adb3d360affb954a173835661a9960cf760d29ae9861816b1a898c01428b0f2d6
Planning to also add methods for the various parts of Transaction etc. to eventually allow for easier sigops calculation.
Bare multisig is making a comeback, which is causing a large amount of transactions' effective vSizes (for fee calculation) to be dependent on the sigop count.
This is a first step at making those transactions easier to estimate fees for / template blocks for etc.