Page MenuHomePhabricator

Increase test coverage on CScript.IsPushOnly()

Authored by markblundeberg on Jun 9 2019, 02:26.


Group Reviewers
Restricted Project
Maniphest Tasks
T667: add rule for **minimal** push only in scriptSig

Part of effort to get a scriptsig push restriction consensuse rule that is actually effective in reducing third party malleability, see T667.

In preparation for adding IsMinimalPushOnly, this creates a broader set
of tests.

Test Plan

make check

Diff Detail

Event Timeline

markblundeberg created this revision.Jun 9 2019, 02:26
Herald added a reviewer: Restricted Project. · View Herald TranscriptJun 9 2019, 02:26
markblundeberg edited the summary of this revision. (Show Details)Jun 10 2019, 17:54
jasonbcox requested changes to this revision.Jun 10 2019, 22:49
jasonbcox added inline comments.

Nearly all of the above cases can be rolled into a loop. This provides the following benefits:

  • Covers more cases (especially with some modest randomization mixed in)
  • Less code to read
  • Easier to maintain (given that behavior won't change for different OP_PUSHDATA<N>, which is a reasonable assumption)

Why exclude OP_0? It seems that this would be more robust if you devised a set of all opcodes and then removed the ones you don't want to test.

This revision now requires changes to proceed.Jun 10 2019, 22:49
markblundeberg abandoned this revision.Jun 19 2019, 15:52