In ethereum network, does every node has to be connected to each and every other node in the network?

Or for syncing, they just connect to any random node?


They are not all directly connected to each other.

Each node is connected to a few other nodes (unsure how many exactly - I guess it's up to the client implementation). Whenever a new message is sent from node A it will start to propagate to the entire network in a gossip way: each node propagates it to its known nodes.

It would not be feasible for each node to be connected to each other - it would require a lot of resources to keep the connection lists up-to-date and whenever a new node joins the network it would get flooded with connections from all other nodes.

Furthermore, because messages have to propagate through many nodes to reach all nodes, there is delay. This delay is one of the main causes for different consensus among different parts of the network - some nodes don't know about a consensus reached at the other end of the network and they form their own consensus. After a while this chaos settles down and the entire network agrees on a common consensus.

For syncing, I think clients use a list of predetermined seed nodes - they first connect to those and get other addresses for other nodes. It's up to the client implementation to decide which nodes it actually stays connected to and how it decides that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.