poanetwork / hbbft

An implementation of the paper "Honey Badger of BFT Protocols" in Rust. This is a modular library of consensus.
Other
357 stars 96 forks source link

More tests: Binary Agreement #395

Open afck opened 5 years ago

afck commented 5 years ago

Other than in the very specific binary_agreement_mitm, the tests currently only use an adversary that randomly reorders messages but doesn't send any.

We should add a general test where the attacker not only reorders, but also creates random messages. Those shouldn't be "completely random", of course: E.g. the epoch should usually be the current one (otherwise they just get ignored), or maybe sometimes ±1. (Configurable as proptest parameters?) And the boolean value should probably either be random, or the opposite of the correct node's input. Or the opposite of the current coin value, if known? Ideally, we should come up with different kinds of simple attack strategies that are most likely to uncover bugs.

Not sure if this should replace the existing test, or be added to it.

afck commented 5 years ago

And let's also try different reordering strategies, in addition to the random one, e.g. always pick the lowest-ID node with a nonempty queue.