Efficient BFT in partial synchronous networks
BDLS is an innovative BFT consensus algorithm that features safety and liveness by presenting a mathematically proven secure BFT protocol that is resilient in open networks such as the Internet. BDLS overcomes many problems, such as the deadlock problem caused by unreliable p2p/broadcast channels. These problems are all very relevant to existing realistic open network scenarios, and are the focus of extensive work in improving Internet security, but it is an area largely ignored by most in mainstream BFT protocol design. (Paper: https://eprint.iacr.org/2019/1460.pdf or https://dl.acm.org/doi/abs/10.1145/3538227 or https://doi.org/10.1145/3538227 or https://www.doi.org/10.1007/978-3-030-91859-0_2 )
For this library, to make the runtime behavior of consensus algorithm predictable as function: y = f(x, t), where 'x' is the message it received, and 't' is the time while being called, then'y' is the deterministic status of consensus after 'x' and 't' applied to 'f', it has been designed in a deterministic scheme, without parallel computing, networking, and the correctness of program implementation can be proven with proper test cases.
- Pure algorithm implementation in deterministic and predictable behavior, easily to be integrated into existing projects, refer to DFA for more.
- Well-tested on various platforms with complicated cases.
- Auto back-off under heavy payload, guaranteed finalization(worst case gurantee).
- Easy integratation into Blockchain & non-Blockchain consensus, like WAL replication in database.
- Builtin network emulation for various network latency with comprehensive statistics.
For complete documentation, see the associated Godoc.
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get install autoconf automake libtool curl make g++ unzip
cd /tmp
wget https://go.dev/dl/go1.19.linux-amd64.tar.gz
sudo tar -xvf go1.19.linux-amd64.tar.gz
sudo mv go /usr/local
cd
echo 'export GOROOT=/usr/local/go' >> .profile
echo 'export GOPATH=$HOME/go' >> .profile
echo 'export PATH=$GOPATH/bin:$GOROOT/bin:$PATH' >> .profile
source ~/.profile
go version
go env
git clone https://github.com/yonggewang/bdls.git
cd bdls/
git checkout master
cd cmd/emucon/
go build .
./emucon help genkeys
./emucon genkeys --count 4
[open four terminals to run four participants. if you log to remote Linux,
you may use tmux commands. In tmux, you can switch termian using "ctrl+b d"
and use "tmux attach -t 0" to enter the terminal. Use "tmux list-session"
to check the current active terminals]
./emucon run --id 0 --listen ":4680"
./emucon run --id 1 --listen ":4681"
./emucon run --id 2 --listen ":4682"
./emucon run --id 3 --listen ":4683"
cd ../..
go test -v -cpuprofile=cpu.out -memprofile=mem.out -timeout 2h
rm go.*
go mod init github.com/yonggewang/bdls
go mod tidy
go mod vendor
See benchmark ourput at: AMD-NORMAL.TXT and PI4-OVERLOAD.TXT
- Consensus messages are specified in message.proto, users of this library can encapsulate this message in a carrier message, like gossip in TCP.
- Consensus algorithm is NOT thread-safe, it MUST be protected by some synchronization mechanism, like
sync.Mutex
orchan
+goroutine
.
- A testing IPC peer -- ipc_peer.go
- A testing TCP node -- TCP based Consensus Emualtor
On-going