-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conflict between empty receipts and unsuccessful RFC lookups #256
Comments
I'm of the same opinion, but also not strongly against the the other solution. |
I'm also in favor of option 1). |
I believe option 1 is probably a "foot gun" and that it's likely for implementations to get this wrong or for users to interpret it wrong... Which suggest that option 2 is likely to be less likely to result in problems... This isn't a strong opinion and you guys can go whichever way you like. |
There is also option 3, that is similar to option 1 but has explicitness of option 2.
RFC example - content not available {
"jsonrpc": "2.0",
"id": 1,
"result": {
"content": "0x00",
"utpTransfer": false
}
} content is empty list {
"jsonrpc": "2.0",
"id": 1,
"result": {
"content": "0x01",
"utpTransfer": false
}
} content is {
"jsonrpc": "2.0",
"id": 1,
"result": {
"content": "0x01abc",
"utpTransfer": false
}
} This also wouldn't need special (de)serialization as this is standard type. |
Personally, I don't love the idea of wrapping our responses in another level of ssz-encoding, it could just get confusing especially when none of our other endpoints behave this way. |
In the current jsonrpc spec, for
portal_*recursiveFindContent
&portal_*TraceRecursiveFindContent
, if the lookup is not able to find the target information, a return value of"0x"
is expected (If the content is not available, returns "0x"
). However,"0x"
is also a valid value for an empty, ssz-encodedReceipts
type (reference).Therefore, it is impossible for a user to distinguish between a failed lookup for a
Receipts
content value, or a successful lookup that returns an emptyReceipts
type. I also expect that there might be future content values where we want"0x"
to be a valid value.It seems unavoidable that we need to change the
If the content is not available, return "0x"
convention for RFC lookups.Some possible solutions...
null
is a valid json type, so if the RFC lookup fails, then simply returnnull
as the content value.RFC example
TRFC example
RFC example
TRFC example
Personally, I'm in favor of solution 1, because it's simpler. I'm not convinced that we should treat an "unsuccessful" RFC lookup as an error. But, I don't have any strong objections if that's the consensus. If there are any other possible solutions / thoughts / feedback, please leave them in a comment below.
The text was updated successfully, but these errors were encountered: