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

Implement node radius as a function of the size of the content DB #76

Open
acolytec3 opened this issue Jan 12, 2022 · 2 comments
Open

Comments

@acolytec3
Copy link
Collaborator

Node radius indicates to other nodes what content our node is interest in or already stores based on the distance between the contentId for a given piece of content and our Node ID where the distance is the distance function for the given subnetwork (generally the XOR distance metric except for the State Network). Our node radius is currently set to 1 and advertised that way to all other nodes on the network via the PING/PONG messages and would basically indicate we are interested in storing no data in a real world environment.

We need to fix this by allowing the portalnetwork module to be initiated with some size limit on the DB (say 500 MB) and then have the client internally adjust its node radius based on this in the following way:

  • Node radius is initially set to infinity (or 2^256 really since this is the largest possible distance generated by XOR)
  • Once the DB fills up to within say 10% of maximum capacity (or maybe 1% of capacity), the radius of the node should be set at the largest distance for any content held locally
  • This radius should be adjusted any time we try to add a new piece of content to the DB
@acolytec3
Copy link
Collaborator Author

I've adjusted our default node radius to be 2^256 in #126 as a starting point here so will be curious to see how important this becomes as we spin up larger networks.

@acolytec3
Copy link
Collaborator Author

Now that we can measure the size of the DB via #275, we should pick this back up and use it whenever we're adding content to the DB.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant