Asynchronous consensus in <40 code lines of Erlang

Loïc Hoguin essen@REDACTED
Fri Mar 6 12:32:05 CET 2020


You can test it using ConcuError.

"Concuerror is a model checking tool for debugging, testing and 
verifying concurrent Erlang programs."

https://concuerror.com/

Cheers,

On 06/03/2020 11:52, Bryan Ford wrote:
> 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
> 
> 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
> 
> Enjoy.  And by the way, nice language. :)
> 
> Cheers
> Bryan
> 

-- 
Loïc Hoguin
https://ninenines.eu


More information about the erlang-questions mailing list