diff --git a/configure.ac b/configure.ac index 508ded9d0a907..c7fdcb60b7ae5 100644 --- a/configure.ac +++ b/configure.ac @@ -1685,7 +1685,11 @@ AM_CONDITIONAL([ENABLE_ZMQ], [test "x$use_zmq" = "xyes"]) AC_MSG_CHECKING([whether to build test_dash]) if test x$use_tests = xyes; then - AC_MSG_RESULT([yes]) + if test "x$enable_fuzz" = "xyes"; then + AC_MSG_RESULT([no, because fuzzing is enabled]) + else + AC_MSG_RESULT([yes]) + fi BUILD_TEST="yes" else AC_MSG_RESULT([no]) @@ -1877,11 +1881,13 @@ if test x$bitcoin_enable_qt != xno; then echo " with qr = $use_qr" fi echo " with zmq = $use_zmq" -echo " with test = $use_tests" -echo " with bench = $use_bench" -if test x$use_tests != xno; then - echo " with fuzz = $enable_fuzz" +if test x$enable_fuzz == xno; then + echo " with test = $use_tests" +else + echo " with test = not building test_dash because fuzzing is enabled" + echo " with fuzz = $enable_fuzz" fi +echo " with bench = $use_bench" echo " with upnp = $use_upnp" echo " with natpmp = $use_natpmp" echo " use asm = $use_asm" diff --git a/src/init.cpp b/src/init.cpp index 87e55a47b212c..0a9a4aed6cd3b 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -710,7 +710,6 @@ void SetupServerArgs(NodeContext& node) argsman.AddArg("-checkmempool=", strprintf("Run checks every transactions (default: %u, regtest: %u)", defaultChainParams->DefaultConsistencyChecks(), regtestChainParams->DefaultConsistencyChecks()), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST); argsman.AddArg("-checkpoints", strprintf("Enable rejection of any forks from the known historical chain until block 1450000 (default: %u)", DEFAULT_CHECKPOINTS_ENABLED), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST); argsman.AddArg("-deprecatedrpc=", "Allows deprecated RPC method(s) to be used", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST); - argsman.AddArg("-dropmessagestest=", "Randomly drop 1 of every network messages", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST); argsman.AddArg("-limitancestorcount=", strprintf("Do not accept transactions if number of in-mempool ancestors is or more (default: %u)", DEFAULT_ANCESTOR_LIMIT), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST); argsman.AddArg("-limitancestorsize=", strprintf("Do not accept transactions whose size with all in-mempool ancestors exceeds kilobytes (default: %u)", DEFAULT_ANCESTOR_SIZE_LIMIT), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST); argsman.AddArg("-limitdescendantcount=", strprintf("Do not accept transactions if any ancestor would have or more in-mempool descendants (default: %u)", DEFAULT_DESCENDANT_LIMIT), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST); diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 7f2918bea0928..737d2243ef5b6 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -2791,11 +2791,6 @@ void PeerManagerImpl::ProcessMessage( LogPrint(BCLog::NET, "received: %s (%u bytes) peer=%d\n", SanitizeString(msg_type), vRecv.size(), pfrom.GetId()); statsClient.inc("message.received." + SanitizeString(msg_type), 1.0f); - if (gArgs.IsArgSet("-dropmessagestest") && GetRand(gArgs.GetArg("-dropmessagestest", 0)) == 0) - { - LogPrintf("dropmessagestest DROPPING RECV MESSAGE\n"); - return; - } PeerRef peer = GetPeerRef(pfrom.GetId()); if (peer == nullptr) return; diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index 6f5f172597de2..78094c4fb6f59 100644 --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -150,7 +150,7 @@ static UniValue getrawtransaction(const JSONRPCRequest& request) {RPCResult::Type::OBJ, "", "", { {RPCResult::Type::STR_HEX, "txid", "The transaction id"}, - {RPCResult::Type::STR, "vout", ""}, + {RPCResult::Type::NUM, "vout", "The output number"}, {RPCResult::Type::OBJ, "scriptSig", "The script", { {RPCResult::Type::STR, "asm", "asm"}, diff --git a/src/test/fuzz/script.cpp b/src/test/fuzz/script.cpp index 8a6c5added219..740b1f9969e99 100644 --- a/src/test/fuzz/script.cpp +++ b/src/test/fuzz/script.cpp @@ -69,6 +69,13 @@ FUZZ_TARGET_INIT(script, initialize_script) TxoutType which_type; (void)IsStandard(script, which_type); + if (which_type == TxoutType::NULL_DATA) { + assert(script.IsUnspendable()); + } + if (script.IsUnspendable()) { + assert(which_type == TxoutType::NULL_DATA || + which_type == TxoutType::NONSTANDARD); + } (void)RecursiveDynamicUsage(script); @@ -77,7 +84,6 @@ FUZZ_TARGET_INIT(script, initialize_script) (void)script.IsPayToScriptHash(); (void)script.IsPushOnly(); - (void)script.IsUnspendable(); (void)script.GetSigOpCount(/* fAccurate= */ false); (void)FormatScript(script); diff --git a/test/functional/test_framework/test_framework.py b/test/functional/test_framework/test_framework.py index 6475f0de1f368..fced2a3862c09 100755 --- a/test/functional/test_framework/test_framework.py +++ b/test/functional/test_framework/test_framework.py @@ -610,13 +610,12 @@ def start_nodes(self, extra_args=None, *args, **kwargs): def stop_node(self, i, expected_stderr='', wait=0): """Stop a dashd test node""" self.nodes[i].stop_node(expected_stderr=expected_stderr, wait=wait) - self.nodes[i].wait_until_stopped() def stop_nodes(self, expected_stderr='', wait=0): """Stop multiple dashd test nodes""" for node in self.nodes: # Issue RPC to stop nodes - node.stop_node(expected_stderr=expected_stderr, wait=wait) + node.stop_node(expected_stderr=expected_stderr, wait=wait, wait_until_stopped=False) for node in self.nodes: # Wait for nodes to stop diff --git a/test/functional/test_framework/test_node.py b/test/functional/test_framework/test_node.py index 26cc2a2bb1cc1..6391136b119ee 100755 --- a/test/functional/test_framework/test_node.py +++ b/test/functional/test_framework/test_node.py @@ -319,7 +319,7 @@ def get_wallet_rpc(self, wallet_name): def version_is_at_least(self, ver): return self.version is None or self.version >= ver - def stop_node(self, expected_stderr='', wait=0): + def stop_node(self, expected_stderr='', *, wait=0, wait_until_stopped=True): """Stop the node.""" if not self.running: return @@ -344,6 +344,9 @@ def stop_node(self, expected_stderr='', wait=0): del self.p2ps[:] + if wait_until_stopped: + self.wait_until_stopped() + def is_node_stopped(self): """Checks whether the node has stopped.