Follow-ups for txgraph #31363 #32151

pull sipa wants to merge 3 commits into bitcoin:master from sipa:202403_txgraph_followups changing 5 files +54 −38
  1. sipa commented at 3:02 am on March 27, 2025: member

    This addresses a few review comments in #31363 after merge:

  2. DrahtBot commented at 3:02 am on March 27, 2025: contributor

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

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32151.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK instagibbs, glozow

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  3. sipa force-pushed on Mar 27, 2025
  4. in src/cluster_linearize.h:1382 in d999cf85f7 outdated
    1366@@ -1367,7 +1367,7 @@ void FixLinearization(const DepGraph<SetType>& depgraph, std::span<DepGraphIndex
    1367         // in between forward.
    1368         while (place_before.Any()) {
    1369             // j cannot be 0 here; if it was, then there was necessarily nothing earlier which
    1370-            // elem needs to be place before anymore, and place_before would be empty.
    1371+            // elem needs to be placed before anymore, and place_before would be empty.
    


    maflcko commented at 6:41 am on March 27, 2025:

    If you want to fix typos in the touched files, there may be a bit more:

    0[03:14:31.857] src/txgraph.cpp:342: Entrys ==> Entries, Entry
    1[03:14:31.857] src/txgraph.cpp:415: Entrys ==> Entries, Entry
    2[03:14:31.857] src/txgraph.cpp:512: Entrys ==> Entries, Entry
    3[03:14:31.857] src/txgraph.cpp:1944: occured ==> occurred
    4[03:14:31.857] src/txgraph.h:102: commiting ==> committing
    

    sipa commented at 11:40 am on March 27, 2025:
    Thanks, done!
  5. laanwj added the label Mempool on Mar 27, 2025
  6. sipa force-pushed on Mar 27, 2025
  7. sipa force-pushed on Mar 27, 2025
  8. sipa force-pushed on Mar 27, 2025
  9. txgraph: rename group_data in ApplyDependencies 777179bc27
  10. clusterlin: fix typos c7d5dcaa61
  11. in src/cluster_linearize.h:253 in dc4afb3ddf outdated
    249@@ -250,10 +250,7 @@ class DepGraph
    250         return ret;
    251     }
    252 
    253-    /** Find some connected component within the subset "todo" of this graph.
    254-     *
    255-     * Specifically, this finds the connected component which contains the first transaction of
    256-     * todo (if any).
    257+    /** Get the connected component within the subset "todo" that contains tx.
    


    instagibbs commented at 5:30 pm on March 27, 2025:
    should make it clear that tx must be in todo

    sipa commented at 7:50 pm on March 27, 2025:
    Done.
  12. in src/test/fuzz/cluster_linearize.cpp:463 in dc4afb3ddf outdated
    460+        {
    461+            uint64_t picked_num{0};
    462+            try {
    463+                reader >> VARINT(picked_num);
    464+            } catch (const std::ios_base::failure&) {}
    465+            if (picked_num < todo.Size() && todo[picked_num]) {
    


    instagibbs commented at 5:38 pm on March 27, 2025:
    I modified it to not gate on existence in todo, and nothing seems to be breaking. Shouldn’t this cause an Assume failure when holes existed in the serialization and the chosen number selects that unused hole?

    sipa commented at 7:48 pm on March 27, 2025:

    This instantly crashes the fuzz tests for me:

    0-            if (picked_num < todo.Size() && todo[picked_num]) {
    1+            if (picked_num < todo.Size()/* && todo[picked_num]*/) {
    2                 picked = picked_num;
    3             }
    

    instagibbs commented at 8:00 pm on March 27, 2025:
    99.9% chance I was running the wrong binary, it instantly crashes for me this time, feel free to resolve
  13. in src/test/fuzz/txgraph.cpp:564 in dc4afb3ddf outdated
    560@@ -561,36 +561,23 @@ FUZZ_TARGET(txgraph)
    561                 std::shuffle(refs.begin(), refs.end(), rng);
    562                 // Invoke the real function.
    563                 auto result = real->CountDistinctClusters(refs, use_main);
    564-                // Build a vector with representatives of the clusters the Refs occur in in the
    565+                // Build a setr with representatives of the clusters the Refs occur in in the
    


    instagibbs commented at 5:42 pm on March 27, 2025:
    setr

    sipa commented at 7:50 pm on March 27, 2025:
    Fixed.
  14. clusterlin: add GetConnectedComponent
    This abstracts out the finding of the connected component that includes
    a given element from FindConnectedComponent (which just finds any connected
    component).
    
    Use this in the txgraph fuzz test, which was effectively reimplementing this
    logic. At the same time, improve its performance by replacing a vector with a
    set.
    a52b53926b
  15. sipa force-pushed on Mar 27, 2025
  16. glozow commented at 8:10 pm on March 27, 2025: member

    ACK a52b53926b5c6a5b92255435e3c204cdf18665a2

    The third comment was from me misremembering what FindConnectedComponent does, my bad. But I think it’s quite useful to have a GetConnectedComponent.

  17. fanquake merged this on Mar 28, 2025
  18. fanquake closed this on Mar 28, 2025


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: 2025-03-31 18:12 UTC

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