IntersectMBO / IntersectMBO/ouroboros-network
Enhance Peer Sharing Configuration for `InitiatorOnly` Connections
- Dominant language
- Haskell
- Stars
- 296
- Forks
- 104
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 4
Description
Connections that have negotiated the `InitiatorOnly` mode, typically used by wallets and certain dApps, are currently not designed to be shared. As it stands, these `InitiatorOnly` connections run only the client side of the `PeerSharing` miniprotocol. This design choice makes sense, given that they won't be receiving any requests because these connections aren't shared with the Outbound Governor.
However, a challenge arises when considering wallets operating from home networks. These networks often have less reliable internet access compared to nodes running from dedicated data centers. Furthermore, due to NAT (Network Address Translation) restrictions, inbound connections to these home-based nodes are typically not possible. This implies that their IP must be externally accessible, bypassing the NAT. As a result, an upstream peer of a home node can utilize the home node as its own upstream peer, thanks to the duplex connection. Yet, sharing the home node's IP with another party might not be beneficial, as the mere sharing of an address doesn't guarantee connectivity.
For these reasons and for the reason that one can not trust the remote node that it won't share the peer's address when `PeerSharingPrivate` is used, and there isn't a way to punish who misbehaves. `PeerSharingPrivate` ought to be removed.
Proposed Solution:
1. Introduce a configurable `PeerSharing` flag specifically for wallets. When enabled, this would allow wallets to negotiate both initiator and responder bearers, enabling them to receive replies to their Peer Sharing requests;
2. Disable starting the peer sharing miniprotocol for connections that are set to `InitiatorOnly` (right now only the client side is started);
3. Remove `PeerSharingPrivate` option.
Summary:
By enhancing the peer sharing configuration, we can ensure better connectivity and functionality for wallets and other `InitiatorOnly` connections, while also addressing the unique challenges posed by home-based nodes.
Contributor guide
Assessment
This issue has not been assessed yet.