-
Notifications
You must be signed in to change notification settings - Fork 7
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
Replacement buckets #26
base: main
Are you sure you want to change the base?
Conversation
…ement() to check for bucket size
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think the checkAndReplaceLast() of the Kbucket should do the following:
- get the last node of the bucket
- check if is alive
- if it is alive move the node to the front of the bucket (do the same in the routing table of the remote node checked in the bucket for the local node)
- if it is dead remove the node from the bucket and pull a random node from the replacement list.
I dont think the function is currently doing this, since it is creating a random id and getting the node from it (probably will fail because the node does not exist), not getting a node from the bucket.
Moreover, i think the obtention of the Node instance from the id should be reconsidered, creating a new empty protocol instance will not work. The issue is that it is necessary to have a protocol id to get the kademliaprotocol instance.
In the previous version we did a hack to get the kademliaprotocol from any Node intsance, however its probably not the best solution because it may be nodes that do not have the protocol.
…t, updated its constructor and KBucket declarations in RoutingTable
I think this still will not work because you are creating a KademliaProtocol instance out of nowhere, you need to get it from an existing node. For that youll probably need to move the nodeIdtoNode function out of the Kademliaprotocol because you need it to get the Node instance from the nodeId. |
9a3b9a9
to
4016a04
Compare
Bumps [json](https://github.com/douglascrockford/JSON-java) from 20200518 to 20230227. - [Release notes](https://github.com/douglascrockford/JSON-java/releases) - [Changelog](https://github.com/stleary/JSON-java/blob/master/docs/RELEASES.md) - [Commits](https://github.com/douglascrockford/JSON-java/commits) --- updated-dependencies: - dependency-name: org.json:json dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
No description provided.