Skip to content

feat: add variants to ConnectionKind enum in floresta-wire#636

Closed
qlrd wants to merge 3 commits into
getfloresta:masterfrom
qlrd:feat/improve-connection-kind-enums
Closed

feat: add variants to ConnectionKind enum in floresta-wire#636
qlrd wants to merge 3 commits into
getfloresta:masterfrom
qlrd:feat/improve-connection-kind-enums

Conversation

@qlrd

@qlrd qlrd commented Sep 16, 2025

Copy link
Copy Markdown
Contributor

What is the purpose of this pull request?

  • Bug fix
  • Documentation update
  • New feature
  • Test
  • Other:

Which crates are being modified?

  • floresta-chain
  • floresta-cli
  • floresta-common
  • floresta-compact-filters
  • floresta-electrum
  • floresta-watch-only
  • floresta-wire
  • floresta
  • florestad
  • Other:

Description and Notes

This PR is a partial fix of #622, in the sense to define enum variants compliant to the "connection_type" field returned by the bitcoin-core's getpeerinfo rpc.

How to verify the changes you have done?

It add to the ConnectionKind::Regular, ConnectionKind::Extra and ConnectionKind::Manual variants 2 new subvariants OutboundKind::OutboundFullRelay and OutboundKind::BlockRelayOnly, as well add a AddrFetch (the Inbound type is excluded since this one do not make sense in Floresta).

@Davidson-Souza Davidson-Souza added enhancement New feature or request RPC Changes something with our JSON-RPC interface labels Sep 16, 2025
@Davidson-Souza

Copy link
Copy Markdown
Member

I think you should remove the Fixes 623 part, as this is a partial fix. This PR shouldn't close the issue

@qlrd qlrd force-pushed the feat/improve-connection-kind-enums branch 2 times, most recently from daffd22 to db806d8 Compare September 17, 2025 00:52
Comment thread crates/floresta-wire/src/p2p_wire/node.rs Outdated
Comment thread tests/floresta-cli/getpeerinfo.py Outdated
@qlrd qlrd force-pushed the feat/improve-connection-kind-enums branch 2 times, most recently from 091f3b6 to 60cc332 Compare September 19, 2025 00:00
@qlrd qlrd requested a review from Davidson-Souza September 19, 2025 00:38
Comment thread crates/floresta-wire/src/p2p_wire/sync_node.rs Outdated
Comment thread crates/floresta-wire/src/p2p_wire/node.rs Outdated
Comment thread crates/floresta-wire/src/p2p_wire/node.rs Outdated
Comment thread crates/floresta-wire/src/p2p_wire/node.rs Outdated
Comment thread crates/floresta-wire/src/p2p_wire/node.rs Outdated
Comment thread crates/floresta-wire/src/p2p_wire/node.rs Outdated
Comment thread crates/floresta-wire/src/p2p_wire/node.rs Outdated
Comment thread crates/floresta-wire/src/p2p_wire/node_context.rs Outdated
Comment thread crates/floresta-wire/src/p2p_wire/node_context.rs
Comment thread crates/floresta-wire/src/p2p_wire/peer.rs Outdated
@qlrd qlrd force-pushed the feat/improve-connection-kind-enums branch 2 times, most recently from 1971cd9 to eeae205 Compare September 24, 2025 15:50
@qlrd qlrd requested a review from Davidson-Souza September 24, 2025 18:19
@qlrd qlrd force-pushed the feat/improve-connection-kind-enums branch from eeae205 to b352d21 Compare September 26, 2025 14:08
Comment thread crates/floresta-wire/src/p2p_wire/error.rs Outdated
Comment thread crates/floresta-wire/src/p2p_wire/node.rs Outdated
Comment thread crates/floresta-wire/src/p2p_wire/node.rs Outdated
Comment thread crates/floresta-wire/src/p2p_wire/node.rs Outdated
Comment thread crates/floresta-wire/src/p2p_wire/node.rs Outdated
Comment thread crates/floresta-wire/src/p2p_wire/node.rs Outdated
Comment thread crates/floresta-wire/src/p2p_wire/node.rs Outdated
Comment thread crates/floresta-wire/src/p2p_wire/node.rs Outdated
Comment thread crates/floresta-wire/src/p2p_wire/running_node.rs Outdated
Comment thread crates/floresta-wire/src/p2p_wire/error.rs Outdated
@qlrd qlrd force-pushed the feat/improve-connection-kind-enums branch 3 times, most recently from 341dd71 to 611b980 Compare October 1, 2025 12:50
@qlrd qlrd requested a review from Davidson-Souza October 1, 2025 19:03
@qlrd qlrd force-pushed the feat/improve-connection-kind-enums branch from 611b980 to 7373a2d Compare October 10, 2025 00:34
Comment thread crates/floresta-wire/src/p2p_wire/node.rs Outdated
Comment thread crates/floresta-wire/src/p2p_wire/node.rs Outdated
Comment thread crates/floresta-wire/src/p2p_wire/node.rs Outdated
@qlrd qlrd force-pushed the feat/improve-connection-kind-enums branch from 7373a2d to 8099e15 Compare November 27, 2025 19:33
Comment thread tests/test_framework/electrum/client.py
@JoseSK999

