hbbft
hbbft copied to clipboard
Enforce batch size, add configuration options.
There are different ways one may want to specify the batch size in Honey Badger (see the TODO):
- Currently the batch size itself is a parameter; each node proposes
batch_size / num_nodes
transactions per epoch. This is desirable e.g. in a blockchain with a fixed maximum block size. - To achieve its asymptotic complexity, the paper suggests a batch size of
lambda * num_nodes * num_nodes * log(num_nodes)
. Since this comes at the cost of a quickly increasing latency, it's not always the right choice in practice. - There are other options in between with varying tradeoffs, e.g.
lambda * num_nodes
(constant proposal size per node) orlambda * num_nodes * log(num_nodes)
, etc.
We could make the batch size specification an enum that allows picking one of these options. This is particularly important for DynamicHoneyBadger
, where the number of nodes can change.
Also, we should enforce the limit: If another node is sending us a proposal that exceeds the per-node allowance, the transfer needs to be interrupted, the proposal ignored and the node reported/logged.
~With #104, this should only affect the implementation of the default queue, not Honey Badger.~
Edit: ~…and of Broadcast
, because that's the point where we need to enforce the message size limit.~ Actually, the user should refuse to receive messages beyond a certain size. We need to communicate or document that size somehow, though.
Edit 2: It does affect Queueing Honey Badger, of course. If we receive a contribution with too many transactions, we need to report a fault.