hsd
hsd copied to clipboard
Detect Gossiping Capabilities Automatically
Currently the handshake network is at risk due to the fact that full nodes do not gossip (listen) their availability automatically, but rather require the node operaters to specifically configure the node to provide resources to the network.
In my opinion, we need to remove the current band-aid and provide a real fix.
The node should check to see if it can gossip (listen) and be accessible on the default ports automatically, if it can not, then it should gracefully turn off the gossiping feature.
Currently the handshake network is at risk due to the fact that full nodes do not listen automatically,
In my opinion, the risk is that there are simply not enough full nodes, period. Remember in this context Bob Wallet doesn't count. We need nodes running on servers with maximum uptime, AND listening. I'm not sure how many full nodes there are out there that could accept inbound connections, but just aren't. My guess is that right now, that's not a big problem.
The real issue is gossiping your own reachable IP address to the network. It actually doesn't even matter if you ARE listening if no one out there knows they can connect to you. And this is the issue we ran in to last year: the network was being flooded with addr packets from unreachable nodes, bob wallet users were broadcasting their home IPs but of course those nodes were not reachable.
The current behavior of requiring --public-host was added by @chjj here in a bit of an emergency network update.
I'm not totally sure when it will be safe to remove this behavior -- probably actually will require a majority of full nodes to BE correctly reachable and listening so that if we set listen:true by default the network won't fall apart from all the unreachable bob wallet addrs.
The node should check to see if it can listen on the default ports automatically,
How do we do this?
Apologies I may have used the wrong verbiage here. I think the goal should be to automatically gossip a full node to the network that has a public IP that is reachable from the default port.
I believe @rithvikvibhu proposed a solution in the discord regarding a better way to do this.
He put together this docker image which allowed me to get my nodes gossiping their IPs to the network: https://hub.docker.com/r/rithvikvibhu/hsd-with-ip
To answer your question though, I think the easiest way to do this is to run a script to see if the node can be accessed via its public host/port combo, and automatically gossip if the node is reachable, if the node is not reachable keep the default config that HSD uses now.
Light clients running out of peers is kinda a problem because the community uses that as a crutch in their advertising.
We can't have light clients become unaccessible at this point in the game.
Either that or incentive running a full gossiping node. Because from the votes I got today, I highly doubt this thing will scale based on humans taking these extra steps to add resources to the network.
Is their anyway to detect how many gossiping nodes are active on the network?
Is their anyway to detect how many gossiping nodes are active on the network?
Befranz and Rithvik have done some work in this area. The most effective process would be a network crawler. A customized hsd node that connects to peers, requests addr messages then dicsonnects gracefully and tries to conenct to as many nodes as possible, but over time (not all at once).
Bitcoin dns seeder uses this: https://github.com/sipa/bitcoin-seeder
and HNS has dns seeders too for example oyu can try dig seed.easyhandshake.com to get a list (max 50) of rechable hosts