Copy link
Copy Markdown
Member

Needs rebase

Comment thread crates/floresta-wire/src/p2p_wire/node.rs Outdated
@luisschwab

Copy link
Copy Markdown
Member

@qlrd are you still working on this?

@qlrd

qlrd commented Feb 11, 2026

Copy link
Copy Markdown
Contributor Author

@qlrd are you still working on this?

back :)

@qlrd qlrd force-pushed the feat/improve-connection-kind-enums branch from 8099e15 to d860fc3 Compare February 14, 2026 00:51
@qlrd qlrd marked this pull request as draft February 14, 2026 00:51
@luisschwab

Copy link
Copy Markdown
Member

@qlrd is this PR still a draft?

@qlrd qlrd force-pushed the feat/improve-connection-kind-enums branch 3 times, most recently from 2012b88 to 771e727 Compare February 15, 2026 18:26
@qlrd qlrd changed the title feat!: add variants to ConnectionKind enum in floresta-wire feat: add variants to ConnectionKind enum in floresta-wire Feb 19, 2026
@qlrd qlrd force-pushed the feat/improve-connection-kind-enums branch from 771e727 to f127330 Compare February 19, 2026 15:42
qlrd and others added 3 commits February 19, 2026 16:31
This commit add to the `ConnectionKind::Regular`,
`ConnectionKind::Extra` and `ConnectionKind::Manual` variants 2 new
subvariants `OutboundKind::OutboundFullRelay` and
`OutboundKind::BlockRelayOnly`, as well add a `AddrFetch` to comply with
Bitcoin-Core on the "connection_type" field of `getpeerinfo` rpc (we
exclude here a `Inbound` type, this one do not make sense in Floresta).
…ion type.

This commit checks if the `kind` connection from floresta's
`getpeerinfo` rpc is compliant with the `connection_type` from
bitcoind's `getpeerinfo` rpc. Also fix some spell checks in old
unrelated files. Also was necessary to update
`tests/floresta-cli/node-info.py` to correct connection type (regular ->
manual).
@qlrd qlrd force-pushed the feat/improve-connection-kind-enums branch from f127330 to 8e679d2 Compare February 19, 2026 19:33
@qlrd

qlrd commented Feb 19, 2026

Copy link
Copy Markdown
Contributor Author

@qlrd is this PR still a draft?

Finishing it, was working on a annoying issue fixed #849

@qlrd

qlrd commented Feb 19, 2026

Copy link
Copy Markdown
Contributor Author

@qlrd is this PR still a draft?

Done

@qlrd qlrd marked this pull request as ready for review February 19, 2026 20:40
@JoseSK999

Copy link
Copy Markdown
Member

This PR should close #623 no?

@qlrd

qlrd commented Feb 21, 2026

Copy link
Copy Markdown
Contributor Author

This PR should close #623 no?

Yes

@qlrd

qlrd commented Feb 21, 2026

Copy link
Copy Markdown
Contributor Author

This PR should close #623 no?

Yes

Oh, forgot to mention it on commit message. Thanks @JoseSK999.

Davidson-Souza added a commit that referenced this pull request Mar 6, 2026
6de9fa1 feat(wire): make sure we don't ban Manual connections (Davidson Souza)
31c21a5 feat(wire): add a `Manual` variant to PeersKind (Davidson Souza)

Pull request description:

  ### Description and Notes

  All peers that are added by the user — those added with the RPC
  `addnode` or the CLI option `--connect`, should have kind `Manual`,
  rather than `Regular`. This exempts them from:
    - Max peers quota — if we already have 10 peers and the user tries
      to addnode another one, we will now have 11 peers
    - They whitelisted and shouldn't be banned by misbehaving
    - They don't need to have any required service

  This commit adds this new variant, and makes sure we are following
  the above rules.

  This is a small subset of #636, and will be useful for getting #865 unstuck (potentially can help with some edge cases as mentioned in #852 (comment))

ACKs for top commit:
  jaoleal:
    ACK 6de9fa1
  JoseSK999:
    re-ACK 6de9fa1

Tree-SHA512: 5d620318551ba4078fcc66d1f6af380e9875293f10e9c09e649f0f06f532c62df30b4415c3dd304eebd88039369eae96ec1f2e57ed7fb174fe7d042a5e6bf6f7
@luisschwab

Copy link
Copy Markdown
Member

Closing this since it's stale. Someone else can continue the work on another PR.

@luisschwab luisschwab closed this Apr 3, 2026
@Davidson-Souza Davidson-Souza added the Up for grabs A pull request that received concept ACK, but the author isn't responsive label Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request RPC Changes something with our JSON-RPC interface Up for grabs A pull request that received concept ACK, but the author isn't responsive

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants