wallet: trigger MaybeResendWalletTxs() every minute #25922

pull stickies-v wants to merge 2 commits into bitcoin:master from stickies-v:update-resend-freq changing 2 files +7 −7
  1. stickies-v commented at 6:26 PM on August 24, 2022: contributor

    ResendWalletTransactions() only executes every 12-36h (24h average). Triggering it every second is excessive, once per minute should be plenty.

    The goal of this PR is to reduce the amount of (unnecessary) schedule executions by ~60x without meaningfully altering transaction rebroadcast logic/assumptions which would require more significant review.

  2. in src/wallet/load.cpp:154 in 39494978c8 outdated
     150 | @@ -151,7 +151,7 @@ void StartWallets(WalletContext& context, CScheduler& scheduler)
     151 |      if (context.args->GetBoolArg("-flushwallet", DEFAULT_FLUSHWALLET)) {
     152 |          scheduler.scheduleEvery([&context] { MaybeCompactWalletDB(context); }, std::chrono::milliseconds{500});
     153 |      }
     154 | -    scheduler.scheduleEvery([&context] { MaybeResendWalletTxs(context); }, std::chrono::milliseconds{1000});
     155 | +    scheduler.scheduleEvery([&context] { MaybeResendWalletTxs(context); }, std::chrono::milliseconds{1000 * 60});
    


    MarcoFalke commented at 6:29 PM on August 24, 2022:
        scheduler.scheduleEvery([&context] { MaybeResendWalletTxs(context); }, 1min});
    

    https://en.cppreference.com/w/cpp/chrono/operator%22%22min


    stickies-v commented at 6:32 PM on August 24, 2022:

    oh nice, thanks! pushed

  3. stickies-v force-pushed on Aug 24, 2022
  4. DrahtBot added the label Wallet on Aug 24, 2022
  5. achow101 commented at 10:06 PM on August 24, 2022: member

    wallet_resendwallettransactions.py is failing. You need to change the mockscheduler calls to work with the new timer.

  6. stickies-v force-pushed on Aug 25, 2022
  7. stickies-v force-pushed on Aug 25, 2022
  8. aureleoules commented at 1:16 PM on August 25, 2022: member

    ACK 7f4e1a7760d3f4c60a41bb6a1fca3a457e8ad297 Seems like a reasonable change.

  9. furszy approved
  10. furszy commented at 1:21 PM on August 25, 2022: member

    utACK 7f4e1a77 Shouldn't be a problem to rise it even more while the next resend is kept at 12-36 hours from the last one.

  11. wallet: trigger MaybeResendWalletTxs() every minute
    ResendWalletTransactions() only executes every 12-36h (24h average).
    Triggering it every second is excessive, once per minute should be
    plenty.
    fbba4a1316
  12. test: fix typo for MaybeResendWalletTxs 5ef8c2c9fc
  13. stickies-v force-pushed on Aug 25, 2022
  14. stickies-v commented at 1:35 PM on August 25, 2022: contributor

    Force pushed to incorporate #25929 and (hopefully) fix the failing Windows builds - otherwise no changes in this latest force push.

    wallet_resendwallettransactions.py is failing. You need to change the mockscheduler calls to work with the new timer.

    Thanks, fixed from 78f864d -> 7f4e1a7

    Shouldn't be a problem to rise it even more while the next resend is kept at 12-36 hours from the last one.

    Probably, but I think every minute is a frequency everyone can agree with without bikeshedding so I'd rather not make the change too big.

  15. ghost commented at 2:07 PM on August 25, 2022: none

    ResendWalletTransactions() only executes every 12-36h (24h average). Triggering it every second is excessive, once per minute should be plenty.

    This was done to improve privacy in https://github.com/bitcoin/bitcoin/pull/18038

  16. stickies-v commented at 3:24 PM on August 25, 2022: contributor

    This was done to improve privacy in #18038

    Is this a comment regarding an issue you have with this PR privacy-wise, or just to share background information? I don't see how this PR conflicts with the privacy improvements of #18038 since it doesn't do anything to rebroadcast transactions faster. As such I assume you intended the latter, but if not would you care to elaborate, please?

  17. ghost commented at 3:34 PM on August 25, 2022: none

    I replied to the PR description and not sure about the goal of this PR by changing MaybeResendWalletTxs in StartWallets() to 1 minute if rebroadcast will happen once per day.

  18. stickies-v commented at 3:46 PM on August 25, 2022: contributor

    The goal of this PR is to reduce the amount of (unnecessary) schedule executions by ~60x without meaningfully altering transaction rebroadcast logic/assumptions which would require more significant review. There should be no privacy implications in this PR. If you, like furszy suggested earlier too, would be open to an even slower execution schedule, I'm not against that. Beyond a per-minute frequency I just don't think it matters enough to spend a lot of time discussing that.

    Edit: added some of this to PR description.

  19. ghost commented at 4:13 PM on August 25, 2022: none

    The goal of this PR is to reduce the amount of (unnecessary) schedule executions by ~60x without meaningfully altering transaction rebroadcast logic/assumptions which would require more significant review. There should be no privacy implications in this PR. If you, like furszy suggested earlier too, would be open to an even slower execution schedule, I'm not against that. Beyond a per-minute frequency I just don't think it matters enough to spend a lot of time discussing that.

    Thanks. I understand the pull request now. Yes 1 minute is better than 1 second and could be changed to anything between 1 hour to 6 hours as well.

  20. ghost commented at 4:14 PM on August 25, 2022: none

    Concept ACK

  21. achow101 commented at 9:08 PM on August 25, 2022: member

    ACK 5ef8c2c9fc4ebce6cbfea6a55a89a0ab7ee98a1a

  22. unknown approved
  23. unknown commented at 10:55 PM on August 25, 2022: none

    ACK https://github.com/bitcoin/bitcoin/pull/25922/commits/5ef8c2c9fc4ebce6cbfea6a55a89a0ab7ee98a1a

    nit: Since we have setmocktime and mockscheduler RPC, it would have been better if the test tried triggering this after 1 minute on several occasions and see how things work. Example: 1 minute, 15 minutes, 60 minutes, 4 hours etc.

  24. DrahtBot commented at 5:30 AM on August 26, 2022: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #25768 (wallet: Properly rebroadcast unconfirmed transaction chains by achow101)

    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.

  25. achow101 merged this on Aug 26, 2022
  26. achow101 closed this on Aug 26, 2022

  27. sidhujag referenced this in commit dd3359f7cf on Aug 26, 2022
  28. stickies-v deleted the branch on Sep 22, 2022
  29. bitcoin locked this on Sep 22, 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: 2026-04-19 03:13 UTC

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