Explicitly unittest the canonical prunable txout format #2336

pull petertodd wants to merge 2 commits into bitcoin:master from petertodd:invalid-opcode-coverage changing 2 files +136 −1
  1. petertodd commented at 9:54 PM on February 24, 2013: contributor

    Test every invalid op code, and add an explicit test for Gavin's proposed format for provably unspendable/always prunable transactions using the 0xFF invalid opcode. Specifically any scriptPubKey of the following form:

    0xFF {zero or more ops}
    

    Because the scriptSig and scriptPubKey are processed separately one can't even use IF/ENDIF trickery to defeat this. I also like how it says "INVALID" quite clearly as the first opcode. I've tried this out on testnet with no issues.

    Unless anyone has a reason why this standard is a bad idea I'm also going to raise the issue with P2Pool; currently they are the main producer of non-prunable txouts that could be made prunable this way.

    No code to actually do anything with this standard is included in this patch; that can be done later.

  2. BitcoinPullTester commented at 12:02 AM on February 25, 2013: none

    Automatic sanity-testing: WARNING, see http://jenkins.bluematt.me/pull-tester/b7cf0454ad6d831965d8ace7209b54726c166aec for binaries and test log.

    This pull decreases total test coverage, please add unit tests to test all new code and help us add test cases for existing code. Coverage report can be found at http://jenkins.bluematt.me/pull-tester/b7cf0454ad6d831965d8ace7209b54726c166aec/bitcoin/src/total.coverage/

  3. gmaxwell commented at 12:12 AM on February 25, 2013: contributor

    @BitcoinPullTester LOL. Should he write a unit test for the unit test?

  4. petertodd commented at 12:52 AM on February 25, 2013: contributor

    "Yo dawg..."

    Of course, I did test that those unittest's fail if you invert the logic...

  5. Add coverage for all invalid ops
    0xba thru 0xff
    6131d1d9df
  6. Test canonical prunable txout format explicitly 091f184190
  7. petertodd commented at 7:43 AM on March 1, 2013: contributor

    Changed to RETURN from 0xff as per IRC discussion.

  8. BitcoinPullTester commented at 3:40 PM on March 3, 2013: none

    Automatic sanity-testing: WARNING, see http://jenkins.bluematt.me/pull-tester/091f18419011bfee6242270e52237f524ca23c8e for binaries and test log.

    This pull decreases total test coverage, please add unit tests to test all new code and help us add test cases for existing code. Coverage report can be found at http://jenkins.bluematt.me/pull-tester/091f18419011bfee6242270e52237f524ca23c8e/bitcoin/src/total.coverage/

  9. gavinandresen referenced this in commit 1a9ee5da32 on Mar 11, 2013
  10. gavinandresen merged this on Mar 11, 2013
  11. gavinandresen closed this on Mar 11, 2013

  12. petertodd deleted the branch on Mar 11, 2013
  13. laudney referenced this in commit 51164e3ef6 on Mar 19, 2014
  14. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 12:16 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me