diff options
author | fanquake <fanquake@gmail.com> | 2023-11-28 16:23:49 +0000 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2023-11-28 16:24:06 +0000 |
commit | 31ce305d46a191621aaa78a73fa4bbc7e58d8ed0 (patch) | |
tree | a11a718eb7ab124e34abca69acc47632166db673 | |
parent | 26b7bcf10ebcc055cf6226629498a09986ce0e6c (diff) | |
parent | fa825975b57bc5c4323e5d6f4bc8cd2b8189e238 (diff) | |
download | bitcoin-31ce305d46a191621aaa78a73fa4bbc7e58d8ed0.tar.xz |
Merge bitcoin/bitcoin#28952: fuzz: Avoid timeout in process_messages
fa825975b57bc5c4323e5d6f4bc8cd2b8189e238 fuzz: Avoid timeout in process_messages (MarcoFalke)
Pull request description:
Reduce the number of messages per fuzz input. There should be no reason to have more messages than that.
This should also avoid timeouts, such as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=64548. CC https://github.com/bitcoin/bitcoin/issues/28812
ACKs for top commit:
dergoegge:
utACK fa825975b57bc5c4323e5d6f4bc8cd2b8189e238
Tree-SHA512: eeff732f7b0bd9a71f23aeecbf813d31fe34d355b906fd0384a43075cbc3cebc46a26df741b0f337208d8b33b3e28210c9b9437e2eed77844f03131bb8f5f2a1
-rw-r--r-- | src/test/fuzz/process_messages.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/test/fuzz/process_messages.cpp b/src/test/fuzz/process_messages.cpp index 4cb388c20b..b7e2e04b4b 100644 --- a/src/test/fuzz/process_messages.cpp +++ b/src/test/fuzz/process_messages.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2022 The Bitcoin Core developers +// Copyright (c) 2020-present The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -6,6 +6,8 @@ #include <net.h> #include <net_processing.h> #include <protocol.h> +#include <script/script.h> +#include <sync.h> #include <test/fuzz/FuzzedDataProvider.h> #include <test/fuzz/fuzz.h> #include <test/fuzz/util.h> @@ -14,9 +16,15 @@ #include <test/util/net.h> #include <test/util/setup_common.h> #include <test/util/validation.h> -#include <validation.h> +#include <util/chaintype.h> +#include <util/time.h> #include <validationinterface.h> +#include <ios> +#include <string> +#include <utility> +#include <vector> + namespace { const TestingSetup* g_setup; } // namespace @@ -55,7 +63,8 @@ FUZZ_TARGET(process_messages, .init = initialize_process_messages) connman.AddTestNode(p2p_node); } - LIMITED_WHILE(fuzzed_data_provider.ConsumeBool(), 10000) { + LIMITED_WHILE(fuzzed_data_provider.ConsumeBool(), 30) + { const std::string random_message_type{fuzzed_data_provider.ConsumeBytesAsString(CMessageHeader::COMMAND_SIZE).c_str()}; const auto mock_time = ConsumeTime(fuzzed_data_provider); |