hotstuff
1.0.0
给读者注意:此代码库在设计自己的协议时以BFT共识和基准作为基准很有用。如果您正在寻找最先进的BFT协议,我建议tusk(异步)和BullShark(部分同步)提供出色的性能,鲁棒性和可扩展性。
该回购提供了最小的Diem核心HotStuff共识协议的2链变体的实现。该代码库被设计为小型,高效且易于基准和修改。它并非被设计为在生产中运行,而是使用真实的密码学(Dalek),网络(Tokio)和存储(RockSDB)。
Hotstuff用Rust编写,但所有基准测试脚本均以Python编写,并用织物运行。要在本地机器上部署和基准测试4个节点的测试台,请克隆回购并安装Python依赖性:
git clone https://github.com/asonnino/hotstuff.git
cd hotstuff/benchmark
pip install -r requirements.txt
您还需要安装clang(RockSDB要求)和TMUX(在后台运行所有节点和客户端)。最后,使用面料运行本地基准:
fab local
此命令可能会在您第一次运行时需要很长时间(在release
模式下编译Rust Code可能很慢),并且您可以在fabfile.py
中自定义许多基准参数。当基准终止时,它与下面的执行摘要相似。
-----------------------------------------
SUMMARY:
-----------------------------------------
+ CONFIG:
Faults: 0 nodes
Committee size: 4 nodes
Input rate: 1,000 tx/s
Transaction size: 512 B
Execution time: 20 s
Consensus timeout delay: 1,000 ms
Consensus sync retry delay: 10,000 ms
Mempool GC depth: 50 rounds
Mempool sync retry delay: 5,000 ms
Mempool sync retry nodes: 3 nodes
Mempool batch size: 15,000 B
Mempool max batch delay: 10 ms
+ RESULTS:
Consensus TPS: 967 tx/s
Consensus BPS: 495,294 B/s
Consensus latency: 2 ms
End-to-end TPS: 960 tx/s
End-to-end BPS: 491,519 B/s
End-to-end latency: 9 ms
-----------------------------------------
Wiki记录了代码库,解释了其体系结构以及如何读取基准测试结果,并提供了一个逐步的教程,可以在多个数据中心(WAN)上在Amazon Web服务上运行基准测试。
该软件被许可为Apache 2.0。