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.

18 lines
797 B

9 years ago
10 years ago
9 years ago
  1. # The core consensus algorithm.
  2. * state.go - The state machine as detailed in the whitepaper
  3. * reactor.go - A reactor that connects the state machine to the gossip network
  4. # Go-routine summary
  5. The reactor runs 2 go-routines for each added peer: gossipDataRoutine and gossipVotesRoutine.
  6. The consensus state runs two persistent go-routines: timeoutRoutine and receiveRoutine.
  7. Go-routines are also started to trigger timeouts and to avoid blocking when the internalMsgQueue is really backed up.
  8. # Replay/WAL
  9. A write-ahead log is used to record all messages processed by the receiveRoutine,
  10. which amounts to all inputs to the consensus state machine:
  11. messages from peers, messages from ourselves, and timeouts.
  12. They can be played back deterministically at startup or using the replay console.