monadic-xyz / gossip

Epidemic Broadcast Trees implementation using HyParView
BSD 3-Clause "New" or "Revised" License
6 stars 0 forks source link

EBT: Batch messages #11

Closed kim closed 6 years ago

kim commented 6 years ago

This is an obvious optimisation: we're buffering IHaves, thus may put them on the wire as one message. Correspondingly, we can construct a batch of Grafts from that. Obviously, the reply to Graft can now batch all payload messages together.

A future changeset should introduce a (configurable) limit on the batch sizes.

Fixes #9

kim commented 6 years ago

have one sender per batch

Not sure what you mean: there is one sender per batch. The message types IHave, Graft and Prune are exchanged between peers which have each other in their partial views. Gossip (ie payload messages), however, is relayed. I left this part to propagate elementwise, so that might be an optimisation.

kim commented 6 years ago

I'm assuming you meant the gossip messages, but I don't really see how to simplify this as those need to be relayed (and thus a batch may contain multiple origin senders).

geigerzaehler commented 6 years ago

I thought that maybe it would be possible to change the Graft constructor to Graft n (HashSet (Meta n)) where the first n is the sender of the batch. This would simplify the code for the receive (Graft sender gs) case.

kim commented 6 years ago

True, the shared Meta datatype doesn't make too much sense anymore, also for IHaves. I'll defer that to a later PR, due to being a bit invasive.