Change the script_valid/script_invalid rules to use actually valid transactions, and add some simple tests with OP_CHECKSIG, and various verification flags.
Add script tests with actual signatures #4949
pull sipa wants to merge 2 commits into bitcoin:master from sipa:canscript changing 3 files +95 −7-
sipa commented at 1:28 AM on September 20, 2014: member
-
petertodd commented at 4:58 PM on September 20, 2014: contributor
I was nearly going to say "why bother given we have the tx tests", but actually really what you're doing is more explicitly defining the context that the script tests run in. I'm working on OP_CHECKLOCKTIMEVERIFY, which looks like will probably need a broader notion of the context in which a script executes, but as this is purely a sane "default context" any further needs to modify the default can be handled separately without this causing any issues.
It'd help if there was a comment saying, say, what the txid of that hypothetical coinbase transaction actually was. Heck, next time I write up a complex signature-using test I'll put the python script to create it in doc/ somewhere.
-
sipa commented at 5:21 PM on September 20, 2014: member
There are comments in script_valid.json and script_invalid.json, are those insufficient?
I'm aware that this makes it closer to the tx tests, but these are more concise still, and enough to test most of the specific script weirdnesses.
-
petertodd commented at 5:29 PM on September 20, 2014: contributor
@sipa By putting the txid in the comment it makes it easy to figure out if you're code to make a new testcase is reproducing the coinbase tx properly; easy to imagine it being frustrating trying to figure out why it's not working. Also makes it easy to check if anything changes somehow via an unrelated change that makes the coinbase tx creation code change.
-
petertodd commented at 5:29 PM on September 20, 2014: contributor
Out of curiosity, how did you make those signatures?
-
sipa commented at 5:48 PM on September 20, 2014: member
Use BuildCreditingTransaction, and call SignSignature on it, and print out the result. I've thought about automating it, but all potential modifications for the invalid ones are pretty ugly to write as code.
-
sipa commented at 6:03 PM on September 20, 2014: member
I'm going to try to clean that generation code up, and include it in the tests.
-
laanwj commented at 8:20 AM on September 22, 2014: member
ACK, more tests is better.
-
Use actually valid transactions for script tests 76ec867796
-
Add actual signature tests c8589bf99e
- sipa force-pushed on Sep 22, 2014
-
sipa commented at 5:36 PM on September 22, 2014: member
@petertodd See #4960.
-
BitcoinPullTester commented at 5:42 PM on September 22, 2014: none
Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/p4949_c8589bf99e7d4b352763905e56799a03adda25a7/ for binaries and test log. This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.
-
gmaxwell commented at 6:05 PM on September 22, 2014: contributor
utACK.
- laanwj added the label Tests on Sep 23, 2014
- laanwj merged this on Sep 23, 2014
- laanwj closed this on Sep 23, 2014
- laanwj referenced this in commit 35ee2dac67 on Sep 23, 2014
-
shea256 commented at 9:24 PM on June 2, 2015: contributor
@petertodd @sipa Any idea if and when OP_CHECKLOCKTIMEVERIFY will be integrated? This would be a godsend for a project I'm working on.
-
petertodd commented at 6:21 AM on June 3, 2015: contributor
@shea256 Not really the right place for that question, but anyway, BIP66 needs to get adopted first: http://bitcoin.sipa.be/ver-2k.png http://bitcoin.sipa.be/ver-ever.png
All the major pools have upgraded; what's left is <5% pools like slush.
-
shea256 commented at 3:23 PM on June 3, 2015: contributor
OK thank you Peter.
I just looked through all the issues and this was the only one I saw that referenced CLTV. For the future, where should I direct my questions about this?
-
laanwj commented at 5:57 PM on June 3, 2015: member
The development mailing list is the place for discussion of network-wide issues
-
shea256 commented at 6:16 PM on June 3, 2015: contributor
Perfect, thank you. Please excuse my posting here, I will use that for the future.
- MarcoFalke locked this on Sep 8, 2021