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

Allow NodeManager to start lazily without network entry procedure #461

Open
tegefaulkes opened this issue Sep 29, 2022 · 5 comments
Open
Labels
development Standard development r&d:polykey:core activity 3 Peer to Peer Federated Hierarchy

Comments

@tegefaulkes
Copy link
Contributor

Specification

When starting the PolykeyAgent the NodeManager takes two steps to enter the network. When NodeManager is started it calls this.setupRefreshBucketTasks() and shortly after starting the PolykeyAgent calls this.nodeManager.syncNodeGraph. The fact that these two steps happen by default when starting a PolykeyAgent` can interfere with testing and adds a bunch of processing that doesn't need to be done.

We need to update this behaviour as specified in this comment #451 (comment).

Additional context

Tasks

  1. Add a lazy parameter to NodeManager.start that when true, skips the creation of refreshBucket tasks with setupRefreshBucketTasks and skips running syncNodeGraph.
  2. Add a method to NodeManager called startSync that combines the setupRefreshBucketTasks and syncNodeGraph operations
  3. rename syncNodeGraph to syncSeedNodes
  4. Have the PolykeyAgent creation and start optionally skip the startSync process based on a parameter.
  5. Update any PolykeyAgent usage in testing to skip the sync process where needed.
  6. Remove any mocking of refreshBucket to stub it out and replace it with usage of 5.
@tegefaulkes tegefaulkes added the development Standard development label Sep 29, 2022
@tegefaulkes tegefaulkes self-assigned this Sep 29, 2022
@CMCDragonkai CMCDragonkai added the r&d:polykey:core activity 3 Peer to Peer Federated Hierarchy label Jul 10, 2023
@CMCDragonkai
Copy link
Member

Would this be something we should do as part of 6th testnet deployment?

@tegefaulkes
Copy link
Contributor Author

Not strictly needed but is nice to have for testing and should be reasonably quick to implement.
I'll add it in.

@tegefaulkes tegefaulkes mentioned this issue Aug 14, 2023
11 tasks
@tegefaulkes
Copy link
Contributor Author

I think this is the case now. You can start the NodeManager and then need to call syncNodeGraph. I'd like to extend this to all background functionality in NodeGraph. So we can disable all background operations for tests. They tend to add a bunch of noise when testing and can interfere in some cases.

I'd also like to add a option PolykeyAgent to disable background tasks such as these.

@CMCDragonkai
Copy link
Member

I suggest we use the stealth mode #199 feature to side-step this problem. Essentially it would temporarily (togglable) disable all background network tasks (that includes social discovery, node discovery, mdns... etc) across the board, then we don't need to add special configuration just to disable certain things for testing.

@CMCDragonkai
Copy link
Member

To do such a thing, you can make use of the pattern used in the TaskManager with substart commands. Like startProcessing stopProcessing.

Any domain that has backgrounded network operations should have a substart/substop operations that can be called independently to switch its operating modes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development Standard development r&d:polykey:core activity 3 Peer to Peer Federated Hierarchy
Development

No branches or pull requests

2 participants