Crates.io | hotstuff_rs |
lib.rs | hotstuff_rs |
version | 0.3.0 |
source | src |
created_at | 2022-07-26 09:30:35.550685 |
updated_at | 2023-12-12 06:03:39.208039 |
description | An implementation of the HotStuff consensus algorithm intended for production systems. |
homepage | https://parallelchain.io |
repository | https://github.com/parallelchain-io/hotstuff_rs |
max_upload_size | |
id | 633059 |
size | 2,537,764 |
A Rust Programming Language library for Byzantine Fault Tolerant state machine replication, intended for production systems.
HotStuff-rs implements a variant of the HotStuff consensus protocol, but with extensions like block-sync and dynamic validator sets that makes this library suited for real-world use-cases (and not just research systems). Some desirable properties that HotStuff-rs has are:
(Blockchain, App State, Validator Set, Block) -> (Next Blockchain, Next App State, Next Validator Set)
.Read the docs: docs.rs.
Open an issue in GitHub if you:
Do try to label your issues appropriately.
HotStuff works by building a 'BlockTree': a directed acyclic graph of Blocks. Block is a structure with a data
field which applications are free to populate with arbitrary byte-arrays. In consensus algorithm literature, we typically talk of consensus algorithms as maintaining state machines that change their internal states in response to commands, hence the choice of terminology.
HotStuff guarantees that committed Blocks are immutable. That is, they can never be un-committed as long as at least a supermajority of voting power faithfully execute the protocol. This guarantee enables applications to make hard-to-reverse actions with confidence.
A Block becomes committed the instant its third confirmation is written into the BlockTree. A confirmation for a Block A
is another Block B
such that there is path between B
to A
.
The choice of third confirmation to define commitment--as opposed to first or second--is not arbitrary. HotStuff's safety and liveness properties actually hinge upon on this condition. If you really want to understand why this is the case, you should read the paper. To summarize:
HotStuff is the first consensus algorithm with a simple leader-replacement algorithm that does not have a 'wait-for-N seconds' step, and thus can make progress as fast as network latency allows.