Skip to content
This repository has been archived by the owner on Oct 28, 2020. It is now read-only.

Few comments to protocol #8

Open
slush0 opened this issue Apr 7, 2014 · 1 comment
Open

Few comments to protocol #8

slush0 opened this issue Apr 7, 2014 · 1 comment

Comments

@slush0
Copy link

slush0 commented Apr 7, 2014

Hi Mike,

I just found this project, it seems interesting. After I read payfile.proto, I have following comments/suggestions:

a) I suppose the protocol should work like request/response; single client->server message should trigger one server->client response. It seems that DownloadChunk(num_chunks=3) will trigger three Data() messages coming out of the server, which breaks the request/response "rule". I suggest to change "optional Data data = 6;" to "repeated Data data = 6;" so one DownloadChunk message will trigger exactly one Data response.

b) "chunk_size" should me a property of File message, not Manifest. Chunk size may be relevant to File itself (it is probably a function of file size), server may also store given File parsed in chunks on filesystem, to prevent disk seeks on client request.

c) price per chunk is currently "int32", Although 24 BTC per chunk seems to be enough now, I would prefer "uint32" or even better "uint64". Not all altcoins costs hundreds of USD each...

Thanks,
Marek

@mikehearn
Copy link
Owner

Thanks for the feedback! The intention behind not having a strict req/response model was latency ... so you can tune the trust/latency tradeoff according to your device. Unfortunately because of how protobufs work, parsing a big Data message means loading it all into RAM unless you write special code to do SAX style parsing.

But yeah at some point it'd make sense to switch it to p2proto or some other library that offers simple request/response communication, and strip out the custom code for that.

The chunk size thing needs to be rethought indeed. I put the whole thing together in about two weekends so, not a huge design effort went in :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants