n0-computer / iroh

A toolkit for building distributed applications
https://iroh.computer
Apache License 2.0
2.52k stars 159 forks source link

Write specification for bao blob sync protocol #1230

Open rklaehn opened 1 year ago

rklaehn commented 1 year ago

basically write a spec for iroh-bytes that would allow somebody to do a clean room impl of the protocol.

this should be a textual spec, a generator of examples, and a number of handcrafted/curated examples.

rklaehn commented 1 year ago

This https://github.com/n0-computer/iroh/pull/1402 is at least a start...

What would be needed in addition would be

Idea for the generator:

it produces a directory containing a number of blobs, like this:

<hash1>.data
<hash2>.data

and a number of request/response pairs that can be satisfied with the data in the directory:

<testnr>.request
<testnr>.response

Basically: given the files *.data, when given <x>.request, I have to produce exactly the bytes in <x>.response. Then I have a compatible impl. There is zero leeway here - everything should be completely deterministic.

This generator should be able to produce arbitrarily much test data.

rklaehn commented 1 year ago

https://github.com/n0-computer/iroh/pull/1407 is the way the wire level tests would be written...