fission-codes / go-car-mirror

Generic Go implementation of the CAR Mirror protocol
Apache License 2.0
4 stars 0 forks source link

Potential max batch size issues #111

Open justindotpub opened 1 year ago

justindotpub commented 1 year ago

Periodically -- at the end of the file or every n streamed blocks -- the Receiver sends a list of unsynchronized subgraph roots: the bottom of the currently synced graph with unsynchronized children. The Provider also sends a Bloom of blocks that it thinks may be discovered as duplicates.

This n streamed blocks has been referred to as the max batch size per round.

Make sure max batch size never bites us, specifically as it relates to ensuring that we always send all root CIDs and return all subgraph roots.

Similar for max batch size for cold calls.

ETA: 2023-10-31

justindotpub commented 1 year ago

I have addressed these issues now.

One thing to note however, is that due to the need to always send remaining roots, you can quickly reach a point where almost every push exceeds the max block values. For example, when adding the Ubuntu ISO to IPFS, we end up having a CID with 109 links underneath. Most of those have 174 links underneath. As you can see, this quickly reaches a point where the number of roots a source must return is quite large.