Page MenuHomePhabricator

Increase test coverage on CScript.IsPushOnly()

Authored by markblundeberg on Sun, Jun 9, 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.Sun, Jun 9, 02:26
Herald added a reviewer: Restricted Project. · View Herald TranscriptSun, Jun 9, 02:26
markblundeberg edited the summary of this revision. (Show Details)Mon, Jun 10, 17:54
jasonbcox requested changes to this revision.Mon, Jun 10, 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.Mon, Jun 10, 22:49
markblundeberg abandoned this revision.Wed, Jun 19, 15:52