multiprocess compatibility updates #28721

pull ryanofsky wants to merge 8 commits into bitcoin:master from ryanofsky:pr/ipcfix changing 19 files +147 −29
  1. ryanofsky commented at 6:16 pm on October 24, 2023: contributor

    This is a collection of small changes to interfaces and code which were needed as part of multiprocess PR #10102, but have been moved here to make that PR smaller.

    All of these changes are refactoring changes which do not affect behavior of current code


    This PR is part of the process separation project.

  2. streams: Add SpanReader ignore method
    Needed to deserialize some types from spans like CScripts
    82a379eca8
  3. interfaces: Fix const virtual method that breaks multiprocess support 924327eaf3
  4. interfaces: Add schedulerMockForward method so mockscheduler RPC can work across processes
    Needed to fix new wallet_groups.py and wallet_resendwallettransactions.py tests
    with multiprocess bitcoin-node executable.
    4978754c00
  5. interfaces: Change getUnspentOutput return type to avoid multiprocess segfault
    Coin serialize method segfaults if IsSpent condition is true. This caused
    multiprocess code to segfault when serializing the Coin& output argument to of
    the Node::getUnspentOutput method if the coin was not found. Segfault could be
    triggered by double clicking and viewing transaction details in the GUI
    transaction list.
    
    Fix this by replacing Coin& output argument with optional<Coin> return value to
    avoid trying to serializing spent coins.
    156f49d682
  6. interfaces: Rename CalculateBumpFees methods to be compatible with capn'proto 441d00c60f
  7. util: Add ArgsManager SetConfigFilePath method
    Needed by multiprocess support code to pass parsed configuration to a spawned process.
    8062c3bdb9
  8. span: Make Span template deduction guides work in SFINAE context
    Also add test to make sure this doesn't get broken in the future.
    
    This was breaking vector<bool> serialization in multiprocess code because
    template current deduction guides would make it appear like vector<bool> could
    be converted to a span, but then the actual conversion to span would fail.
    6d43aad742
  9. doc: fix broken doc/design/multiprocess.md links after #24352 3b70f7b615
  10. DrahtBot commented at 6:16 pm on October 24, 2023: contributor

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

    Code Coverage

    For detailed information about the code coverage, see the test coverage report.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK achow101, naumenkogs, maflcko

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

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #10102 (Multiprocess bitcoin by ryanofsky)

    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.

  11. DrahtBot added the label CI failed on Oct 24, 2023
  12. in src/wallet/load.cpp:152 in 62a0ceaafd outdated
    149     }
    150 
    151     // Schedule periodic wallet flushes and tx rebroadcasts
    152     if (context.args->GetBoolArg("-flushwallet", DEFAULT_FLUSHWALLET)) {
    153-        scheduler.scheduleEvery([&context] { MaybeCompactWalletDB(context); }, std::chrono::milliseconds{500});
    154+        context.scheduler->scheduleEvery([&context] { MaybeCompactWalletDB(context); }, std::chrono::milliseconds{500});
    


    maflcko commented at 7:16 am on October 25, 2023:
    nit in 62a0ceaafdbdb3d1f75e83f712b5af42c2cdf6f9: Use 500ms while touching this?

    ryanofsky commented at 1:17 pm on October 25, 2023:

    re: #28721 (review)

    nit in 62a0cea: Use 500ms while touching this?

    Thanks, updated

  13. in src/wallet/interfaces.cpp:597 in 62a0ceaafd outdated
    593+        return StartWallets(m_context);
    594+    }
    595     void flush() override { return FlushWallets(m_context); }
    596     void stop() override { return StopWallets(m_context); }
    597     void setMockTime(int64_t time) override { return SetMockTime(time); }
    598+    void schedulerMockForward(std::chrono::seconds delta) override { m_context.scheduler->MockForward(delta); }
    


    maflcko commented at 7:17 am on October 25, 2023:
    nit in 62a0ceaafdbdb3d1f75e83f712b5af42c2cdf6f9: Missing Assert() to turn UB into a crash?

    ryanofsky commented at 1:17 pm on October 25, 2023:

    re: #28721 (review)

    nit in 62a0cea: Missing Assert() to turn UB into a crash?

    Thanks, updated

  14. in src/qt/transactiondesc.cpp:364 in 22edd79ddd outdated
    359@@ -360,12 +360,11 @@ QString TransactionDesc::toHTML(interfaces::Node& node, interfaces::Wallet& wall
    360         {
    361             COutPoint prevout = txin.prevout;
    362 
    363-            Coin prev;
    364-            if(node.getUnspentOutput(prevout, prev))
    365+            if (auto prev{node.getUnspentOutput(prevout)})
    366             {
    


    maflcko commented at 7:20 am on October 25, 2023:
    nit in 22edd79ddddc3525ee5dbadaf0174019b3c99ae3: Move to the above line while touching? (clang-format)

    ryanofsky commented at 1:17 pm on October 25, 2023:

    re: #28721 (review)

    nit in 22edd79: Move to the above line while touching? (clang-format)

    Thanks, updated

  15. in src/qt/transactiondesc.cpp:367 in 22edd79ddd outdated
    365+            if (auto prev{node.getUnspentOutput(prevout)})
    366             {
    367                 {
    368                     strHTML += "<li>";
    369-                    const CTxOut &vout = prev.out;
    370+                    const CTxOut &vout = prev->out;
    


    maflcko commented at 7:21 am on October 25, 2023:
    nit in 22edd79ddddc3525ee5dbadaf0174019b3c99ae3: Clang-format while touching this line?

    ryanofsky commented at 1:17 pm on October 25, 2023:

    re: #28721 (review)

    nit in 22edd79: Clang-format while touching this line?

    Thanks, updated

  16. in src/span.h:240 in 1fba885f9d outdated
    235+// object instantiation would fail, resulting in a hard error, rather than a
    236+// SFINAE error.
    237+// https://stackoverflow.com/questions/68759148/sfinae-to-detect-the-explicitness-of-a-ctad-deduction-guide
    238+// https://stackoverflow.com/questions/16568986/what-happens-when-you-call-data-on-a-stdvectorbool
    239+template<typename T>
    240+using DataResult = std::remove_pointer_t<decltype(std::declval<T&>().data())>;
    


    maflcko commented at 7:24 am on October 25, 2023:
    1fba885f9dec67e57e911910427cd2406fae1048: I wonder if it is easier to just delete the content of this file and replace it with using Span = std::span?

    ryanofsky commented at 1:12 pm on October 25, 2023:

    re: #28721 (review)

    1fba885: I wonder if it is easier to just delete the content of this file and replace it with using Span = std::span?

    Switching from Span to std::span might work, but it’s a bigger change and I’d expect it to require other fixes and not just be a drop-in replacement.

    If replacing span gets implemented and merged first, that’s great and this commit can be dropped. But otherwise the actual code change here is small. I wouldn’t want multiprocess code to depend on replacing span when there is a direct fix here which is 3 lines and is just adding two !std::is_void_v checks.

  17. maflcko commented at 7:25 am on October 25, 2023: member

    I didn’t review the Span commit yet.

    ACK 28bddf90ccbb3a58d30210b6102220fa6253229f 🍍

    Signature:

    0untrusted comment: signature from minisign secret key on empty file; verify via: minisign -Vm "${path_to_any_empty_file}" -P RWTRmVTMeKV5noAMqVlsMugDDCyyTSbA3Re5AkUrhvLVln0tSaFWglOw -x "${path_to_this_whole_four_line_signature_blob}"
    1RUTRmVTMeKV5npGrKx1nqXCw5zeVHdtdYURB/KlyA/LMFgpNCs+SkW9a8N95d+U4AP1RJMi+krxU1A3Yux4bpwZNLvVBKy0wLgM=
    2trusted comment: ACK 28bddf90ccbb3a58d30210b6102220fa6253229f 🍍
    35sCvwzO8Gj/WV/7QAif56fxTc3QT8+G/qXnBh/ZHH/rKxUb25SXW7I3/m26dnr0KfVVDVQGfar78kL1Yc4E5Dg==
    
  18. DrahtBot removed the label CI failed on Oct 25, 2023
  19. ryanofsky force-pushed on Oct 25, 2023
  20. ryanofsky commented at 9:02 pm on October 25, 2023: contributor

    Appreciate the review

    Updated 28bddf90ccbb3a58d30210b6102220fa6253229f -> 3b70f7b6156cb110c47a6e482791cf337bb6ad6d (pr/ipcfix.2 -> pr/ipcfix.3, compare) with review suggestions.

  21. achow101 requested review from maflcko on Nov 7, 2023
  22. achow101 commented at 9:27 pm on November 7, 2023: member
    ACK 3b70f7b6156cb110c47a6e482791cf337bb6ad6d
  23. naumenkogs commented at 8:07 am on November 9, 2023: member
    ACK 3b70f7b6156cb110c47a6e482791cf337bb6ad6d
  24. maflcko commented at 6:51 pm on November 9, 2023: member

    re-ACK 3b70f7b6156cb110c47a6e482791cf337bb6ad6d 🎆

    Signature:

    0untrusted comment: signature from minisign secret key on empty file; verify via: minisign -Vm "${path_to_any_empty_file}" -P RWTRmVTMeKV5noAMqVlsMugDDCyyTSbA3Re5AkUrhvLVln0tSaFWglOw -x "${path_to_this_whole_four_line_signature_blob}"
    1RUTRmVTMeKV5npGrKx1nqXCw5zeVHdtdYURB/KlyA/LMFgpNCs+SkW9a8N95d+U4AP1RJMi+krxU1A3Yux4bpwZNLvVBKy0wLgM=
    2trusted comment: re-ACK 3b70f7b6156cb110c47a6e482791cf337bb6ad6d  🎆
    34vrBaTA+bS9c7lucywAakQWMvizh66HrffzpcXOPgLDVDBI4wkCQUPE94XqhE6S6GuepGDGFjHp5tecIYIoABA==
    
  25. DrahtBot removed review request from maflcko on Nov 9, 2023
  26. fanquake merged this on Nov 13, 2023
  27. fanquake closed this on Nov 13, 2023

  28. ryanofsky commented at 2:15 pm on November 16, 2023: contributor
    Thanks for the reviews! I’ll rebase #10102 now that this is merged, and create a new PR with the next set of changes from #10102
  29. bitcoin locked this on Nov 15, 2024

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-22 00:12 UTC

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