Author

Topic: Is there any test data for SigOpCount? (Read 148 times)

staff
Activity: 3458
Merit: 6793
Just writing some code
April 12, 2020, 11:40:44 AM
#6
While not explicitly test vectors, there are some SigOp count tests in https://github.com/bitcoin/bitcoin/blob/master/src/test/sigopcount_tests.cpp

PS. Is there any limit (consensus-wise not standard-wise) per transaction or is the limit only per block?
There are limits per script.
legendary
Activity: 1042
Merit: 2805
Bitcoin and C♯ Enthusiast
April 12, 2020, 07:39:51 AM
#5
Why are you looking for that if you don't mind?

I'm currently refactoring the Script part of Bitcoin.Net library and writing a BlockVerifier + TransactionVerifier classes and the SigOpCount method needs testing.
jr. member
Activity: 38
Merit: 19
April 12, 2020, 06:41:17 AM
#4
Indeed, unfortunately Bitcoin core's tests aren't that extensive but it has improved greatly over time (there used to be very few). I just found another test for segwit: https://github.com/bitcoin/bitcoin/blob/0.20/test/functional/p2p_segwit.py#L1918

Why are you looking for that if you don't mind?
legendary
Activity: 1042
Merit: 2805
Bitcoin and C♯ Enthusiast
April 12, 2020, 06:31:24 AM
#3
Those are the only tests I could find in bitcoin-core: https://github.com/bitcoin/bitcoin/blob/0.20/test/functional/feature_block.py#L250

That is only testing the case where number of SigOps exceeds the maximum with a very simple mock script.
jr. member
Activity: 38
Merit: 19
April 12, 2020, 06:13:28 AM
#2
Those are the only tests I could find in bitcoin-core: https://github.com/bitcoin/bitcoin/blob/0.20/test/functional/feature_block.py#L250

Here's the sigop calculation function: https://github.com/bitcoin/bitcoin/blob/0.20/src/consensus/tx_verify.cpp#L138

Maybe you can try asking in the bitcoin core IRC channel.
legendary
Activity: 1042
Merit: 2805
Bitcoin and C♯ Enthusiast
April 12, 2020, 04:58:41 AM
#1
I'm trying to make sense of how sigops are supposed to be counted and although I think I've figured it out but since it makes little sense I'd like to see some test vectors. Hopefully something like SignatureScript:Foo SigOpCount:m; PubkeyScript:Bar SigOpCount:n.

PS. Is there any limit (consensus-wise not standard-wise) per transaction or is the limit only per block?
Jump to: