Closed vyzo closed 1 year ago
Is there a risk here if messages are delivered out of order? Like if a node receives message 5 before message 4 from the same peer, will that node then never forward message 4 on to its other peers? Does that risk some messages not being well propagated to the whole network?
This can only happen if one message from the peer is dropped (because of a full queue) and the next message propagates before the dropped message arrives from other paths.
So in theory there is some risk, but this would be quite difficult to trigger. Maybe with an extremely high sending rate from some peer.
Worth noting, but i am not convinced it is a problem.
There is a simple way to alleviate concerns here: keep a bitvector (say 32 or 64 bits, as an integer) that encodes whether the last few messages have been delivered.
How does that sound?
@vyzo I don't think I fully understand how the bitvector would work, but I think keeping a small cache of the last few seqnos and whether they've been delivered once before does make sense and would address the issue I brought up!
Ok, i will implement something along these lines.
Adds support for default validators and provides an implementation that validates the message seqno as a per peer nocne to prevent infinite propagation when the network diameter exceeds the seen cache span. See #524 Implements the logic described in https://github.com/ipfs/kubo/issues/9665
TBD: