Skip to content
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

Testnet Deployment #326

Closed
wants to merge 33 commits into from
Closed

Testnet Deployment #326

wants to merge 33 commits into from

Commits on Apr 8, 2022

  1. Configuration menu
    Copy the full SHA
    170d155 View commit details
    Browse the repository at this point in the history
  2. WIP

    - added getBuckets test for distance and lastUpdated order
    - resetting buckets work
    - changing utility names
    CMCDragonkai authored and tegefaulkes committed Apr 8, 2022
    Configuration menu
    Copy the full SHA
    0a68216 View commit details
    Browse the repository at this point in the history
  3. feat: added NodeGraph.getClosestNodes()

    Implemented `getClosestNodes()` and relevant tests in `NodeGraph.test.ts`.
    
    Relates to #212
    tegefaulkes committed Apr 8, 2022
    Configuration menu
    Copy the full SHA
    b15e041 View commit details
    Browse the repository at this point in the history
  4. fix: NodeManager.setNode Properly handles adding new node when buck…

    …et is full
    
    Logic of adding nodes has been split between `NodeManager` and `NodeGraph`. The `NodeGraph.setNode` just handles adding a node to the bucket where the `NodeManager.setNode` contains the logic of when to add the node
    
    Relates #359
    tegefaulkes committed Apr 8, 2022
    Configuration menu
    Copy the full SHA
    a70f82a View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    eff7993 View commit details
    Browse the repository at this point in the history
  6. feat: added connectionEstablishedCallback to Proxy

    Added a callback to the `Proxy` that is called when a `ForwardConnection` or `ReverseConnection` is established and authenticated. It is called with the following connection information; `remoteNodeId`, `remoteHost`, `remotePort` and `type`. They type signifies if it was a forward or reverse connection. Note that this is only triggered by composed connections.
    
    Added a test for if the callback was called when a `ReverseConnection` is established.
    
    Relates #332
    Relates #344
    tegefaulkes committed Apr 8, 2022
    Configuration menu
    Copy the full SHA
    b9ed19d View commit details
    Browse the repository at this point in the history
  7. feat: Proxy trigger adding nodes to Nodegraph

    Added an event to the `EventBus` that is triggered by the `Proxy`'s `connectionEstablishedCallback`. this adds the node to the `NodeGraph`.
    
    Related #344
    tegefaulkes committed Apr 8, 2022
    Configuration menu
    Copy the full SHA
    46143d4 View commit details
    Browse the repository at this point in the history
  8. feat: added optional timeout timers to NodeConnectionManager methods

    In some cases we want to specify how long we attempt to connect to a node on a per-connection basis.
    
    Related #363
    tegefaulkes committed Apr 8, 2022
    Configuration menu
    Copy the full SHA
    cb489ce View commit details
    Browse the repository at this point in the history
  9. refactor: updated implementation of nodePing

    Added `nodePing` command to `NodeConnectionManager` and `NodeManager.nodePing` calls that now. the new `nodePing` command essentially attempts to create a connection to the target node. In this process we authenticate the connection and check that the nodeIds match. If no address is provided it will default to trying to find the node through kademlia.
    
    Related #322
    tegefaulkes committed Apr 8, 2022
    Configuration menu
    Copy the full SHA
    67b848c View commit details
    Browse the repository at this point in the history
  10. feat: NodeManager.setNode authenticates the added node

    `setNode` now authenticates the node you are trying to add. Added a flag for skipping this authentication as well as a timeout timer for the authentication. this is shared between authentication new node and the old node if the bucket is full.
    
    Related #322
    tegefaulkes committed Apr 8, 2022
    Configuration menu
    Copy the full SHA
    aa804f7 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    bb6ac85 View commit details
    Browse the repository at this point in the history
  12. syntax: general linting

    tegefaulkes committed Apr 8, 2022
    Configuration menu
    Copy the full SHA
    6c874bc View commit details
    Browse the repository at this point in the history
  13. fix: squash into ping node changes.

    Updated `NodeConnectionManager.pingNode` to just use the proxy connection.
    
    #322
    tegefaulkes committed Apr 8, 2022
    Configuration menu
    Copy the full SHA
    bfc4a26 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    3e76236 View commit details
    Browse the repository at this point in the history
  15. feat: setNode concurrently pings multiple nodes

    `setNode` now pings 3 nodes concurrently, updating ones that respond and removing ones that don't. If there is room in the bucket afterwards then we add the new node.
    
    #322
    tegefaulkes committed Apr 8, 2022
    Configuration menu
    Copy the full SHA
    b202351 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    ed1449a View commit details
    Browse the repository at this point in the history
  17. feat: async queueing for setting nodes

    `setNode` now has a `blocking` flag that defaults to false. If it encounters a full bucket when adding a node then it will add the operation to the queue and asynchronously trys a blocking `setNode` in the background. `setNode`s will only be added to the queue if the bucket was full.
    
    #322
    tegefaulkes committed Apr 8, 2022
    Configuration menu
    Copy the full SHA
    ad538bd View commit details
    Browse the repository at this point in the history
  18. feat: establishing a NodeConnection adds the node to the nodeGraph

    `NodeConnectionManager` now takes `NodeGraph` in  the `nodeConnectionManager.start` method. It has to be part of the start method since they are co-dependent. `NodeConnectionManager` cals `NodeManager.setNode()` when a connection is established. This fulfills the condition of adding a node to the graph during a forward connection.
    
    Fixed up tests that were failing in relation to the `NodeManager` `StartStop` conversion.
    
    #322
    tegefaulkes committed Apr 8, 2022
    Configuration menu
    Copy the full SHA
    4319b5d View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    91b10f4 View commit details
    Browse the repository at this point in the history

Commits on Apr 11, 2022

  1. feat: implemented NodeManager.refreshBucket()

    This method preforms the kademlia `refreshBucket` operation. It selects a random node within the bucket and preforms a search for that node. The process exchanges node information with any nodes it connects to.
    
    #345
    tegefaulkes committed Apr 11, 2022
    Configuration menu
    Copy the full SHA
    5bbcd9c View commit details
    Browse the repository at this point in the history
  2. feat: implemented no activity timers and queuing for refreshBucket

    Added queuing for `refreshBucket`. This means that buckets will be refreshed one at a time sequentially. This is to avoid doing a lot of costly refreshing all at once.
    
    Added no activity for buckets. If a bucket hasn't been touched for a while, 1 hour by default, it will add a refresh bucket operation to the queue. Timers are disabled for buckets already in the queue. Only 1 timer is used for all buckets since only one of them can have the shortest timer and that's all we really care about.
    
    #345
    tegefaulkes committed Apr 11, 2022
    Configuration menu
    Copy the full SHA
    c4af418 View commit details
    Browse the repository at this point in the history

Commits on Apr 12, 2022

  1. feat: refreshing buckets when entering network

    `nodeConnectionManager.syncNodeGraph` now refreshes all buckets above the closest node as per the kademlia spec. This means adding a lot of buckets to the refresh bucket queue when an agent is started.
    
    #345
    tegefaulkes committed Apr 12, 2022
    Configuration menu
    Copy the full SHA
    4123996 View commit details
    Browse the repository at this point in the history

Commits on Apr 14, 2022

  1. feat: abort controller support for NodeManager.refreshBucket

    Added support to cancel out of a `refreshBucket` operation. This is to allow faster stopping of the `NodeManager` by aborting out of a slow `refreshBucket` operation. This has been implemented with the `AbortController`/`AbortSignal` API. This is not fully supported by Node14 so we're using the `node-abort-controller` to provide functionality for now.
    
    #345
    tegefaulkes committed Apr 14, 2022
    Configuration menu
    Copy the full SHA
    5fd0b0b View commit details
    Browse the repository at this point in the history

Commits on Apr 19, 2022

  1. Configuration menu
    Copy the full SHA
    decbff8 View commit details
    Browse the repository at this point in the history

Commits on Apr 21, 2022

  1. feat: generic SetNodeQueue class for queuing setNode operations

    `NodeManager.setNode` and `NodeConnectionManager.syncNodeGraph` now utilise a single, shared queue to asynchronously add nodes to the node graph without blocking the main loop. These methods are both blocking by default but can be made non-blocking by setting the `block` parameter to false.
    #322
    emmacasolin committed Apr 21, 2022
    Configuration menu
    Copy the full SHA
    752be04 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d387848 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    91287ab View commit details
    Browse the repository at this point in the history

Commits on Apr 28, 2022

  1. refactor: cleaning up Queue

    Just a small refactor. I've renamed some methods since queueStart and queuePush is unnecessarily verbose when Queue is its own class now. Also simplified some logic using the `promise` utility.
    tegefaulkes committed Apr 28, 2022
    Configuration menu
    Copy the full SHA
    ea4f19d View commit details
    Browse the repository at this point in the history
  2. tests: general fixes for failing tests

    This contains fixes for failing tests as well as fixes for tests failing to exit when finished.
    tegefaulkes committed Apr 28, 2022
    Configuration menu
    Copy the full SHA
    bcce66e View commit details
    Browse the repository at this point in the history
  3. syntax: added @typescript-eslint/await-thenable linting rule

    This checks if we await things that are not promises. This is not a problem per se, but we generally don't want to await random things.
    tegefaulkes committed Apr 28, 2022
    Configuration menu
    Copy the full SHA
    7019b12 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    08beafc View commit details
    Browse the repository at this point in the history

Commits on Apr 29, 2022

  1. test: added test to check if nodes are properly added to the seed nod…

    …es when entering the network
    
    This tests for if the Seed node contains the new nodes when they are created. It also checks if the new nodes discover each other after being created.
    
    Includes a change to `findNode`. It will no longer throw an error when failing to find the node. This will have to be thrown by the caller now. This was required by `refreshBucket` since it's very likely that we can't find the random node it is looking for.
    tegefaulkes committed Apr 29, 2022
    Configuration menu
    Copy the full SHA
    6b75ad0 View commit details
    Browse the repository at this point in the history
  2. tests: Added agent service tests for nodesChainDataGet, `nodesClose…

    …stLocalNode` and `nodesHolePunchMessage`
    tegefaulkes committed Apr 29, 2022
    Configuration menu
    Copy the full SHA
    d2a310c View commit details
    Browse the repository at this point in the history