diff --git a/src/script/standard.h b/src/script/standard.h --- a/src/script/standard.h +++ b/src/script/standard.h @@ -49,7 +49,8 @@ */ static const uint32_t MANDATORY_SCRIPT_VERIFY_FLAGS = SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC | - SCRIPT_ENABLE_SIGHASH_FORKID | SCRIPT_VERIFY_LOW_S | SCRIPT_VERIFY_NULLFAIL; + SCRIPT_ENABLE_SIGHASH_FORKID | SCRIPT_VERIFY_LOW_S | + SCRIPT_VERIFY_NULLFAIL | SCRIPT_VERIFY_MINIMALDATA; enum txnouttype { TX_NONSTANDARD, diff --git a/src/validation.cpp b/src/validation.cpp --- a/src/validation.cpp +++ b/src/validation.cpp @@ -800,7 +800,6 @@ if (IsGravitonEnabledForCurrentBlock(consensusParams)) { extraFlags |= SCRIPT_ENABLE_SCHNORR_MULTISIG; - extraFlags |= SCRIPT_VERIFY_MINIMALDATA; } // Make sure whatever we need to activate is actually activated. diff --git a/test/functional/abc-minimaldata-activation.py b/test/functional/abc-minimaldata-activation.py --- a/test/functional/abc-minimaldata-activation.py +++ b/test/functional/abc-minimaldata-activation.py @@ -47,10 +47,9 @@ REPLAY_PROTECTION_START_TIME = GRAVITON_START_TIME * 2 -# Both before and after the upgrade, minimal push violations are rejected as -# nonstandard. After the upgrade they are actually invalid, but we get the -# same error since MINIMALDATA is internally marked as a "standardness" flag. -MINIMALPUSH_ERROR = 'non-mandatory-script-verify-flag (Data push larger than necessary)' +# Both before and after the upgrade, minimal push violations in mempool are +# rejected with a bannable error. +MINIMALPUSH_ERROR = 'mandatory-script-verify-flag-failed (Data push larger than necessary)' # Blocks with invalid scripts give this error: BADINPUTS_ERROR = 'blk-bad-inputs' @@ -197,12 +196,12 @@ node.sendrawtransaction, ToHex(nonminimaltx_3)) self.log.info( - "Sending rejected transactions via net (no banning)") - self.check_for_no_ban_on_rejected_tx( + "Sending rejected transactions via net (banning)") + self.check_for_ban_on_rejected_tx( nonminimaltx, MINIMALPUSH_ERROR) - self.check_for_no_ban_on_rejected_tx( + self.check_for_ban_on_rejected_tx( nonminimaltx_2, MINIMALPUSH_ERROR) - self.check_for_no_ban_on_rejected_tx( + self.check_for_ban_on_rejected_tx( nonminimaltx_3, MINIMALPUSH_ERROR) assert_equal(node.getrawmempool(), []) @@ -242,7 +241,7 @@ "If we try to submit it by mempool or RPC we still aren't banned") assert_raises_rpc_error(-26, MINIMALPUSH_ERROR, node.sendrawtransaction, ToHex(nonminimaltx_3)) - self.check_for_no_ban_on_rejected_tx( + self.check_for_ban_on_rejected_tx( nonminimaltx_3, MINIMALPUSH_ERROR) self.log.info("Mine a normal block")