Closed kim closed 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.
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).
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.
True, the shared Meta
datatype doesn't make too much sense anymore, also for IHave
s. I'll defer that to a later PR, due to being a bit invasive.
This is an obvious optimisation: we're buffering
IHave
s, thus may put them on the wire as one message. Correspondingly, we can construct a batch ofGraft
s from that. Obviously, the reply toGraft
can now batch all payload messages together.A future changeset should introduce a (configurable) limit on the batch sizes.
Fixes #9