You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
type GraphSyncRequest struct {
id GraphSyncRequestID (rename "ID") # unique id set on the requester side
root optional Link (rename "Root") # a CID for the root node in the query
selector optional Any (rename "Sel") # see https://github.com/ipld/specs/blob/master/selectors/selectors.md
extensions GraphSyncExtensions (rename "Ext") # side channel information
priority GraphSyncPriority (rename "Pri") # the priority (normalized). default to 1
cancel Bool (rename "Canc") # whether this cancels a request
update Bool (rename "Updt") # whether this is an update to an in progress request
} representation map
So, using pointers for the 2 optional fields. But then when encoding one of these, with nil values, to dag-cbor I get:
Which is invalid, thanks to map(7) - i.e., here's a map with 7 fields, but I'm only going to give you 5 of them. Hence the empty Rsps array pulled up into the request map as if it's a field, but it's still missing one more field even then.
Basically, the dag-cbor codec relies on Length() when writing a map(x) token, and bidnode is just reporting how many fields in its associated struct, discounting any that may be optional and missing, and then the map iterator is only returning 5 of them.
The text was updated successfully, but these errors were encountered:
Can be seen @ ipfs/go-graphsync#332
Relevant bit of schema looks like:
So, using pointers for the 2
optional
fields. But then when encoding one of these, withnil
values, to dag-cbor I get:Which, looks like this:
Which is invalid, thanks to
map(7)
- i.e., here's a map with 7 fields, but I'm only going to give you 5 of them. Hence the emptyRsps
array pulled up into the request map as if it's a field, but it's still missing one more field even then.Basically, the dag-cbor codec relies on
Length()
when writing amap(x)
token, and bidnode is just reporting how many fields in its associated struct, discounting any that may be optional and missing, and then the map iterator is only returning 5 of them.The text was updated successfully, but these errors were encountered: