GitXplorerGitXplorer
p

vsr-rs

public
64 stars
5 forks
5 issues

Commits

List of commits on branch main.
Unverified
ed626546918a0dc550567d18a5bde4146b86c2c3

Simulation test cleanup

ppenberg committed 2 years ago
Unverified
bd95cee2aa6813ced76116d9e967a856d7ec8cae

Cleanup

ppenberg committed 2 years ago
Unverified
29b5a55cd5131ed1183dfb936efeb986eb49eac0

Forward state machine apply() result to clients

ppenberg committed 2 years ago
Unverified
58bffd987b6635e3e39d1cc4f8d22caa30703270

Improve StateMachine trait

ppenberg committed 2 years ago
Unverified
276623c37dac565398348e9b4ee991331bcba8e1

Random improvements

ppenberg committed 2 years ago
Unverified
ce13fe74d389e6a5b8a5684e84fffce90fce2191

Use view_number in on_prepare()

ppenberg committed 2 years ago

README

The README file for this repository.

Viewstamped Replication for Rust

This is a work-in-progress Rust implementation of the Viewstamped Replication consensus algorithm.

Getting Started

Run the example:

cargo run --example example

To see some debug traces, use RUST_LOG environment variable:

RUST_LOG=trace cargo run --example example

ToDo

  • [x] Normal operation
  • [x] State transfer
  • [x] Deterministic simulator
  • [ ] View changes
  • [ ] Failed replica recovery
  • [ ] Reconfiguration

Testing

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

References

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: