Closed HDegroote closed 6 months ago
A potential extension is to also avoid sending wireRange
messages if we know the other peer is not downloading (this.remoteDownloading === false
), but that's relying on different logic so I haven't included it in this PR
The tests were no longer relevant: they were checking the writer peer's perception of the downloading peers' contiguous length. I wrote some new tests for the current behaviour on broadcasting the contiguouslength, from the point of view of reader peers.
I think the logic might be flawed, marking as draft while I debug some more
False alarm, what I detected was unrelated to this PR (fixed here https://github.com/holepunchto/hypercore/pull/517)
Currently
broadcastRange
sends awireRange
message to every peer on every update. This PR avoids sending this message to peers when we already know they have those blocks available.Failing tests (skipped for now) indicate that we rely on thebroadcastRange
spam to update thecontiguousLength
, so I marked this as draft until that's clarified.