tendermint/consensus
Zarko Milosevic d4e93a6de3
Separate ValidBlock rule from unlocking rule
2018-03-01 11:42:22 +01:00
..
test_data
types Add support for ValidBlock mechanism for the simplest case 2018-03-01 11:42:22 +01:00
README.md
byzantine_test.go minor fixes - tests pass 2018-02-03 03:54:49 -05:00
common_test.go rename dummy to kvstore (#1223) 2018-02-27 18:01:10 +04:00
mempool_test.go update for sdk2 libs. need to fix kv test 2018-02-03 03:35:02 -05:00
reactor.go fixes from Jae's review 2018-02-12 14:32:09 +04:00
reactor_test.go rename dummy to kvstore (#1223) 2018-02-27 18:01:10 +04:00
replay.go RequestInitChain needs genesisBytes 2018-02-21 03:43:47 +00:00
replay_file.go it compiles 2018-02-03 03:52:17 -05:00
replay_test.go rename dummy to kvstore (#1223) 2018-02-27 18:01:10 +04:00
state.go Separate ValidBlock rule from unlocking rule 2018-03-01 11:42:22 +01:00
state_test.go consensus: rename test funcs 2018-01-19 00:59:09 -05:00
ticker.go fixes from Jae's review 2018-02-12 14:32:09 +04:00
version.go
wal.go
wal_fuzz.go
wal_generator.go rename dummy to kvstore (#1223) 2018-02-27 18:01:10 +04:00
wal_test.go consensus: rename test funcs 2018-01-19 00:59:09 -05: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.