Skip to content

Implement hidden RPC addconnection - #433

Merged
tcharding merged 1 commit into
rust-bitcoin:masterfrom
jamillambert:1217-hidden-addconnection
Jan 1, 2026
Merged

tcharding merged 1 commit into
rust-bitcoin:masterfrom
jamillambert:1217-hidden-addconnection

Conversation

@jamillambert

@jamillambert jamillambert commented Dec 17, 2025 •

Copy link
Copy Markdown
Collaborator

Implement the RPC in v22 hidden module, add the client macro, model and test.
Redefine the client macro in v29 where there is an added required argument.
Add all the reexports up to v30.

@jamillambert

jamillambert commented Dec 17, 2025 •

Copy link
Copy Markdown
Collaborator Author

CI failure is unrelated #434.

EDIT: CI now passes, but no changes were made to the code that caused the failure.

@jamillambert
jamillambert marked this pull request as draft December 17, 2025 21:51
@jamillambert
jamillambert force-pushed the 1217-hidden-addconnection branch from 783833e to b453c71 Compare December 17, 2025 21:52
@tcharding

Copy link
Copy Markdown
Member

Can be rebased now mate.

@jamillambert
jamillambert force-pushed the 1217-hidden-addconnection branch from b453c71 to 1aa95d1 Compare December 30, 2025 09:31
@jamillambert
jamillambert marked this pull request as ready for review December 30, 2025 09:32
@jamillambert

Copy link
Copy Markdown
Collaborator Author

Rebased, no changes.

@0xB10C 0xB10C left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

Having this in https://github.com/peer-observer/peer-observer/tree/master/extractors/p2p will make the integration tests a lot easier and less brittle, thanks!

Comment thread client/src/client_sync/v27/hidden.rs Outdated
//! Macros for implementing JSON-RPC methods on a client.
//!
//! Specifically this is `== Hidden ==` methods that are not listed in the
//! API docs of Bitcoin Core `v29`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure?

Suggested change
//! API docs of Bitcoin Core `v29`.
//! API docs of Bitcoin Core `v27`.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I've changed it.

@jamillambert
jamillambert force-pushed the 1217-hidden-addconnection branch from 1aa95d1 to a36ccc6 Compare December 30, 2025 10:12
Comment thread types/src/model/hidden.rs Outdated
Comment on lines +11 to +19
/// Models the result of JSON-RPC method `addconnection`.
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)]
pub struct AddConnection {
/// The address of the newly added connection.
pub address: String,
/// Type of connection.
pub connection_type: String,
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need this in model because there are no concrete types from rust-bitcoin, only Strings.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep I did extra work for no reason. I just saw address and thought needs a model, and obviously never removed it once I realised it was a network address.

Removed now.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ha, that has bitten me before too.

@tcharding

Copy link
Copy Markdown
Member

Everything else looks good. Reviewed: a36ccc6

Implement the RPC in v22 hidden module, add the client macro, model and
test.
Redefine the client macro in v27 where there is an added required
argument.
Add all the reexports up to v30.
@jamillambert
jamillambert force-pushed the 1217-hidden-addconnection branch from a36ccc6 to 224200d Compare December 31, 2025 12:53

@tcharding tcharding left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 224200d

@tcharding
tcharding merged commit f6f7979 into rust-bitcoin:master Jan 1, 2026
tcharding added a commit that referenced this pull request Jan 9, 2026
426e7b3 implement hidden RPC `getorphantxs` (0xb10c)

Pull request description:

  > getorphantxs ( verbosity )
  > Shows transactions in the tx orphanage.

  This implements the hidden `getorphantxs` RPC in the last commit. Depends on #432 and #433. Part of #333.

  Since the `expiry` and `entry` fields were dropped for v30 (this is an experimental RPC after all), there is a `into.rs` implementation for both v29 and v30.

ACKs for top commit:
  jamillambert:
    ACK 426e7b3
  tcharding:
    ACK 426e7b3

Tree-SHA512: 96213742a02382258bb94f4a8842baac79bd1bb3194a7c9ad501f1ece1328a156e3dd141e27bdd96eeac9dd43e90e23ce8aba57cd64902dcf4075a39dab4b35b
tcharding added a commit that referenced this pull request Jan 19, 2026
a7a8785 Add hidden RPC getrawaddrman (deadmanoz)

Pull request description:

  Add support for the hidden `getrawaddrman` RPC that returns raw address manager table entries (added v26). This RPC is marked as experimental and hidden from the API docs by default.

  The `mapped_as` and `source_mapped_as` fields are `Option<u32>` following the established pattern for version-specific fields (no `into.rs` required because these are additions rather than removals or changed types). These fields were added in Bitcoin Core v28 and will deserialise as `None` for earlier versions or when `-asmap` is not configured.

  Note: will have conflicts with #435 and #433, happy to rebase after either merges

ACKs for top commit:
  tcharding:
    ACK a7a8785
  jamillambert:
    ACK a7a8785

Tree-SHA512: 592c499e6f129fafdc764c4fad729f18315a6f9baca3c16a74471929337b49366771db297789e2db89a7fe3602e2a2644f4de6221280098e8c136138a209756c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants