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_ENABLE_SCHNORR_MULTISIG; enum txnouttype { TX_NONSTANDARD, diff --git a/src/validation.cpp b/src/validation.cpp --- a/src/validation.cpp +++ b/src/validation.cpp @@ -799,7 +799,6 @@ } if (IsGravitonEnabledForCurrentBlock(consensusParams)) { - extraFlags |= SCRIPT_ENABLE_SCHNORR_MULTISIG; extraFlags |= SCRIPT_VERIFY_MINIMALDATA; } diff --git a/test/functional/abc-schnorrmultisig-activation.py b/test/functional/abc-schnorrmultisig-activation.py --- a/test/functional/abc-schnorrmultisig-activation.py +++ b/test/functional/abc-schnorrmultisig-activation.py @@ -215,7 +215,7 @@ ecdsa0tx = create_fund_and_spend_tx(OP_0, 'ecdsa') ecdsa0tx_2 = create_fund_and_spend_tx(OP_0, 'ecdsa') - # two of these, which are valid before upgrade and invalid after. + # two of these, which are nonstandard before upgrade and invalid after. ecdsa1tx = create_fund_and_spend_tx(OP_1, 'ecdsa') ecdsa1tx_2 = create_fund_and_spend_tx(OP_1, 'ecdsa') @@ -233,6 +233,14 @@ self.log.info("Sending rejected transactions via RPC") assert_raises_rpc_error(-26, SCHNORR_LEGACY_MULTISIG_ERROR, node.sendrawtransaction, ToHex(schnorr0tx)) + # Since MULTISIG_SCHNORR is in mandatory flags, we are not accepting + # non-null-dummy ECDSA transactions before the upgrade. We get a + # post-upgrade error since the mempool is using post-upgrade flags. + assert_raises_rpc_error(-26, POSTUPGRADE_ECDSA_NULLDUMMY_ERROR, + node.sendrawtransaction, ToHex(ecdsa1tx)) + # The Schnorr multisig almost gets accepted but it finally gets + # caught in the consensus flags check. Note that "BUG! PLEASE REPORT + # THIS!" will appear in the log however this is benign. assert_raises_rpc_error(-26, PREUPGRADE_SCHNORR_MULTISIG_ERROR, node.sendrawtransaction, ToHex(schnorr1tx)) @@ -242,6 +250,8 @@ schnorr0tx, SCHNORR_LEGACY_MULTISIG_ERROR) self.check_for_ban_on_rejected_tx( schnorr1tx, PREUPGRADE_SCHNORR_MULTISIG_ERROR) + self.check_for_ban_on_rejected_tx( + ecdsa1tx, POSTUPGRADE_ECDSA_NULLDUMMY_ERROR) self.log.info( "Sending invalid transactions in blocks (and get banned!)") @@ -286,7 +296,6 @@ self.log.info( "Mine the activation block itself, including a non-null-dummy ECDSA at the last possible moment") - node.p2p.send_txs_and_test([ecdsa1tx], node) tip = self.build_block(tip, [ecdsa1tx]) node.p2p.send_blocks_and_test([tip], node) @@ -345,7 +354,7 @@ "Invalidating the upgrade block evicts the transactions valid only after upgrade") node.invalidateblock(upgrade_block.hash) assert_equal(set(node.getrawmempool()), { - ecdsa0tx_2.hash, ecdsa1tx.hash}) + ecdsa0tx_2.hash}) self.log.info("Return to our tip") node.reconsiderblock(upgrade_block.hash)