-
Notifications
You must be signed in to change notification settings - Fork 4
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
js-quic
integration and Agent migration
#525
Conversation
We now have two competing types for |
I guess making them an opaque type means you need explicit casts. But this is ok for now. There is no common type for this stuff. Just do the explicit cast. |
I'm doing the cast, but the way it works right now is not clean. The two types are both called It's not the end of the world but I think it would be much cleaner if the host an port provided for creating the client or server was just a |
No we definitely need those types. In HS we would use a new type constructor for this and share between them. But for now just do it as explicit type cast. |
You can import them as aliases. |
The |
Another thing to note. The connection timeout time is set by the If we want to use a timer to specify the connection timeout. It's possible if we take the time remaining and use that for the So I think we need to race connecting with a connection timeout timer. To do this properly the establishment of a |
I think i'll keep it but have it wrap the normal connection establish logic. I think it's used pretty extensively for node-graph connection checking. |
The |
ee546b2
to
06459e3
Compare
I might change this. |
Likely the same thing needs to be applied to |
I'm applying some changes to this: MatrixAI/js-quic#26 |
I think the client or connection needs an event for when the remote certificates are available. We can check for them after receiving packets for a connection. It's going to be needed to know when TLS has been established and we can work out what the remote NodeId is. I hadn't implemented something for this yet because I didn't know a clean way of doing it on the quic level. But from the higher level usage of polykey it seems more clear. In polykey for agent-agent communication we will always be providing certs and using our own validation logic. So the remote certs should always be available and we can wait on that event after creating the client. Along with this, I think we still need to implement our custom verification logic. I don't think we currently have a method for setting this. |
We need to support a function called Previously this worked on the proxy level. So the object map didn't need to support taking multiple nodeIds when establishing a connection. This will make the locking a little finicky. SO what I need to do is update I think I need two forms of So we need the |
I've updated the code for TLS in MatrixAI/js-quic#26 No custom verification function yet, but that should be part of it too. |
It would be usefull if the Otherwise we need to set up a handler for connection events that sets up a handler for a new stream event and all the logic for cleaning that up once the connection has ended. It's better to have this logic internal to |
Technically a stream is specific to a I think it's possible to listen for the stream events on the This could apply to |
That's what I was thinking, yeah. |
I think we will need this https://napi.rs/docs/concepts/threadsafe-function inside js-quic, and the function will need to be synchronous, so that rust will just call the JS function when it is doing the work. What was the configuration parameter we need? |
I've cherry-picked the |
I forgot that we had actually entirely removed jose. So that jose hack can be deleted from |
df3092b
to
bf630fc
Compare
re-based. |
Cherry-picking the #455 fix to this PR. |
In any case, the current work on |
I'm not going to have time to be able to review the entire nodes domain as you've integrated it. So please look into the remaining comments that are unresolved and track them in new issues or in phase 2 or if they are quickfix right now, make sure you hit the load more comments, it sometimes hides it. @tegefaulkes My plan is to get towards the 6th (testing the new QUIC, RPC and MDNS on testnet) and 7th (Polykey Enterprise private networks) testnet deployments. That means merging this, and then helping you on the CLI extraction in particular in terms of building/packaging tooling and ESM migration. You'll then need to address all the dangling issues in phase 2. The remaining work for me on PKE is just the overall reactive architecture, and that will be hand off to @amydevs to focus on. Don't forget to squash some of your recent fix commits too. Side note, 7th deployment will require the RPC factored out to js-rpc so it can be re-used in PKE. |
All the review comments have been addressed. I'm moving on to cleaning and merging now. |
Turns out it wasn't needed. I ran all the tests and there were no errors relating to it. [ci skip]
[ci skip]
[ci skip]
[ci skip]
[ci skip]
[ci skip]
[ci skip]
[ci skip]
[ci skip]
ca23729
to
703ec5d
Compare
Merged! I'm moving on to CLI migration now. |
Description
This PR Does 3 things.
@matrixai/js-quic
intoPolykey
.NodeConnectionManager
manages remote initiated connections #527Issues Fixed
Tasks
NodeConnection
needs to be gutted and replaced withRPCClient
andQUICClient
usage. Besides this, usage of theNodeConnection
is mostly the same.PolykeyAgent
needs to be updatedRPCServer
andQUICServer
comboProxy
needs to be removed.Agent
domain needs to be migrated to using the agnostic RPC code.network
domain tests need to be removed, any tests still needed should be transplanted.grpc
domain tests need to be removed, any tests still needed should be transplanted.[ ] 8. Update relevant handlers with pagination- Differed to stage 2 PR[ ] 9. Update agent handlers to be timed cancellable, implement cancellation.- Differed to stage 2 PRFinal checklist