ANN: rpc25519/tube, a RAFT library with a synctest network simulator (+ network chan API)

130 views
Skip to first unread message

Jason E. Aten

unread,
Sep 18, 2025, 6:58:34 PMSep 18
to golang-nuts

> A tube is a small raft, delightfully used for 

> floating down rivers on a sunny summer's day 

> in some parts of the world.

I have open sourced my Go RAFT library called Tube. It is
a part of my Go RPC package (rpc25519) that provides 
"channels over the network".

https://github.com/glycerine/rpc25519/blob/master/tube/tube.go

Tube (RAFT) uses my gosimnet, https://github.com/glycerine/gosimnet
for testing. Gosimnet provides a simulated network environment 
for testing/synctest tests.

Probabilistic and asymmetric network faults can be injected in gosimnet.
Dropped or delayed messages can be replayed much later to simulate 
chaotic (real) networks under stress.

It was fortuitous timing that synctest was announced shortly before
I needed a facility for mocking the network for to do RAFT/Tube testing. 

I used gosimnet and the Tube implementation to do a QA pass on synctest before
it was finalized in Go 1.25, and I'd like to thank Damien Neil for his work on 
on the synctest package and for fixing the issues found. He gave a nice talk on synctest recently[1], which is well worth watching.

Together with gosimnet, gophers have a much stronger distributed 
systems testing story. Not quite full DST (Deterministic Simulation 
Testing)[2] yet,  because determinism within the standard Go runtime
remains elusive[3], but still highly useful and effective.

Enjoy,
Jason

[1] recent gophercon EU 2025 talk on the testing/synctest package: https://www.youtube.com/watch?v=oIC3zhTAOsY

2014 Strange Loop talk is a great intro to DST. He is now the CEO
of Antithesis, which provides DST as a (very pricey) cloud service.

the Polar Signals folks apply a couple of minor patches to the Go runtime,
and use WASM -- the only single threaded Go environment -- to get 
fairly deterministic execution. Threads being scheduled non-deterministically
by the OS are the big problem.  For a while I thought we might be able to just
record and replay instead of DST, via the rr debugger, but getting 
the Go runtime initialization itself to not have race bugs is also hard ( https://github.com/golang/go/issues/74019 ).
Reply all
Reply to author
Forward
0 new messages