Viewstamped Replication for Rust
MIT License
This is a work-in-progress Rust implementation of the Viewstamped Replication consensus algorithm.
Run the example:
cargo run --example example
To see some debug traces, use RUST_LOG
environment variable:
RUST_LOG=trace cargo run --example example
You can run the tests with:
cargo test -- --nocapture
The run will print out a seed value such as:
Seed: 10693013600028533629
If the simulation triggers a problem, you can reproduce the exact same run by passing a seed to the simulator:
SEED=10693013600028533629 cargo test -- --nocapture
You can also increase logging level to see more output of the run with:
RUST_LOG=debug cargo test
You can get a test coverage report with:
cargo tarpaulin -o html
The implementation of vsr-rs
is based on the paper Viewstamped Replication Revisited by Liskov and Cowling.
However, the algorithm in the paper has the following known bugs:
The vsr-rs
library does not yet implement recovery or view changes so the bugs are not addressed.
For more information on VSR, please also check out the following presentations and blog posts: