rust-ipfs icon indicating copy to clipboard operation
rust-ipfs copied to clipboard

bitswap: Bundle multiple requests/blocks into a single message

Open dariusc93 opened this issue 9 months ago • 0 comments

In the internal implementation of bitswap, wants and haves were split into their own respective sessions on purpose to allow handling each request on its own, putting peers into those sessions based on any requests made for said blocks, however this would result in multiple messages being sent when multiple blocks are requested. We could optimize this by bundling the multiple requests into a single message, assuming we can stay below the max message size (which is 2MB). If a message does begin to reach that limit, we could split it up into multiple messages if needed.

dariusc93 avatar May 10 '24 05:05 dariusc93