-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Specification
With #344 more or less solved we need a way of authenticating when adding forward connections. this includes authenticating the old connections when a bucket fills up. In both cases we can so a pingNode to check if a node is alive. However the current implementation of pingNode is insufficient for the job as it only checks if a node is alive.
NodeManager.pingNode needs to be updated to match the following criteria;
- It needs to establish a proxy connection to the target. if a connection can be established then the target is considered alive. if the connection is established then we can consider it authenticated as well.
- It needs to take an optional address information for checking if direct connections without the nat bashing proceedure can be done. This will be useful for ICE
The NodeManager.setNode needs to be updated to do the following.
- when a bucket is full the oldest node needs to be verified with
pingNode. This is already done, just need to update ping for this. This will need to concurrently check alpha of the oldest connections. - Needs an optional force parameter to garentee adding the node.
NodeConnectionManager needs to be updated to;
- takes
NodeManageras part of start. - establishing a connection should trigger
NM.qeueSetNode
NodeManager needs to be updated to;
- startStop asyinc init pattern.
- implement a async queue for adding nodes to the nodeGraph.
After that we need to make sure all instance where we need to add a node just calls NodeManager.setNode. Where this is done still needs to be speced out but this may be outside the scope of this issue. Create a new issue for this?
Additional context
- another very relevant issue: Expunge any added "invalid" nodes from k-buckets #226
- Related Seed node not adding details of connecting node to its
NodeGraph#344 - Related Testnet Deployment #326
- Related Authenticate the sender of a hole-punching signalling message #148
Tasks
- update
NodeManager.pingNodeto match the above specification. - update
NodeManager.setNodeto match the above specification. - implement setnode queue. this is similar to the queue used by discovery.
- seperate pingNode out of setNode
- concurrently check alpha old nodes if a bucket is full when setting node.
- convert NCM and NM to startstop, they rely on each other now with NCM calling NM.qeueSetNode.
- establishing a NodeConnection should trigger setting a node in the nodeGraph by callong NM.qeueSetNode.
- Creating a new connection should not be blocked by setting node.
- Integrate into
pk nodes set(with--no-pingand--force) andpk nodes ping