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

Design handling of messages to non-existent nodes in `VirtualNet` #375

Open vkomenda opened 5 years ago

vkomenda commented 5 years ago

372 added a filter that clears messages addressed to removed nodes. There has been a discussion about possible future evolution of this filtering mechanism:

  1. Keep it and make sure it works when multiple nodes are removed and readded, #374.

  2. Drop the NodeDisappearedInCrank error and the filter altogether.

  3. Add an additional flag that turns the filter on and off during the test.

Each of those variants has its drawbacks:

  1. Was criticised for adding no value at the cost of some complexity.

  2. Would probably reduce the informative error message to a less informative expect message.

  3. The removed node IDs are stored in a set. Why having an additional flag? The set is more expressive since the empty set means ON and the set containing all node IDs means OFF.

Some design might be necessary to fit this issue into a broader picture and make the changes worthwhile.

afck commented 5 years ago

Realistically, if a node restarts, I imagine some of the messages will be lost and others may reach it after restart. It would be great if we could simulate that, i.e. effectively only drop a random subset of the node's messages.