Asynchronous consensus in <40 code lines of Erlang

Bryan Ford brynosaurus@REDACTED
Fri Mar 6 11:52:03 CET 2020


Hi all,

I’ve heard about Erlang for a long time, but finally had reason to try it.

So I used it to prototype a simple model of Que Sera Consensus (QSC), a new experimental asynchronous consensus algorithm.  I was impressed to discover that the complete, working algorithm - though just running on a single machine for now - is expressible in only about 37 code lines as counted by CLOC, not counting test code.  Erlang’s selective receive feature, in particular, seems to have been presciently designed three decades ago just to implement the Threshold Logical Clocks (TLC) communication primitive that QSC builds on.

If anyone feels like poking at it, helping to find any flaws, or building more realistic cross-node implementations and experimenting with it in real distributed applications, the code lives here:

	https://github.com/dedis/tlc/tree/master/erlang/model <https://github.com/dedis/tlc/tree/master/erlang/model>

I’d be happy to hear any feedback or experiences, either privately, on this list, or via the above GitHub repo.  Is it comprehensible?  Can you break it?  Can you find a competitively small and simple implementation of, say, Paxos or Raft or any other comparable consensus algorithm in Erlang?

For background, the actual algorithms are described in this preprint:

	Que Sera Consensus: Simple Asynchronous Agreement with Private Coins and Threshold Logical Clocks
	https://arxiv.org/abs/2003.02291 <https://arxiv.org/abs/2003.02291>

Enjoy.  And by the way, nice language. :)

Cheers
Bryan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20200306/bb7406ee/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20200306/bb7406ee/attachment.bin>


More information about the erlang-questions mailing list