Skip to content
/ kayak Public

Byzantine fault-tolerant consensus library, written on Go

License

Notifications You must be signed in to change notification settings

azuenko/kayak

Repository files navigation

Kayak is a Byzantine fault-tolerant ordering (consensus) library, written on Go. The design and implementation of Kayak were inspired by SMaRt-BFT and Raft. To try, see quickstart.

GoDoc


About

Kayak is a core library for a decentralized system -- it provides ordering and synchronization facilities in the presence of Byzantine faults. The design of the library gets its inspiration from SMaRt-BFT and coreos/raft.

Similar to Raft, Kayak is a lightweight library. It does not include auxiliary services, such as networking or persistent storage. To run the library, the developer has to supply an implementation of network (authenticated perfect links), storage and timer.

Status

The library is in early development stage. As a consequence, no guarantees can be given for security, stability and backward-compatibility. Use only in testing / staging environment.

Key features

  • Byzantine fault-tolerant ordering service across live processes
  • Synchronization primitives for new or delayed processes
  • In-protocol decentralised membership management
  • Efficient uniqueness (replay attack protection)
  • Peer-to-peer and client-server deployment models

Design considerations

The prime objective for the library is to be simple and minimal. Simplicity means readability, easiness to spot and fix bugs and refactor. Albeit the public methods are thread-safe, their execution is deliberately synchronized via the global lock. It brings some determinism, which buys reproducibility. The entire library should be seen as a single state machine.

In its current development state stability and security should be considered of larger importance than performance and scalability.

The tests consider only public interfaces (blackbox approach). Zmey is largely used for this purpose. The approach makes the tests quite lengthy, but it greatly simplifies frequent internal refactoring.

Kayak aims to "log everything". The chosen policy hurts performance and causes greater code duplication, but is essential to spot bugs in a live system.

Next steps

The major priority is to test the library in the wild, being used as a consensus engine for an existing project, such as cockroachDB. See Issues for more details.

Documentation

References

  • (SMaRt-BFT) Alysson Neves Bessani, João Sousa, and Eduardo E. P. Alchieri. "State machine replication for the masses with BFT-SMART." 44th Annual IEEE/IFIP International Conference on Dependable Systems and Networks, DSN 2014, pages 355–362, 2014, pdf
  • (Raft) Diego Ongaro and John Ousterhout. "In Search of an Understandable Consensus Algorithm." USENIX ATC'14 Proceedings of the 2014 USENIX conference on USENIX Annual Technical Conference, pages 305-320, 2014, pdf
  • (BFT consensus) Christian Cachin. "Yet Another Visit to Paxos." IBM Research Zurich, Tech. Rep. RZ 3754, 2009, page
  • SMaRt-BFT implementation by A. Bessani and J. Sousa
  • Raft CoreOS implementation

License

The code is distributed under Apache License Version 2.0

About

Byzantine fault-tolerant consensus library, written on Go

Resources

License

Stars

Watchers

Forks

Packages

No packages published