-
Notifications
You must be signed in to change notification settings - Fork 185
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
ALPNs and NodeIDs should be infallible #3123
Comments
I still strongly believe
No - we still have client authentication. And I don't think one should have access to a |
I think you're right. But it'd be so much nicer if it didn't involve |
I don't think so, because (1) the |
Okay, I looked at this again/thought about this a little more. |
Because of our crypto setup we know we have some invariants on an accepted connection: we always have a NodeId. We (probably also) always have an ALPN. Similarly the underlying APIs of
peer_identity
andhandshake_data
are probably also infallible. But maybe we don't even want to provide the underlying function at all anymore.These APIs need to be carefully checked and the implementations should be made infallible. Taking care to deal with the fact that we can not panic based on data accepted on the network since anyone can modify iroh or write a custom impl that would violate the constraints. Those should gracefully reject the connection.
Original issue text:
The
Connection::remote_node_id
method currently returns aResult
. The kind of errors it throws are currently all essentially bugs in the code. I am not sure how future proof this is however:It is however an eyesore that this API is fallible right now. Is there a way we can safely ensure this API is actually infallible? Maybe it involves changing how the handshake data gets stored so we can directly store a NodeId? This would also involve making the
peer_identity
no longer optional.The text was updated successfully, but these errors were encountered: