Skip to content

Implement hidden (test-only) RPC calls #333

Closed

Description

@0xB10C

Bitcoin Core has a number of hidden RPC calls that are excluded from the documentation by default. However, being able to interact with them using corepc would still be good for testing and power usage. Some of these are clearly for testing only (e.g. mocktime), while others can be useful for node operators too: invalidateblock, while some others expose partially implementation specific data, where the response format might change at some point (i.e. they aren't super stable, like getrawaddrman and getorphantxs).

Some hidden RPCs I think would be good to implement:

  • sendmsgtopeer: Send a p2p message to a peer specified by id. The message type and body must be provided, the message header will be generated. This RPC is for testing only.
  • echo/echojson: Simply echo back the input arguments. This command is for testing.
  • reconsiderblock: Removes invalidity status of a block, its ancestors and its descendants, reconsider them for activation. This can be used to undo the effects of invalidateblock.
  • invalidateblock: Permanently marks a block as invalid, as if it violated a consensus rule.
  • generatetoaddress: Mine to a specified address and return the block hashes.
  • generatetodescriptor Mine to a specified descriptor and return the block hashes.
  • getrawaddrman: Returns information on all address manager entries for the new and tried tables. I've been using this in addrman-observer for a while now. Add hidden RPC getrawaddrman #439
  • getorphantxs: Shows transactions in the tx orphanage. add hidden RPC getorphantxs #435
  • addconnection: Open an outbound connection to a specified node. This RPC is for testing only. Implement hidden RPC addconnection #433
  • estimaterawfee: Estimates the approximate fee per kilobyte needed for a transaction to begin confirmation within conf_target blocks if possible. Uses virtual transaction size as defined in BIP 141 (witness data is discounted) Implement hidden RPC estimaterawfee #432
  • addpeeraddress: Add the address of a potential peer to an address manager table. This RPC is for testing only. See also getnodeaddresses returns an empty list #320 Fix getnodeaddresses test #334
  • waitforblock/waitforblockheight/waitfornewblock Support Bitcoin Core v30.0 #384 and Add waitforblock, waitforblockheight and waitfornewblock #388

Activity

  1. tcharding commented on Aug 19, 2025

    @tcharding
    Member

    +1 from me. Thanks for the heads up!

  2. jamillambert commented on Aug 19, 2025

    @jamillambert
    Collaborator

    I agree these should be implemented, and thanks again for the info.

    I scraped core and got the below list of RPCs that are not listed in bitcoin-cli help. There are also the ones in the Generating section that are already implemented, but were dropped from the documentation from v23 upwards (Issue #211).

    Hidden RPCs Version added Current status (Dec 17)
    echo <17
    echojson <17
    estimaterawfee <17 Done
    invalidateblock <17 Returns nothing
    reconsiderblock <17 Done
    setmocktime <17 Returns nothing
    syncwithvalidationinterfacequeue <17 Done
    waitforblock <17 Done
    waitforblockheight <17 Done
    waitfornewblock <17 Done
    mockscheduler 20 Done
    addpeeraddress 21
    addconnection 22 Done
    echoipc 22
    getrawaddrman 26 PR submitted
    sendmsgtopeer 26 Returns nothing
    getorphantxs 29 Done

    Updated Jan 14, 2026
    Updated (tcharding) Jan 16, 2026

  3. jamillambert commented on Aug 19, 2025

    @jamillambert
    Collaborator

    In #334 I added addpeeraddress that was needed for the test. It's in a new module hidden. It's still documented and searchable in the rustdocs, but I didn't put Hidden as a section in the Method name and implementation status tables of the corepc_types rustdocs.

    If a different way of documenting/organizing them is preferred let me know and I'll change it.

  4. 0xB10C commented on Oct 10, 2025

    @0xB10C
    ContributorAuthor

    fwiw from the v30 release notes:

    • The waitforblock and waitforblockheight RPCs are no longer hidden. (#30635)
  5. deadmanoz commented on Dec 16, 2025

    @deadmanoz
    Contributor

    Is the pattern used by @jamillambert the preferred way to introduce hidden RPC calls? I am looking to add, for example, getrawaddrman.

    hidden module etc?

  6. 0xB10C commented on Dec 16, 2025

    @0xB10C
    ContributorAuthor

    Is the pattern used by @jamillambert the preferred way to introduce hidden RPC calls? I am looking to add, for example, getrawaddrman.

    hidden module etc?

    My understanding is that this would be the way to go, yes!

  7. jamillambert commented on Dec 16, 2025

    @jamillambert
    Collaborator

    Yeah I agree, I think that's the best way to go.

    NB. I had been working on adding the hidden RPCs but was low priority, I'll have another look tomorrow. Let me know if you have already, or want to start on getrawaddrman and if so I'll focus on the others.

  8. deadmanoz commented on Dec 16, 2025

    @deadmanoz
    Contributor

    I've made a start on getrawaddrman and would be happy to pickup others if you want me too!

  9. jamillambert commented on Dec 16, 2025

    @jamillambert
    Collaborator

    Great, thanks!

    I'll push up what I was working on tomorrow and update here what is left to do.

  10. jamillambert commented on Dec 17, 2025

    @jamillambert
    Collaborator

    I updated the table in my previous comment to give the current status. All the RPCs that say returns none don't need to be added to types. I'll add a client macro and test for these to catch if they do return something in future versions.

  11. 0xB10C commented on Dec 18, 2025

    @0xB10C
    ContributorAuthor

    I updated the table in my previous comment to give the current status. All the RPCs that say returns none don't need to be added to types. I'll add a client macro and test for these to catch if they do return something in future versions.

    Nice, this should include setmocktime which I've been using this hack to call: https://github.com/peer-observer/peer-observer/blob/311426b21f406345606b6673fd4c0158061b1100/extractors/p2p/tests/integration.rs#L261-L268

    I'll pick up getorphantxs!

  12. 0xB10C commented on Dec 18, 2025

    @0xB10C
    ContributorAuthor

    Once these hidden ones are all implemented, I think it should in theory be possible to write a small proxy or client and hack the Bitcoin Core functional tests to use it for running the full test suite through corepc..

  13. tcharding commented on Dec 29, 2025

    @tcharding
    Member

    for running the full test suite through corepc..

    Siiiick, I would love that.

  14. deadmanoz commented on Dec 30, 2025

    @deadmanoz
    Contributor

    @0xB10C can update your list for getrawaddrman: #439

  15. added a commit that references this issue on Jan 9, 2026
  16. satsfy commented on Jan 13, 2026

    @satsfy
    Contributor

    Hi! I'm preparing mockscheduler, reconsiderblock and syncwithvalidationinterfacequeue.
    I'll send them all in a single PR for ease of review.

  17. added a commit that references this issue on Jan 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions