private broadcast: define and use new RPC_LIMIT_EXCEEDED error code ( + other follow-ups) #35678

pull stickies-v wants to merge 4 commits into bitcoin:master from stickies-v:2026-07/privbroadcast-rpc-followups changing 5 files +25 −13
  1. stickies-v commented at 3:32 PM on July 7, 2026: contributor

    The server isn't running out of memory when the private broadcast transaction queue is full. Add and use a new -37 (RPC_LIMIT_EXCEEDED) code that can be used whenever a resource is bound and currently at capacity.

    Addresses #35406 (review)

    Also includes commits to address other outstanding suggestions/nits from #35406:

  2. rpc: define and use new RPC_LIMIT_EXCEEDED error code
    The server isn't running out of memory when the private broadcast
    transaction queue is full. Add a new RPC_LIMIT_EXCEEDED code that
    can be used whenever a resource is bound and currently at capacity.
    82a02a2a22
  3. test: use BOOST_CHECK_EQUAL for PrivateBroadcast::AddResult
    Makes the failure output more useful.
    7ad311be18
  4. test: align test better with described scenario
    Add the tx that was just removed, instead of an earlier one, for
    improved clarity.
    191bdcba26
  5. private broadcast: remove no-op [[nodiscard]]
    The header file already properly uses the attribution.
    8ac222484c
  6. DrahtBot commented at 3:32 PM on July 7, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

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

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK instagibbs, andrewtoth, sedited

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #35587 (Remove boost as a unit test runner by rustaceanrob)

    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.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  7. fanquake added the label Private Broadcast on Jul 7, 2026
  8. fanquake requested review from vasild on Jul 7, 2026
  9. fanquake requested review from andrewtoth on Jul 7, 2026
  10. fanquake requested review from instagibbs on Jul 7, 2026
  11. instagibbs commented at 5:06 PM on July 7, 2026: member

    ACK 8ac222484c92f320f56273035bc66dbc14c0b9a1

  12. andrewtoth approved
  13. andrewtoth commented at 7:25 PM on July 7, 2026: contributor

    ACK 8ac222484c92f320f56273035bc66dbc14c0b9a1

  14. sedited approved
  15. sedited commented at 7:33 PM on July 7, 2026: contributor

    ACK 8ac222484c92f320f56273035bc66dbc14c0b9a1

  16. in src/rpc/util.cpp:399 in 82a02a2a22
     395 | @@ -396,7 +396,7 @@ RPCErrorCode RPCErrorFromTransactionError(TransactionError terr)
     396 |          case TransactionError::ALREADY_IN_UTXO_SET:
     397 |              return RPC_VERIFY_ALREADY_IN_UTXO_SET;
     398 |          case TransactionError::PRIVATE_BROADCAST_FULL:
     399 | -            return RPC_OUT_OF_MEMORY;
     400 | +            return RPC_LIMIT_EXCEEDED;
    


    furszy commented at 7:33 PM on July 7, 2026:

    it would be nice to use a more descriptive/specific constant name here. RPC_LIMIT_EXCEEDED reads like an http queue capacity error, and not something related to the private broadcast queue.

    extra note: we use HTTP_SERVICE_UNAVAILABLE for the http queue return error code.


    sedited commented at 7:34 PM on July 7, 2026:

    I think that is the idea,no? The description indicates that this can be re-used for other purposes.


    furszy commented at 7:44 PM on July 7, 2026:

    I think that is the idea,no? The description indicates that this can be re-used for other purposes.

    Ups, I jumped straight to the code. Forget what I said.

    I thought this was suggesting to use the introduced RPCErrorCode at the http queue level, but that is not the case. I'm just not fan of the http <--> json-rpc coupling we have.

  17. sedited merged this on Jul 8, 2026
  18. sedited closed this on Jul 8, 2026

  19. stickies-v deleted the branch on Jul 8, 2026

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-07-09 06:47 UTC