Merge #10699: Make all script validation flags backward compatible
commitc0902624b0ec6f5fff29eb6e922c58816f395dc8
authorWladimir J. van der Laan <laanwj@gmail.com>
Tue, 12 Dec 2017 09:10:14 +0000 (12 10:10 +0100)
committerWladimir J. van der Laan <laanwj@gmail.com>
Tue, 12 Dec 2017 09:11:00 +0000 (12 10:11 +0100)
tree55b0aeead40d1bc462db9b313948cb805abbfa3e
parent0e722e8879a8e1eebe02fd14c70c39346c79f95d
parent01013f5d2fbe3fa86565c927bf7bb8ec0f525073
Merge #10699: Make all script validation flags backward compatible

01013f5 Simplify tx validation tests (Pieter Wuille)
2dd6f80 Add a test that all flags are softforks (Pieter Wuille)
2851b77 Make all script verification flags softforks (Pieter Wuille)

Pull request description:

  This change makes `SCRIPT_VERIFY_UPGRADABLE_NOPS` not apply to `OP_CHECKLOCKTIMEVERIFY` and `OP_CHECKSEQUENCEVERIFY`. This is a no-op as `UPGRADABLE_NOPS` is only set for mempool transactions, and those always have `SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY` and `SCRIPT_VERIFY_CHECKSEQUENCEVERIFY` set as well. The advantage is that setting more flags now always results in a reduction in acceptable scripts (=softfork).

  This results in a nice and testable property for validation, for which a new test is added.

  This also means that the introduction of a new definition for a NOP or witness version will likely need the following procedure (example OP_NOP8 here)
  * Remove OP_NOP8 from being affected by `SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS`.
  * Add a `SCRIPT_VERIFY_DISCOURAGE_NOP8`, which only applies to `OP_NOP8`.
  * Add a `SCRIPT_VERIFY_NOP8` which implements the new consensus logic.
  * Before activation, add `SCRIPT_VERIFY_DISCOURAGE_NOP8` to the mempool flags.
  * After activation, add `SCRIPT_VERIFY_NOP8` to both the mempool and consensus flags.

Tree-SHA512: d3b4538986ecf646aac9dba13a8d89318baf9e308e258547ca3b99e7c0509747f323edac6b1fea4e87e7d3c01b71193794b41679ae4f86f6e11ed6be3fd62c72
src/script/interpreter.cpp
src/script/interpreter.h
src/test/data/script_tests.json
src/test/script_tests.cpp
src/test/txvalidationcache_tests.cpp