You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
rpc-extractor: add more RPCs (uptime, getmemoryinfo, ...) #199
changed the title [-]rpc-extractor: add more RPC (uptime, getmemoryinfo, ...)[/-][+]rpc-extractor: add more RPCs (uptime, getmemoryinfo, ...)[/+]on Sep 19, 2025
I think that the correct approach is to upstream the change to rust-bitcoin/corepc (I'll work on this as a side task), so I'll first consider some of the other RPCs
Correct, yeah some of these aren't yet implemented in corepc yet, but I think it it's very worthwhile to implement them upstream rust-bitcoin/corepc#333 and then use a master branch commit until they do a release.
I think getrawaddrman is actually a good one to start with, since it gives us a lot more insights into addrman changes and addrman usage we don't currently have.
Note that I'm currently testing #305 and will probably merge this early next week. There are going to be conflicts since I'm changing the protobufs a bunch.
After reviewing the current RPC coverage and Bitcoin Core's available RPCs, I'd like to propose adding these:
Thanks for proposing these. However, I'm not immediately sure how they relate to P2P monitoring and what new information they present..
getchaintips
We use this extensively in fork-observer already. I could make sense to have metrics for stale blocks in peer-observer too, but I'm not exactly sure if they'd give us much new information.
listbanned
As you mentioned, this only give us the manually banned IPs and subnets. Not something that's automatically banned based on heuristics. We know which IPs and subnets have been banned for each node. Addtionally, I think ban_reason is something that an LLM hallucinated. There is no such thing for the Bitcoin Core RPC listbanned.
getmininginfo
I don't think networkhashps is a relevant P2P monitoring information. And nBits and target are numeric fields that aren't really translatable into useful metrics too, I think.
The getblocktemplate RPC could be interesting for information about the fees, weight, tx count, sigops, ... of templates. But I don't think it's a priority to add this.
bitcoin/bitcoin#34683 seems to be related to this work and has gained some movement recently. It would imply a rewrite of the extractor: instead of manually adding rpc cases, use some form of automatic generation. Not suggesting this to be done, just reporting something that might eventually get merged on core that can have a positive impact.
Agree. The hope would be that something like corepc switches to it, and we can use it from there. For the short-term, I think no action is needed in peer-observer.
Hi @0xB10C, I'm working on that PR in Bitcoin Core with Will and may soon also begin the corepc side of this.
I'd love to ask you a few questions about what you want from corepc so I can better direct my efforts and help peer-observer too.
The current client in corepc is intended for integration testing only. Would you like a full codegen production client?
Which versions of Bitcoin Core are you interested in? I've been able to generate down to v24, would you need anything earlier?
Are you also interested in the types provided by corepc? Or just a client? Another way to put it is: would you like to rely more on the into_model() conversion to rust bitcoin types, or are the client raw types sufficient for you?
Which RPC methods do you use (assuming the ones listed in this issue are the ones that interest your the most). Are there any pain points you're currently working around? (Missing fields, wrong types, version gaps, etc.)
Happy to hear any other thoughts or suggestions you might have.
Which versions of Bitcoin Core are you interested in? I've been able to generate down to v24, would you need anything earlier?
For peer-observer specifically, only recent-ish versions of Bitcoin Core are interesting. The oldest I'm currently running is v29.2 or so. However, with peer-observer, we frequently run newer release candidates or master, so having a way of running the code gen myself for an not-yet-released version of Bitcoin Core is interesting.
Are you also interested in the types provided by corepc? Or just a client? Another way to put it is: would you like to rely more on the into_model() conversion to rust bitcoin types, or are the client raw types sufficient for you?
We recently merged #351 to use the version agnostic types, where possible.
Which RPC methods do you use (assuming the ones listed in this issue are the ones that interest your the most). Are there any pain points you're currently working around? (Missing fields, wrong types, version gaps, etc.)
We are currently using a patched version of corepc since they haven't made a release in a while and don't yet support some of the changes that are merged in Bitcoin Core master, but not yet released in a Bitcoin Core release. See
Activity
deadmanoz commentedon Aug 28, 2025
Hey @0xB10C I'll pick this one up next?
0xB10C commentedon Aug 28, 2025
sure! It's probably easiest to start with a RPC that's already implemented in http://github.com/rust-bitcoin/corepc. Maybe
uptimeandgetmemoryinfoare good starting points.Also note that I've started working on #231. Depending on what's ready first one of us might need to rebase.
[-]rpc-extractor: add more RPC (uptime, getmemoryinfo, ...)[/-][+]rpc-extractor: add more RPCs (uptime, getmemoryinfo, ...)[/+]0xB10C commentedon Sep 23, 2025
doing
getmempoolinfoin #2690xB10C commentedon Dec 10, 2025
uptimeandgetnettotalsdone in #302 by @GuiSchet !GuiSchet commentedon Dec 11, 2025
ey, next week i'll continue with these RPCs. Any info/tips ´re welcome.
0xB10C commentedon Dec 11, 2025
I've ordered the OP by importance. I think
getmemoryinfoandgetaddrmaninfowould be awesome to have next.deadmanoz commentedon Dec 13, 2025
If @GuiSchet is working from the top I will grab some of the lower ones
deadmanoz commentedon Dec 13, 2025
Just some notes as I look into some of these.
getorphantxsis a hidden (test-only) RPC call added in v29 (rust-bitcoin/corepc#333). No support for it in either https://github.com/rust-bitcoin/corepc or @0xB10C's fork (https://github.com/0xB10C/corepc).I think that the correct approach is to upstream the change to
rust-bitcoin/corepc(I'll work on this as a side task), so I'll first consider some of the other RPCsdeadmanoz commentedon Dec 13, 2025
I think the only other hidden (test-only) RPC call is
getrawaddrmanAs per @0xB10C's comment on rust-bitcoin/corepc#333, this is already being used in https://github.com/0xB10C/addrman-observer.
But this is using the old
bitcoincore-rpc(https://github.com/0xB10C/addrman-observer/blob/master/proxy/Cargo.toml).I assume we'd also prefer to have
getrawaddrmanavailable inrust-bitcoin/corepcdirectly for use here in peer-observer?Edit: yeah, we don't want to introduce
bitcoincore-rpcjust for this0xB10C commentedon Dec 13, 2025
Correct, yeah some of these aren't yet implemented in corepc yet, but I think it it's very worthwhile to implement them upstream rust-bitcoin/corepc#333 and then use a
masterbranch commit until they do a release.I think getrawaddrman is actually a good one to start with, since it gives us a lot more insights into addrman changes and addrman usage we don't currently have.
Note that I'm currently testing #305 and will probably merge this early next week. There are going to be conflicts since I'm changing the protobufs a bunch.
deadmanoz commentedon Dec 13, 2025
Yeah no worries!!
2 remaining items
GuiSchet commentedon Dec 18, 2025
@0xB10C @deadmanoz, thinking of doing getnetworkinfo or getblockchaininfo, any preference or suggestions?
deadmanoz commentedon Dec 18, 2025
Your choice mate, I can pickup some other issues!!
0xB10C commentedon Dec 22, 2025
started implementing
getorphantxsupstream rust-bitcoin/corepc#435deadmanoz commentedon Dec 30, 2025
Also started implementing
getrawaddrmanupstream: rust-bitcoin/corepc#439.getchaintxstatshas been merged upstream, when/how do we make use of it (will allow me to update #312 and move from draft)?0xB10C commentedon Dec 30, 2025
good question. One idea could be to collect a few merged corepc PRs and then rebase my custom branch:
peer-observer/shared/Cargo.toml
Lines 24 to 26 in d6b3dd1
Also happy to rebase my custom corepc branch now and then you can use that in #312.
deadmanoz commentedon Dec 30, 2025
@0xB10C if you can rebase then I can use in #312
0xB10C commentedon Dec 30, 2025
Done!
With #323, we should be able to use
getorphantxsnow too.GuiSchet commentedon Jan 22, 2026
After reviewing the current RPC coverage and Bitcoin Core's available RPCs, I'd like to propose adding these:
1.
getchaintipsReturns information about all known tips in the block tree, including the main chain and orphaned branches.
heighthashbranchlenstatusactive,valid-fork,valid-headers,headers-only,invalid2.
listbannedReturns list of all manually banned IPs/subnets with ban details.
addressban_createdbanned_untilban_reasonmanuallyornode-misbehaving3.
getmininginfoReturns mining-related information consolidated in one call.
networkhashpsnBits(v29+)target(v29+)pooledtxgetmempoolinfo.sizedifficultygetblockchaininfochaingetblockchaininfowarningsgetblockchaininfo/getnetworkinfo0xB10C commentedon Jan 26, 2026
Thanks for proposing these. However, I'm not immediately sure how they relate to P2P monitoring and what new information they present..
We use this extensively in fork-observer already. I could make sense to have metrics for stale blocks in peer-observer too, but I'm not exactly sure if they'd give us much new information.
As you mentioned, this only give us the
manuallybanned IPs and subnets. Not something that's automatically banned based on heuristics. We know which IPs and subnets have been banned for each node. Addtionally, I thinkban_reasonis something that an LLM hallucinated. There is no such thing for the Bitcoin Core RPClistbanned.I don't think
networkhashpsis a relevant P2P monitoring information. AndnBitsandtargetare numeric fields that aren't really translatable into useful metrics too, I think.The
getblocktemplateRPC could be interesting for information about thefees,weight,tx count,sigops, ... of templates. But I don't think it's a priority to add this.edilmedeiros commentedon Mar 10, 2026
bitcoin/bitcoin#34683 seems to be related to this work and has gained some movement recently. It would imply a rewrite of the extractor: instead of manually adding rpc cases, use some form of automatic generation. Not suggesting this to be done, just reporting something that might eventually get merged on core that can have a positive impact.
0xB10C commentedon Mar 10, 2026
Agree. The hope would be that something like corepc switches to it, and we can use it from there. For the short-term, I think no action is needed in peer-observer.
satsfy commentedon Mar 10, 2026
Hi @0xB10C, I'm working on that PR in Bitcoin Core with Will and may soon also begin the corepc side of this.
I'd love to ask you a few questions about what you want from corepc so I can better direct my efforts and help peer-observer too.
into_model()conversion to rust bitcoin types, or are the client raw types sufficient for you?Happy to hear any other thoughts or suggestions you might have.
0xB10C commentedon Mar 12, 2026
Yeah, your observation is correct, we are (ab)using the integration testing-only client in peer-observer for now. There is e.g. https://github.com/alpenlabs/bitcoind-async-client we could switch too, if we find out we need something more "production" ready. Ideally, the codegen part would only touch the types, and not the clients?
For peer-observer specifically, only recent-ish versions of Bitcoin Core are interesting. The oldest I'm currently running is v29.2 or so. However, with peer-observer, we frequently run newer release candidates or
master, so having a way of running the code gen myself for an not-yet-released version of Bitcoin Core is interesting.We recently merged #351 to use the version agnostic types, where possible.
We are currently using a patched version of corepc since they haven't made a release in a while and don't yet support some of the changes that are merged in Bitcoin Core
master, but not yet released in a Bitcoin Core release. Seepeer-observer/shared/Cargo.toml
Lines 25 to 32 in cbcc4c3
0xB10C commentedon Mar 25, 2026
We've implemented all listed RPCs here. I think we can close this for now and reopen if we find more than we want to have.