Fantom-foundation / lachesis-rs

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

Tester #34

Open Maxime2 opened 5 years ago

Maxime2 commented 5 years ago

We need a tester similar one in lachesis-go (https://github.com/Fantom-foundation/go-lachesis/tree/master/tester ) which sends a specified number of transactions to a lachsesis network. This is very helpful in debugging lachesis.

SamuelMarks commented 5 years ago

How about we go further and create a test framework that can work on the specification, rather than a particular implementation?

That way we can share the test framework for both Go and Rust (to start with).

Maxime2 commented 5 years ago

The tester just shows if consensus can be reached or not. As lachesis is a randomised and multi thread algorithm it is rather impossible to make repeatable trajectory of its execution on very run even with the same set of data. If we want to make it repeatable to the every step so it could be set in deterministic tests we will need to remove randomness from lachesis, that basically mean we would need reimplement some functions the other way.

AgustinCB commented 5 years ago

Removing randomness in this code basis doesn't need much change, actually. Take a look to: https://github.com/Fantom-foundation/lachesis-rs/blob/master/lachesis-rs/src/node.rs that R that extnds Rng is a random generator trait object. We could create an implementation of Rng that isn't actually random and use that in the tester. It would require no code change.