rpc: add optional blockhash to waitfornewblock #30635

pull Sjors wants to merge 13 commits into bitcoin:master from Sjors:2024/08/waitforblock changing 23 files +223 −164
  1. Sjors commented at 11:42 am on August 12, 2024: member

    The waitfornewblock is inherently racy as the tip may have changed since the last RPC call, and can even change during initial processing of this call.

    Add an optional blockhash argument so the called can specify their current tip. Return immediately if our tip is different.

    I’ve made it fail if LookupBlockIndex fails. This should never happen if the user got the block hash from our RPC in the first place.

    Builds on #30409.

  2. DrahtBot commented at 11:42 am on August 12, 2024: 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. A summary of reviews will appear here.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #26593 (tracing: Only prepare tracepoint arguments when actually tracing by 0xB10C)

    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.

  3. DrahtBot added the label RPC/REST/ZMQ on Aug 12, 2024
  4. Sjors force-pushed on Aug 12, 2024
  5. Sjors force-pushed on Aug 12, 2024
  6. Sjors force-pushed on Aug 12, 2024
  7. Sjors force-pushed on Aug 13, 2024
  8. DrahtBot added the label Needs rebase on Sep 2, 2024
  9. Sjors force-pushed on Sep 3, 2024
  10. DrahtBot removed the label Needs rebase on Sep 3, 2024
  11. DrahtBot added the label Needs rebase on Sep 3, 2024
  12. Sjors force-pushed on Sep 4, 2024
  13. DrahtBot removed the label Needs rebase on Sep 4, 2024
  14. DrahtBot added the label CI failed on Sep 7, 2024
  15. DrahtBot removed the label CI failed on Sep 9, 2024
  16. DrahtBot added the label Needs rebase on Sep 9, 2024
  17. Sjors force-pushed on Sep 10, 2024
  18. DrahtBot removed the label Needs rebase on Sep 10, 2024
  19. DrahtBot added the label CI failed on Sep 10, 2024
  20. DrahtBot added the label Needs rebase on Sep 12, 2024
  21. refactor: rename BlockKey to BlockRef 89a8f74bbb
  22. Rename getTipHash() to getTip() and return BlockRef ebb8215f23
  23. node: Track last block that received a blockTip notification
    Also signal m_tip_block_cv when StopRPC is called, for
    consistency with g_best_block_cv. This is handled in
    StopRPC instead of OnRPCStopped() because the latter
    is deleted in a later commit.
    
    Co-authored-by: TheCharlatan <seb.kung@gmail.com>
    Co-authored-by: Ryan Ofsky <ryan@ofsky.org>
    7eccdaf160
  24. Add waitTipChanged to Mining interface
    Co-authored-by: TheCharlatan <seb.kung@gmail.com>
    b94b27cf05
  25. rpc: add test for waitforblock and waitfornewblock 285fe9fb51
  26. rpc: fix waitfornewblock description
    The waitforblock RPC method takes a hash argument and waits for that specific block.  The waitfornewblock waits for any new block. This commit fixes the documentation.
    77ec072925
  27. rpc: recommend -rpcclienttimeout=0 for waitfor* de7c855b3a
  28. rpc: check for negative timeout arg in waitfor* 2a40ee1121
  29. Replace RPCNotifyBlockChange with waitTipChanged()
    This refactoring commit uses the newly introduced waitTipChanged mining interface method to replace the RPCNotifyBlockChange mechanism.
    dca923150e
  30. Remove unused CRPCSignals
    They are no longer used for anything since RPCNotifyBlockChange was replaced with waitTipChanged() from the mining interface.
    460687a09c
  31. rpc: use waitTipChanged for longpoll
    This removes the last remaining use of g_best_block by the RPC.
    e3a560ca68
  32. Remove unused g_best_block 7942951e3f
  33. rpc: add optional blockhash to waitfornewblock d1f1e5044c
  34. Sjors force-pushed on Sep 17, 2024
  35. DrahtBot removed the label Needs rebase on Sep 17, 2024
  36. DrahtBot removed the label CI failed on Sep 17, 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-09-19 01:12 UTC

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