Fantom-foundation / lachesis-rs

Lachesis BFT consensus for permission-less networks, in Rust
MIT License
34 stars 5 forks source link

Unifications for compatibility with go-lachesis #44

Open Maxime2 opened 5 years ago

Maxime2 commented 5 years ago

Current Lachesis implementation in Go uses FNV hash function to calculate EventHash, https://golang.org/pkg/hash/fnv/ ; but Rust has replaced FNV hash as its default hash function by a faster hash function, https://github.com/rust-lang/rust/pull/37229

To make lachesis-rs compatible with go implementation we need to use the very same hash function for event hashes. See https://github.com/servo/rust-fnv for fnv hash implementation in Rust.

Maxime2 commented 5 years ago

Actually EventHash is calculated as SHA256(serialised event body); and go-lachesis and lachesis-rs have different event body definitions and different serialisation methods, - these ones need to be unified among all implementations of Lachesis, at least for things sent between nodes.