-
Notifications
You must be signed in to change notification settings - Fork 973
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
ResourceUnavailable
details
#2414
Comments
To avoid wasted implementation effort on how the error should be handled and interpreted by all clients, there are a few details to work out - not only do we save work now ("oh, client x responds this way and client y the other"), but detailing these behaviors in the spec will also make future changes more smooth as having a fixed point / behavior to base backwards compatibility on generally is easier. In particular, for now we've divided the world into "worked" and "didn't work", letting the client side implement logic to guard against faulty and/or malicious responders (which it must do anyway), with "didn't work" being treated as semi-permanent. More specific error codes are generally useful when there is an expectation that clients will choose a behavior based on that error code - when adding error codes to the spec, we should thus specify under which conditions each request responds with a particular error code, what the expected behavior on the receiving end is, and how to deal with unexpected error codes. For
There are therefore two cases where
The other way to look at the error in the case of One final open question is what to do with light-syncing peers that are not validating, but just listening to some traffic - presumably, they would always respond to requests with |
Yep I don't think there's any need for For Nodes receiving I guess I'm unclear on exactly what problems we're trying to work through here because I wasn't privy to the original conversation. |
That should be part of any PR that introduces
this is the tricky part: any range you ask for might be empty in their view of the chain - the For the error code to be useful, one would need to accompany it with a guide as to when to return it exactly, and preferably, how the receiving client should react it - if this is not included, we'll end up in a situation where the error code becomes a client-specific extension that will be difficult to code logic against. One property of this kind of error code could be used for is to establish who is a freeloader - the network can (and perhaps should) by default support a certain amount of freeloading - the longer term solution discussed here is that we would introduce such information in the ENR so that it's reasonably easy to find appropriate nodes - it might however also make more sense that such nodes stop the request at a libp2p level in the multiplexer.
It's all in my comment: introducing an error code should be accompanied by the exact conditions under which it's triggered, what the expected behavior on the receiving side is and for which requests it's valid, as part of the spec text. For client-specific or loosely defined errors, there's always the anything-goes |
I think this is our fundamental disagreement. When designing APIs it's really, really useful to have more information than less. Even if you don't trust that result, knowing exactly what's claimed is a big improvement on a vague empty response which could mean no blocks in the range, could mean the blocks aren't available or could be the node being a jerk. It's ok if some clients treat the error response the same as an empty response, just as it's ok that different clients implement different approaches to syncing. The reason this whole proposal started months ago is because it really would be useful to differentiate between a node claiming there were no blocks in the range and one saying they can't answer that request. If the remote peer explicitly says they don't have the blocks, the requesting peer can disconnect them immediately, knowing that they don't have the blocks required and aren't currently useful. They don't have to disconnect them, there's lots of different things clients might factor into making that decision and it's ok for clients to have different policies on that, just as we have different policies on how to prioritise which peers to connect to so we have coverage of required subnets.
Agree we should clearly define when to return it. As I mentioned that will be something close to "when the node does not have sufficient information to return the first block in the requested range". We don't actually define what a client should do with a successful response so it seems odd to have a higher bar for error codes. We also don't define how clients act when they get a And yes, given the structure of the spec we should explicitly say this response is only valid for |
PR up at #2430 |
Based on conversations with @arnetheduck, this error code is a bit ambiguous/under-specified for all of the req/resp message types. Specifically, we need to ensure that the MUSTs and SHOULDs of various calls are sufficient and safe given this new code.
This error code was pulled for the v1.1.0-alpha.4 release (#2413). The plan is to discuss the ambiguities here, and work through these details BY WEDNESDAY MAY 19 in preparation for spec freeze on Friday.
The current path is to include the error code but to ensure it is done safely.
The text was updated successfully, but these errors were encountered: