Skip to content

Investigate means of authenticating a node ID when adding to NodeGraph #322

@joshuakarp

Description

@joshuakarp

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;

  1. 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.
  2. 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.

  1. 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.
  2. Needs an optional force parameter to garentee adding the node.

NodeConnectionManager needs to be updated to;

  1. takes NodeManager as part of start.
  2. establishing a connection should trigger NM.qeueSetNode

NodeManager needs to be updated to;

  1. startStop asyinc init pattern.
  2. 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

Tasks

  • update NodeManager.pingNode to match the above specification.
  • update NodeManager.setNode to 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-ping and --force) and pk nodes ping

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions