From 0b8fe88f5c063c1d8d056f3511f54c2a7cf8f505 Mon Sep 17 00:00:00 2001 From: Kittywhiskers Van Gogh <63189531+kwvg@users.noreply.github.com> Date: Sun, 27 Jul 2025 05:09:27 +0000 Subject: [PATCH 1/2] chore: resolve logical conflict between dash#6691 and dash#6775 dash#6775 updates UniValue, which changed the syntax for fetching integers, which created a divergence of expected behavior from dash#6691 --- src/test/llmq_commitment_tests.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/llmq_commitment_tests.cpp b/src/test/llmq_commitment_tests.cpp index cfc193f42725..00423685851b 100644 --- a/src/test/llmq_commitment_tests.cpp +++ b/src/test/llmq_commitment_tests.cpp @@ -142,8 +142,8 @@ BOOST_AUTO_TEST_CASE(commitment_json_test) BOOST_CHECK(json.exists("signersCount")); BOOST_CHECK(json.exists("validMembersCount")); - BOOST_CHECK_EQUAL(json["signersCount"].get_int(), commitment.CountSigners()); - BOOST_CHECK_EQUAL(json["validMembersCount"].get_int(), commitment.CountValidMembers()); + BOOST_CHECK_EQUAL(json["signersCount"].getInt(), commitment.CountSigners()); + BOOST_CHECK_EQUAL(json["validMembersCount"].getInt(), commitment.CountValidMembers()); } BOOST_AUTO_TEST_CASE(commitment_bitvector_json_test) From 8bb8cfd46cf5f422910839b95734ac591865b855 Mon Sep 17 00:00:00 2001 From: Andrew Chow Date: Thu, 13 Jul 2023 19:06:45 -0400 Subject: [PATCH 2/2] Merge bitcoin/bitcoin#27549: fuzz: addrman, add coverage for `network` field in `Select()`, `Size()` and `GetAddr()` 35a2175ad8bec92b409ae2202c124e39b2f3f838 fuzz: addrman, add coverage for `network` field in `Select()`, `Size()` and `GetAddr()` (brunoerg) Pull request description: This PR adds fuzz coverage for `network` field in `Select()`, `Size()` and `GetAddr()`, there was only call to them without passing a network. https://marcofalke.github.io/b-c-cov/fuzz.coverage/src/addrman.cpp.gcov.html ACKs for top commit: amitiuttarwar: for the record, ACK 35a2175ad8bec92b409ae2202c124e39b2f3f838 - only small changes from the version (previously) proposed in 27213 achow101: ACK 35a2175ad8bec92b409ae2202c124e39b2f3f838 mzumsande: Code Review ACK 35a2175ad8bec92b409ae2202c124e39b2f3f838, haven't tested this yet, but I will let the fuzzer run for a while now. Tree-SHA512: dddb8322298d6c373c8e68d57538470b11825a9a310a355828c351d5c0b19ff6779d024a800e3ea90126d0c050e86f71fd22cd23d1a306c784cef0f82c45e3ca --- src/test/fuzz/addrman.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/test/fuzz/addrman.cpp b/src/test/fuzz/addrman.cpp index ba953d33c5e3..83c8dc4081b4 100644 --- a/src/test/fuzz/addrman.cpp +++ b/src/test/fuzz/addrman.cpp @@ -288,7 +288,21 @@ FUZZ_TARGET(addrman, .init = initialize_addrman) addr_man.SetServices(ConsumeService(fuzzed_data_provider), ConsumeWeakEnum(fuzzed_data_provider, ALL_SERVICE_FLAGS)); }); } - (void)addr_man.Size(); + const AddrMan& const_addr_man{addr_man}; + std::optional network; + if (fuzzed_data_provider.ConsumeBool()) { + network = fuzzed_data_provider.PickValueInArray(ALL_NETWORKS); + } + (void)const_addr_man.GetAddr( + /*max_addresses=*/fuzzed_data_provider.ConsumeIntegralInRange(0, 4096), + /*max_pct=*/fuzzed_data_provider.ConsumeIntegralInRange(0, 4096), + network); + (void)const_addr_man.Select(fuzzed_data_provider.ConsumeBool(), network); + std::optional in_new; + if (fuzzed_data_provider.ConsumeBool()) { + in_new = fuzzed_data_provider.ConsumeBool(); + } + (void)const_addr_man.Size(network, in_new); CDataStream data_stream(SER_NETWORK, PROTOCOL_VERSION); data_stream << addr_man; }