tendermint/consensus
Zarko Milosevic 2c125b6c78 Fix validValue rule 2018-05-14 16:17:21 -04:00
..
test_data rebase fix 2017-12-28 20:49:02 +00:00
types fixes from review 2018-05-14 10:33:31 -04:00
README.md some comments 2016-08-09 20:31:53 -04:00
byzantine_test.go WIP consensus 2018-04-05 07:05:45 -07:00
common_test.go Replaced NodeInfo's pubkey to ID (#1443) 2018-04-11 10:11:11 +02:00
mempool_test.go Merge branch 'develop' into jae/aminoify 2018-04-07 16:16:53 +03:00
reactor.go Add back sample output in rpc/core/consensus.go; Tweak DumpConsensusState output for peers 2018-05-12 15:39:30 -07:00
reactor_test.go fix tests 2018-04-07 19:47:19 +03:00
replay.go Fix lint errors (#1390) 2018-04-02 10:21:17 +02:00
replay_file.go use MarshalJSONIndent for init files. closes #1506 2018-04-26 21:32:18 -04:00
replay_test.go remove wal_light setting 2018-04-11 10:08:03 +02:00
state.go Fix validValue rule 2018-05-14 16:17:21 -04:00
state_test.go Merge 2018-04-05 08:17:10 -07:00
ticker.go fixes from Jae's review 2018-02-12 14:32:09 +04:00
version.go all: no more anonymous imports 2017-10-04 16:40:45 -04:00
wal.go remove wal_light setting 2018-04-11 10:08:03 +02:00
wal_fuzz.go add gofuzz test for consensus wal 2017-12-15 11:56:24 -06:00
wal_generator.go standardize PRNG access (#1411) 2018-04-11 11:38:30 +02:00
wal_test.go remove wal_light setting 2018-04-11 10:08:03 +02:00
wire.go WIP consensus 2018-04-05 07:05:45 -07:00

README.md

The core consensus algorithm.

  • state.go - The state machine as detailed in the whitepaper
  • reactor.go - A reactor that connects the state machine to the gossip network

Go-routine summary

The reactor runs 2 go-routines for each added peer: gossipDataRoutine and gossipVotesRoutine.

The consensus state runs two persistent go-routines: timeoutRoutine and receiveRoutine. Go-routines are also started to trigger timeouts and to avoid blocking when the internalMsgQueue is really backed up.

Replay/WAL

A write-ahead log is used to record all messages processed by the receiveRoutine, which amounts to all inputs to the consensus state machine: messages from peers, messages from ourselves, and timeouts. They can be played back deterministically at startup or using the replay console.