test: Make AddrMan unit tests use public interface, extend coverage #23826

pull mzumsande wants to merge 11 commits into bitcoin:master from mzumsande:202112_addrman_unit_tests_1 changing 4 files +285 −268
  1. mzumsande commented at 2:19 pm on December 20, 2021: member

    This PR (joint work with Amiti Uttarwar) changes the addrman unit tests such that they only use the public AddrMan interface: This has the advantage that the tests are less implementation-dependent, i.e. it would be possible to rewrite the internal addrman implementation (as drafted here for using a multiindex) without having to adjust the tests.

    This includes the following steps:

    • Adding a test-only function FindAddressEntry() to the public addrman interface which returns info about an address in addrman (e.g. bucket, position, whethe the address is in new or tried). Obviously we want to do this sparingly, but I think a single test-only function is ok (which could also be useful elsewhere, e.g. in fuzz tests).
    • Removal of the AddrManTest subclass which would reach into AddrMan’s internals, using AddrMan instead
    • Removal of tests for internal helper functions that are not publicly exposed (these are still tested indirectly via the public functions calling them).
    • Additional tests for previously untested features such as multiplicity in the new tables, that can be tested with the help of FindAddressEntry().

    All in all, this PR increases the unit test coverage of AddrMan by a bit.

  2. fanquake added the label Tests on Dec 20, 2021
  3. jamesob commented at 2:36 pm on December 20, 2021: member
    Concept ACK based on the description
  4. jnewbery commented at 2:55 pm on December 20, 2021: member
    Strong concept ACK!
  5. glozow commented at 2:58 pm on December 20, 2021: member
    Concept ACK
  6. DrahtBot commented at 3:12 am on December 21, 2021: member

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #23807 (p2p: Remove GetAdjustedTime() from AddrMan by w0xlt)
    • #23373 (test: Parse command line arguments from unit and fuzz tests, make addrman consistency check ratio easier to change by vasild)
    • #22910 ([RFC] Encapsulate asmap in NetGroupManager by jnewbery)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  7. in src/addrman.cpp:938 in 250479a287 outdated
    929@@ -930,6 +930,31 @@ std::pair<CAddress, int64_t> AddrManImpl::SelectTriedCollision_()
    930     return {info_old, info_old.nLastTry};
    931 }
    932 
    933+std::optional<AddressPosition> AddrManImpl::FindAddressEntry_(const CAddress& addr)
    934+{
    935+    AssertLockHeld(cs);
    936+
    937+    int nId;
    938+    AddrInfo* addr_info_temp = Find(addr, &nId);
    


    jnewbery commented at 4:27 pm on December 21, 2021:

    nId is unused. Try:

    0    AddrInfo* addr_info_temp = Find(addr);
    

    mzumsande commented at 4:13 pm on December 23, 2021:
    done as suggested.
  8. in src/addrman.h:176 in 250479a287 outdated
    169+    /** Test-only function
    170+     * Find the address record in AddrMan and return information about its
    171+     * position.
    172+     * @param[in] addr       The address record to look up.
    173+     * @return               Information about the address record in AddrMan
    174+     *                       nullptr if address is not found
    


    jnewbery commented at 4:28 pm on December 21, 2021:
    0     * [@return](/bitcoin-bitcoin/contributor/return/)               Information about the address record in AddrMan or
    1     *                       nullopt if address is not found.
    

    jnewbery commented at 12:18 pm on December 28, 2021:
    This was marked as resolved, but still says nullptr.

    mzumsande commented at 8:58 pm on December 28, 2021:
    sorry - that was an oversight. Changed now.
  9. in src/addrman.cpp:940 in 250479a287 outdated
    935+    AssertLockHeld(cs);
    936+
    937+    int nId;
    938+    AddrInfo* addr_info_temp = Find(addr, &nId);
    939+
    940+    if (!addr_info_temp) { return std::nullopt; }
    


    jnewbery commented at 4:29 pm on December 21, 2021:

    No need for braces if the if block is just one statement:

    0    if (!addr_info_temp) return std::nullopt;
    

    or:

    0    if (!addr_info_temp) {
    1        return std::nullopt;
    2    }
    

    mzumsande commented at 4:15 pm on December 23, 2021:
    took the first suggestoin
  10. in src/addrman.h:28 in 250479a287 outdated
    21@@ -22,6 +22,29 @@ class AddrManImpl;
    22 /** Default for -checkaddrman */
    23 static constexpr int32_t DEFAULT_ADDRMAN_CONSISTENCY_CHECKS{0};
    24 
    25+/** Test-only struct, capturing info about an address in AddrMan */
    26+struct AddressPosition {
    27+    // Whether the address is in the new or tried table
    28+    bool tried{false};
    


    jnewbery commented at 4:55 pm on December 21, 2021:

    Since this struct is only used to pass data out of the module, what do you think about making all the members const, eg:

     0index bb3c22ebdb..dba0b3a4a6 100644
     1--- a/src/addrman.cpp
     2+++ b/src/addrman.cpp
     3@@ -940,19 +940,19 @@ std::optional<AddressPosition> AddrManImpl::FindAddressEntry_(const CAddress& ad
     4     if (!addr_info_temp) { return std::nullopt; }
     5     const AddrInfo& addr_info = *addr_info_temp;
     6 
     7-    AddressPosition entry;
     8     if(addr_info.fInTried) {
     9-        entry.tried = true;
    10-        entry.multiplicity = 1;
    11-        entry.bucket = addr_info.GetTriedBucket(nKey, m_asmap);
    12-        entry.position = addr_info.GetBucketPosition(nKey, false, entry.bucket);
    13-        return entry;
    14+        int bucket{addr_info.GetTriedBucket(nKey, m_asmap)};
    15+        return AddressPosition(/*tried=*/true,
    16+                               /*multiplicity=*/1,
    17+                               /*bucket=*/bucket,
    18+                               /*position=*/addr_info.GetBucketPosition(nKey, false, bucket));
    19+    } else {
    20+        int bucket{addr_info.GetNewBucket(nKey, m_asmap)};
    21+        return AddressPosition(/*tried=*/false,
    22+                               /*multiplicity=*/addr_info.nRefCount,
    23+                               /*bucket=*/bucket,
    24+                               /*position=*/addr_info.GetBucketPosition(nKey, true, bucket));
    25     }
    26-
    27-    entry.multiplicity = addr_info.nRefCount;
    28-    entry.bucket = addr_info.GetNewBucket(nKey, m_asmap);
    29-    entry.position = addr_info.GetBucketPosition(nKey, true, entry.bucket);
    30-    return entry;
    31 }
    32 
    33 void AddrManImpl::Check() const
    34diff --git a/src/addrman.h b/src/addrman.h
    35index 7cda33c185..68399fbd0d 100644
    36--- a/src/addrman.h
    37+++ b/src/addrman.h
    38@@ -25,24 +25,28 @@ static constexpr int32_t DEFAULT_ADDRMAN_CONSISTENCY_CHECKS{0};
    39 /** Test-only struct, capturing info about an address in AddrMan */
    40 struct AddressPosition {
    41     // Whether the address is in the new or tried table
    42-    bool tried{false};
    43+    const bool tried;
    44 
    45     // Addresses in the tried table should always have a multiplicity of 1.
    46     // Addresses in the new table can have multiplicity between 1 and
    47     // ADDRMAN_NEW_BUCKETS_PER_ADDRESS
    48-    int multiplicity{0};
    49+    const int multiplicity;
    50 
    51     // If the address is in the new table, the bucket and position are
    52     // populated based on the first source who sent the address.
    53     // In certain edge cases, this may not be where the address is currently
    54     // located.
    55-    int bucket{0};
    56-    int position{0};
    57+    const int bucket;
    58+    const int position;
    59 
    60     bool operator==(AddressPosition other) {
    61         return std::tie(tried, multiplicity, bucket, position) ==
    62                std::tie(other.tried, other.multiplicity, other.bucket, other.position);
    63     }
    64+
    65+    explicit AddressPosition(bool tried_in, int multiplicity_in, int bucket_in, int position_in)
    66+        : tried{tried_in}, multiplicity{multiplicity_in}, bucket{bucket_in}, position{position_in} {}
    67+
    68 };
    69 
    70 /** Stochastic address manager
    71diff --git a/src/test/addrman_tests.cpp b/src/test/addrman_tests.cpp
    72index a4d57e3435..bf09d631d4 100644
    73--- a/src/test/addrman_tests.cpp
    74+++ b/src/test/addrman_tests.cpp
    75@@ -237,8 +237,8 @@ BOOST_AUTO_TEST_CASE(addrman_new_multiplicity)
    76         addr.nTime = start_time + i;
    77         addrman->Add({addr}, source);
    78     }
    79-    addr_pos = addrman->FindAddressEntry(addr).value();
    80-    BOOST_CHECK_EQUAL(addr_pos.multiplicity, 8U);
    81+    auto addr_pos2 = addrman->FindAddressEntry(addr).value();
    82+    BOOST_CHECK_EQUAL(addr_pos2.multiplicity, 8U);
    83     // multiplicity doesn't affect size
    84     BOOST_CHECK_EQUAL(addrman->size(), 1U);
    85 }
    

    (When we move to c++20 we can remove the ctor definition and use designated initializers)

    The advantage to this is that all the fields must be filled explicitly by FindAddressEntry() so there’s no risk that we accidentally pass out a structure where one of the fields has been incorrectly set to the default value.


    mzumsande commented at 4:16 pm on December 23, 2021:
    Thanks, that makes sense! Done as suggested.
  11. in src/addrman.cpp:941 in 250479a287 outdated
    936+
    937+    int nId;
    938+    AddrInfo* addr_info_temp = Find(addr, &nId);
    939+
    940+    if (!addr_info_temp) { return std::nullopt; }
    941+    const AddrInfo& addr_info = *addr_info_temp;
    


    jnewbery commented at 4:57 pm on December 21, 2021:
    I don’t think there’s any value in this creating this reference. You’ve already got a non-null pointer, so just use the -> dereference operator to get what you need from it.

    mzumsande commented at 4:24 pm on December 23, 2021:
    removed the reference
  12. in src/test/addrman_tests.cpp:57 in 250479a287 outdated
    53@@ -107,7 +54,7 @@ BOOST_FIXTURE_TEST_SUITE(addrman_tests, BasicTestingSetup)
    54 
    55 BOOST_AUTO_TEST_CASE(addrman_simple)
    56 {
    57-    auto addrman = std::make_unique<AddrManTest>();
    58+    auto addrman = std::make_unique<AddrMan>(std::vector<bool>(), /*deterministic=*/true, /*consistency_check_ratio=*/100);
    


    jnewbery commented at 6:13 pm on December 21, 2021:

    This line appears 17 times in the test. It’s also very noisy and distracting from the purpose of the test. Perhaps add a utility function to create an addrman:

     0index a4d57e3435..28a754e079 100644
     1--- a/src/test/addrman_tests.cpp
     2+++ b/src/test/addrman_tests.cpp
     3@@ -49,12 +49,16 @@ static std::vector<bool> FromBytes(const unsigned char* source, int vector_size)
     4     return result;
     5 }
     6 
     7+static std::unique_ptr<AddrMan> TestAddrman(std::vector<bool> asmap = std::vector<bool>())
     8+{
     9+    return std::make_unique<AddrMan>(asmap, /*deterministic=*/true, /*consistency_check_ratio=*/100);
    10+}
    11 
    12 BOOST_FIXTURE_TEST_SUITE(addrman_tests, BasicTestingSetup)
    13 
    14 BOOST_AUTO_TEST_CASE(addrman_simple)
    15 {
    16-    auto addrman = std::make_unique<AddrMan>(std::vector<bool>(), /*deterministic=*/true, /*consistency_check_ratio=*/100);
    17+    auto addrman = TestAddrman();
    18 
    19     CNetAddr source = ResolveIP("252.2.2.2");
    20 
    21@@ -597,7 +601,7 @@ BOOST_AUTO_TEST_CASE(addrman_serialization)
    22 {
    23     std::vector<bool> asmap1 = FromBytes(asmap_raw, sizeof(asmap_raw) * 8);
    24 
    25-    auto addrman_asmap1 = std::make_unique<AddrMan>(asmap1, /*deterministic=*/true, /*consistency_check_ratio=*/100);
    26+    auto addrman_asmap1 = TestAddrman(asmap1);
    27     auto addrman_asmap1_dup = std::make_unique<AddrMan>(asmap1, /*deterministic=*/true, /*consistency_check_ratio=*/100);
    28     auto addrman_noasmap = std::make_unique<AddrMan>(std::vector<bool>(), /*deterministic=*/true, /*consistency_check_ratio=*/100);
    29     CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);
    

    (I only changed a couple of instances, but you get the idea)


    mzumsande commented at 4:27 pm on December 23, 2021:
    Done as suggested. These calls are also changed in #23373 but I think that these changes are compatible, i.e. TestAddrman() should call the GetCheckRatio() function introduced there.

    jnewbery commented at 12:18 pm on December 28, 2021:
    Looks good. Thanks!
  13. in src/test/addrman_tests.cpp:755 in 250479a287 outdated
    668     CAddress addr2 = CAddress(ResolveService("250.2.1.1"), NODE_NONE);
    669     addrman_noasmap->Add({addr, addr2}, default_source);
    670-    std::pair<int, int> bucketAndEntry_noasmap_addr1 = addrman_noasmap->GetBucketAndEntry(addr1);
    671-    std::pair<int, int> bucketAndEntry_noasmap_addr2 = addrman_noasmap->GetBucketAndEntry(addr2);
    672-    BOOST_CHECK(bucketAndEntry_noasmap_addr1.first != bucketAndEntry_noasmap_addr2.first);
    673-    BOOST_CHECK(bucketAndEntry_noasmap_addr1.second != bucketAndEntry_noasmap_addr2.second);
    


    jnewbery commented at 6:16 pm on December 21, 2021:
    I see you’ve removed the check about the position not matching. That looks like a good change to me since it doesn’t make much sense to compare the positions of items in different buckets :+1:
  14. in src/test/addrman_tests.cpp:814 in 250479a287 outdated
    838 
    839     // Ensure test of address fails, so that it is evicted.
    840-    addrman.SimConnFail(info);
    841+    int64_t nLastSuccess = 1;
    842+    // Set last good connection in the deep past.
    843+    addrman->Good(info, nLastSuccess);
    


    jnewbery commented at 6:19 pm on December 21, 2021:

    No need for this local variable:

    0    // Set last good connection in the deep past.
    1    addrman->Good(info, /*nTime=*/1);
    

    mzumsande commented at 4:16 pm on December 23, 2021:
    removed
  15. in src/test/addrman_tests.cpp:960 in 250479a287 outdated
    955+    // Tests updating nTime via Connected() and nServices via SetServices()
    956+    auto addrman = std::make_unique<AddrMan>(std::vector<bool>(), /*deterministic=*/true, /*consistency_check_ratio=*/100);
    957+    CNetAddr source{ResolveIP("252.2.2.2")};
    958+    CAddress addr{CAddress(ResolveService("250.1.1.1", 8333), NODE_NONE)};
    959+
    960+    int64_t startTime{GetAdjustedTime() - 10000};
    


    jnewbery commented at 6:25 pm on December 21, 2021:
    Be aware that using GetAdjustedTime() will be a silent conflict with https://github.com/bitcoin/bitcoin/pull/23807

    jnewbery commented at 6:25 pm on December 21, 2021:

    Prefer snake_case for naming local variables in new code:

    0    int64_t start_time{GetAdjustedTime() - 10000};
    

    mzumsande commented at 4:34 pm on December 23, 2021:
    thanks, I am following that PR and will update in case it gets merged.
  16. in src/test/addrman_tests.cpp:970 in 250479a287 outdated
    965+    // Updating an addrman entry with a different port doesn't change it
    966+    CAddress addr_diff_port{CAddress(ResolveService("250.1.1.1", 8334), NODE_NONE)};
    967+    addr_diff_port.nTime = startTime;
    968+    addrman->Connected(addr_diff_port);
    969+    addrman->SetServices(addr_diff_port, NODE_NETWORK_LIMITED);
    970+    std::vector<CAddress> vAddr1{addrman->GetAddr(/*max_addresses=*/ 0, /*max_pct=*/ 0, /*network=*/ std::nullopt)};
    


    jnewbery commented at 6:28 pm on December 21, 2021:

    For consistency:

    0    std::vector<CAddress> vAddr1{addrman->GetAddr(/*max_addresses=*/0, /*max_pct=*/0, /*network=*/std::nullopt)};
    

    Same below.

  17. in src/test/addrman_tests.cpp:225 in 250479a287 outdated
    253+
    254+BOOST_AUTO_TEST_CASE(addrman_new_multiplicity)
    255+{
    256+    auto addrman = std::make_unique<AddrMan>(std::vector<bool>(), /*deterministic=*/true, /*consistency_check_ratio=*/100);
    257+    CAddress addr{CAddress(ResolveService("253.3.3.3", 8333), NODE_NONE)};
    258+    int64_t start_time{GetAdjustedTime()};
    


    jnewbery commented at 6:31 pm on December 21, 2021:
    Again, be aware that this is a silent conflict with #23826.
  18. in src/test/addrman_tests.cpp:241 in 250479a287 outdated
    267+    AddressPosition addr_pos = addrman->FindAddressEntry(addr).value();
    268+    BOOST_CHECK_EQUAL(addr_pos.multiplicity, 1U);
    269+    BOOST_CHECK_EQUAL(addrman->size(), 1U);
    270+
    271+    // if nTime increases, an addr can occur in up to 8 buckets
    272+    for (unsigned int i = 1; i < 400; ++i) {
    


    jnewbery commented at 6:33 pm on December 21, 2021:
    Any reason for 400 in particular? I guess it needs to be larger than 8 in case the bucket/positions collide.

    mzumsande commented at 4:23 pm on December 23, 2021:
    It needs to be significantly larger than 8 because adding another entry is stochastic and decreases exponentially with existing RefCount (see code here). I chose the value such that a multiplicity of 8 is reached with the deterministic addrman and not too many additional tries are wasted.

    jnewbery commented at 12:20 pm on December 28, 2021:
    Makes sense. If you retouch this branch, then you could add that as a code comment (magic values without any explanation always make me wonder if I’m missing some rationale).

    mzumsande commented at 8:58 pm on December 28, 2021:
    done
  19. jnewbery commented at 6:36 pm on December 21, 2021: member
    Looks great. Just minor comments inline.
  20. in src/addrman.h:178 in 250479a287 outdated
    171+     * position.
    172+     * @param[in] addr       The address record to look up.
    173+     * @return               Information about the address record in AddrMan
    174+     *                       nullptr if address is not found
    175+     */
    176+    std::optional<AddressPosition> FindAddressEntry(const CAddress& addr);
    


    w0xlt commented at 1:03 pm on December 23, 2021:
    nit: if this is a test-only function, would not it be better to implement it in a derived class in the test file (such as the deleted class AddrManTest)?

    mzumsande commented at 4:56 pm on December 23, 2021:
    I wanted to avoid reaching into the AddrMan internals in the unit tests as it is done currently. Also, I think that this function can be of use in the fuzz tests as well, which also still directly access internals in some spots. One alternative possibility I thought about was adding FindAddressEntry() only to addrman_impl.h instead of addrman.h and keep on working with derived classes in the test accessing it that way. If people would prefer, I could switch to that. Note that a very limited set of test-only functions in the public interface also exist in comparable places such as txrequest.h
  21. w0xlt approved
  22. w0xlt commented at 1:04 pm on December 23, 2021: contributor
    tACK 250479a
  23. mzumsande force-pushed on Dec 23, 2021
  24. mzumsande commented at 4:57 pm on December 23, 2021: member
    Thanks for the reviews! @jnewbery I believe I have addressed all your points in my push.
  25. mzumsande force-pushed on Dec 23, 2021
  26. in src/test/addrman_tests.cpp:889 in 02f5a618dc outdated
    884@@ -897,7 +885,9 @@ BOOST_AUTO_TEST_CASE(addrman_evictionworks)
    885     BOOST_CHECK_EQUAL(info.ToString(), "250.1.1.19:0");
    886 
    887     // Ensure test of address fails, so that it is evicted.
    888-    addrman.SimConnFail(info);
    889+    // Set last good connection in the deep past.
    890+    addrman.Good(info, /*nTime=*/1);
    


    josibake commented at 3:40 pm on December 27, 2021:

    https://github.com/bitcoin/bitcoin/pull/23826/commits/02f5a618dc418da2d6e4af141774dc24a1c6a65d: nit (doesn’t change the test behavior): I’d recommend checking the output from addrman->Good() whenever it is called.

    1. it is consistent with how Good() is called in the rest of the tests
    2. it improves the readability (are you expecting a true or false from Good())
    0    BOOST_CHECK(!addrman.Good(info, /*nTime=*/1));
    

    for example, while first reviewing this change I expected an output of true from Good(), but after adding BOOST_CHECK realized Good() was actually returning false because info is already in the tried set


    mzumsande commented at 8:59 pm on December 28, 2021:
    done, and I also changed the comment a bit to reflect that.
  27. in src/test/addrman_tests.cpp:378 in f5ea63b01b outdated
    381-    addrman.Good(CAddress(addr1, NODE_NONE));
    382-    addrman.Good(CAddress(addr2, NODE_NONE));
    383-    BOOST_CHECK_EQUAL(addrman.GetAddr(/*max_addresses=*/0, /*max_pct=*/0, /*network=*/std::nullopt).size(), 5U);
    384-    BOOST_CHECK_EQUAL(addrman.GetAddr(/*max_addresses=*/2500, /*max_pct=*/23, /*network=*/std::nullopt).size(), 1U);
    385+    addrman->Good(CAddress(addr1, NODE_NONE));
    386+    addrman->Good(CAddress(addr2, NODE_NONE));
    


    josibake commented at 3:44 pm on December 27, 2021:

    https://github.com/bitcoin/bitcoin/pull/23826/commits/f5ea63b01bb43b375333ec49790d35b40894f467: same nit regarding Good()

    0    BOOST_CHECK(addrman->Good(CAddress(addr1, NODE_NONE)));
    1    BOOST_CHECK(addrman->Good(CAddress(addr2, NODE_NONE)));
    

    mzumsande commented at 8:59 pm on December 28, 2021:
    done
  28. josibake approved
  29. josibake commented at 3:50 pm on December 27, 2021: member

    tACK https://github.com/bitcoin/bitcoin/pull/23826/commits/5ecdaaf4d024d09fbcaa24add0de7baaa4c425de

    This is great stuff! Rebased on master and ran the unit tests for each commit, everything looks good. I had one suggestion regarding Good(). I recompiled with my changes and everything still passes - feel free to ping me for a re-ack if you decide to take the suggestion

  30. jnewbery commented at 12:22 pm on December 28, 2021: member

    utACK 5ecdaaf4d024d09fbcaa24add0de7baaa4c425de

    I’d be happy to rereview if you wanted to address the three remaining review comments:

  31. addrman: Introduce a test-only function to lookup addresses
    Co-Authored-By: Martin Zumsande <mzumsande@gmail.com>
    dad5f76021
  32. test: Update addrman_serialization unit test to use AddrMan's interface
    By updating the test to use FindEntry, it no longer needs to reach into
    AddrMan's internals (via GetBucketAndEntry) to assert expected
    behaviors.
    2ba1e74e59
  33. test: delete unused GetBucketAndEntry function 5b7aac34f2
  34. test: Inline SimConnFail function
    No need for a function, since it is only used once.
    
    Co-Authored-By: Amiti Uttarwar <amiti@uttarwar.org>
    1c65d427bb
  35. test: use AddrMan instead of AddrManTest where possible
    Switches to AddrMan for tests that use no features of AddrManTest.
    Also removes unusued AddrManTest variables
    
    Co-Authored-By: Amiti Uttarwar <amiti@uttarwar.org>
    0538520091
  36. test: Remove tests for internal helper functions
    The logic of these functions is already covered by existing unit tests
    using publicly exposed functions of the interface.
    Therefore, removing them does not decrease test coverage.
    b696d7870b
  37. test: Remove unused AddrManTest class f0e5efb824
  38. test: introduce utility function to retrieve an addrman f02eee8c87
  39. test: Add test for updating addrman entries
    This covers Connected() which updates nTime, and SetServices()
    which updates nServices
    e880bb7836
  40. mzumsande force-pushed on Dec 28, 2021
  41. mzumsande commented at 9:00 pm on December 28, 2021: member
    I pushed an update that addresses the outstanding comments.
  42. josibake commented at 12:38 pm on December 29, 2021: member

    reACK https://github.com/bitcoin/bitcoin/pull/23826/commits/26046a12473ad0e342ec200b82184bc1336cf6f3

    verified updates with git range-diff 5ecdaaf...26046a1

  43. in src/test/addrman_tests.cpp:239 in 26046a1247 outdated
    272+    AddressPosition addr_pos = addrman->FindAddressEntry(addr).value();
    273+    BOOST_CHECK_EQUAL(addr_pos.multiplicity, 1U);
    274+    BOOST_CHECK_EQUAL(addrman->size(), 1U);
    275+
    276+    // if nTime increases, an addr can occur in up to 8 buckets
    277+    // The acceptance probability decreases exponentially with existing multiplicit -
    


    jnewbery commented at 12:46 pm on December 29, 2021:
    0    // The acceptance probability decreases exponentially with existing multiplicity -
    

    mzumsande commented at 9:27 pm on January 3, 2022:
    Fixed.
  44. jnewbery commented at 12:46 pm on December 29, 2021: member

    utACK 26046a12473ad0e342ec200b82184bc1336cf6f3

    Verified range-diff. Only changes are the suggestions in #23826 (comment).

  45. test: Add test for multiplicity in addrman new tables 4f1bb467b5
  46. test: Cover eviction by timeout in addrman_evictionworks ea4c9fd4ab
  47. mzumsande force-pushed on Jan 3, 2022
  48. mzumsande commented at 9:36 pm on January 3, 2022: member
    Made another push, fixing a typo. Btw, this conflicts with #23373, which has been open a while longer but seems close - happy to rebase if that gets merged first.
  49. jnewbery commented at 10:30 am on January 4, 2022: member
    ACK ea4c9fd4ab9aaa2e8f2c2e38a75c9f05d0bfc866
  50. josibake commented at 10:44 am on January 4, 2022: member
  51. fanquake merged this on Jan 4, 2022
  52. fanquake closed this on Jan 4, 2022

  53. sidhujag referenced this in commit ae95672eea on Jan 4, 2022
  54. DrahtBot locked this on Jan 4, 2023
  55. mzumsande deleted the branch on Jan 16, 2023

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-19 00:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me