0

I'm reading over the Tendermint source code and I'm trying to make sense of the peer-to-peer architecture. Broadcasting across a Switch seems to call Receive() on every single Peer, even ones that don't have voting power. I imagine there are messages that non-Validator Peers don't care about.

Do Peers just receive and then drop these messages they don't care about? They at least gossip it along to other Peers that might be secluded in a network, right?

If I'm misunderstanding, I'd appreciate being pointed to specific examples in the code. Thanks!

David
  • 170
  • 2
  • 9
  • 1
    Have you seen the spec https://github.com/tendermint/tendermint/blob/master/docs/spec/p2p/connection.md? Each conn has a set of channels, which are of interest to peer. When 2 peers connect, they exchange this info. – melekes Jun 21 '18 at 09:21
  • @melekes, thanks for the reply! I've read over it, but I'm interested in more detail. You say that "when 2 peers connect, they exchange this info". Would you show me examples in the code where this happens? I can see the hasChannel check in peer.go. But where is "interest" in a channel specified? Is there also logic to indicate a Peer knows that it is or isn't a Validator and specifies interest accordingly? As far as I can tell, there's no strong connection between a Peer and Validator object. – David Jun 22 '18 at 05:17
  • 1
    https://github.com/tendermint/tendermint/blob/develop/p2p/node_info.go#L32 https://github.com/tendermint/tendermint/blob/develop/p2p/switch.go#L581 – melekes Aug 26 '18 at 04:19

0 Answers0