ipfs / ipfs/go-graphsync

Responder sends no blocks, just metadata

Open
#372 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
103
Forks
41
PR merge metrics
No merged PRs in 30d

Description

# What

We introduce a new RequestType - Metadata - as follows:

```ipldsch
type GraphSyncRequestType enum {
# New means a new request
| New ("n")
# Cancel means cancel the request referenced by request ID
| Cancel ("c")
# Update means the extensions contain an update about this request
| Update ("u")
# Restart means restart this request from the begging, respecting the any
# DoNotSendCids/DoNotSendBlocks contained in the extensions--essentially a
# cancel followed by a new
# TODO: | Restart ("r")
| Metadata ("m")
} representation string
```

For a metadata request, a responder responds as would normally, but simply never sends blocks for this request. This means they respond only with metadata.

Suggested implementation:
- Add a call to the [ResponseStream](https://github.com/ipfs/go-graphsync/blob/main/responsemanager/responseassembler/responseassembler.go#L114) to disable block sending entirely, similar to the SkipFirstBlocks / IgnoreBlocks that when called, always does not send a block in future calls to Transaction
- Modify the query preparer as needed
- Handle the request type in the ResponseManager otherwise just like a new request for first implementation.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.