You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
jaekwon 2004321e6d Update README.md 10 years ago
..
upnp Hide internal methods to make GoDoc more user-friendly 10 years ago
README.md Update README.md 10 years ago
addrbook.go cleanup 10 years ago
addrbook_test.go cleanup 10 years ago
client.go Not done integrating PEX. 10 years ago
client_test.go cleanup 10 years ago
connection.go cleanup 10 years ago
listener.go cleanup 10 years ago
log.go benchmark works, but could use some improvement. 10 years ago
msg.go beginning to write pex 10 years ago
netaddress.go go fmt 10 years ago
peer.go Not done integrating PEX. 10 years ago
pex.go Not done integrating PEX. 10 years ago
server.go local -> external 10 years ago
util.go go fmt 10 years ago

README.md

Channels

Each peer connection is multiplexed into channels.


PEX channel

The PEX channel is used to exchange peer addresses.

Channel "PEX"
Messages
  • pexRequestMsg
  • pexResponseMsg

Block channel

The block channel is used to propagate block or header information to new peers or peers catching up with the blockchain.

Channel "block"
Messages
  • RequestMsg
  • BlockMsg
  • HeaderMsg
Notes Nodes should only advertise having a header or block at height 'h' if it also has all the headers or blocks less than 'h'. Thus for each peer we need only keep track of two integers -- one for the most recent header height 'h_h' and one for the most recent block height 'h_b', where 'h_b' <= 'h_h'.

Mempool channel

The mempool channel is used for broadcasting new transactions that haven't yet entered the blockchain. It uses a lossy bloom filter on either end, but with sufficient fanout and filter nonce updates every new block, all transactions will eventually reach every node.

Channel "mempool"
Messages
  • MempoolTxMsg
Notes Instead of keeping a perfect inventory of what peers have, we use a lossy filter.
Bloom filter (n:10k, p:0.02 -> k:6, m:10KB)
Each peer's filter has a random nonce that scrambles the message hashes.
The filter & nonce refreshes every new block.

Consensus channel

The consensus channel broadcasts all information used in the rounds of the Tendermint consensus mechanism.

Channel "consensus"
Messages
  • ProposalMsg
  • VoteMsg
  • NewBlockMsg
Notes How do optimize/balance propagation speed & bandwidth utilization?

Resources