Skip to content

Commit e808eb7

Browse files
committed
remove outdated data transfer protocol fix proposals
1 parent 362c663 commit e808eb7

File tree

1 file changed

+0
-50
lines changed

1 file changed

+0
-50
lines changed

content/design/data-transfer/_index.md

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -158,56 +158,6 @@ Next, the *provider* sends all the blobs in the collection on the stream. Blobs
158158

159159
During sending a *provider* could discover does not have the data for one of the blobs. In this case it will send a `Response` containing `Res::NotFound` instead of `Res::Found`. After that it will finish the stream and not send further blobs.
160160

161-
# Fix Proposals
162-
163-
We fully admit: this is a bit clunky in places.
164-
165-
## Remove `Res` struct
166-
167-
Currently `Response` just wraps `Res`. We can rename `Res` to `Response` and remove the former `Response`. It is an unneeded indirection.
168-
169-
I think originally `Response` included a `request_id` field. But that is no longer used.
170-
171-
## Remove duplication of `total_blobs_size`
172-
173-
The `total_blobs_size` is sent back twice:
174-
175-
- In the `Collection` struct containing collection metadata.
176-
- In the `Res::FoundCollection` response.
177-
178-
Removing it from `Res::FoundCollection` may make the most sense, because `Res::Found` also does not mention the size. The other option is to add it to `Res::Found` but that’s not very useful since the first thing the bao encoding sends is the size.
179-
180-
## Remove `Res` entirely
181-
182-
It does not provide much functionality because if we do not find something, the blob or the collection, we simply end up closing the stream. So instead we can use `SendStream::reset` with a new `CloseReason::NotFound`. This would communicate the same but simpler and fewer packets.
183-
184-
(`SendStream` and `CloseReason` are code references, not mentioned in the protocol description here.)
185-
186-
Already `Res::NotFound` does not include any information about which hash was not found. This you have to deduce from when you receive it. However, if we instead reset the stream we **do lose information** we had before: resetting the stream means all buffers are dropped on the floor, no more retransmitting etc. So you won’t be able the know **which** blob the provider doesn’t have. I don’t think this is a problem at all, you don’t really need to know this.
187-
188-
Possibly you could distinguish between `CloseReason::BlobNotFound` and `CloseReason::CollectionNotFound`. However I don’t think this really gives you much extra information so I would avoid this.
189-
190-
## Remove `Handshake::version`
191-
192-
We already use the ALPN. This is redundant.
193-
194-
This would mean each request stream starts with a handshake package looking like this:
195-
196-
```rust
197-
struct Handshake {
198-
token: Authtoken,
199-
}
200-
```
201-
202-
(`AuthToken` is basically an array - we need to check serde/postcard if we can just use the array inplace there for this doc.)
203-
204-
I think that is fine, it allows the *provider* to use different auth tokens for different collections.
205-
206-
# Problems
207-
208-
## No request by Blake3 hash
209-
210-
Our protocol in it's current state can not really do content addressing. We can not retrieve something by knowing the Blake3 hash because we need to know the hash of the `Collection` which wraps it. But this has an arbitrary `name` field in it as well as arbitrary names for each blob. So even if you know the hash of a blob you can not retrieve it.
211161

212162
# References
213163

0 commit comments

Comments
 (0)