HomePhabricator

Interpret scripts with CHECKDATASIG opcode always valid.

Description

Interpret scripts with CHECKDATASIG opcode always valid.

Summary:
Because CHECKDATASIG uses a previouly invalid opcode number, it does
not appear in any executed branches of scripts prior its introduction in the
Nov 15, 2018 Upgrade. This means that the interpreter can treat it as if
it has always been valid.

Before this change, the SCRIPT_ENABLE_CHECKDATASIG flag had both a permissive
(enabling the opcode) and a restrictive (enforcing siops counting) meaning.
This change simplifies the meaning of the flag to be restrictive only.

Test Plan:
make check

Did IBD on mainet and testnet with -checkpoints=0 -assumevalid=0

src/test/checkdatasig_tests.cpp is changed to reflect the new behavior of always allowing op_cds regardless of flag value.

src/test/sigopcount_tests.cpp remains the same to check that the flag still changes sigops counting behavior.

src/test/data/script_tests.json "BAD_OPCODE" test cases removed

Reviewers: deadalnix, markblundeberg, jasonbcox, Fabien, #bitcoin_abc

Reviewed By: deadalnix, markblundeberg, #bitcoin_abc

Maniphest Tasks: T653

Differential Revision: https://reviews.bitcoinabc.org/D3100

Details

Provenance
MengerianAuthored on May 18 2019, 19:05
jasonbcoxPushed on May 24 2019, 18:08
Reviewer
Restricted Project
Differential Revision
D3100: Interpret scripts with CHECKDATASIG opcode always valid.
Parents
rSTAGING90e59928c007: tests: move pwalletMain to wallet test fixture
Branches
Unknown
Tags
Unknown