Tendermint

An implementation of the Tendermint state machine in Rust.

This is solely the state machine, intended to be mapped to any arbitrary system. It supports an arbitrary signature scheme, weighting, and block definition accordingly. It is not intended to work with the Cosmos SDK, solely to be an implementation of the academic protocol.

Caveats

Paper

The paper describes the algorithm with pseudocode on page 6. This pseudocode isn't directly implementable, nor does it specify faulty behavior. Instead, it's solely a series of conditions which trigger events in order to successfully achieve consensus.

The included pseudocode segments can be minimally described as follows:

01-09 Init 10-10 StartRound(0) 11-21 StartRound 22-27 Fresh proposal 28-33 Proposal building off a valid round with prevotes 34-35 2f+1 prevote -> schedule timeout prevote 36-43 First proposal with prevotes -> precommit Some 44-46 2f+1 nil prevote -> precommit nil 47-48 2f+1 precommit -> schedule timeout precommit 49-54 First proposal with precommits -> finalize 55-56 f+1 round > local round, jump 57-60 on timeout propose 61-64 on timeout prevote 65-67 on timeout precommit

The corresponding Rust code implementing these tasks are marked with their related line numbers.