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

Kbucket refactoring for Content Routing #54

Merged
merged 5 commits into from
Feb 28, 2020
Merged

Kbucket refactoring for Content Routing #54

merged 5 commits into from
Feb 28, 2020

Conversation

aarshkshah1992
Copy link
Contributor

@aarshkshah1992 aarshkshah1992 commented Feb 27, 2020

@Stebalien

  1. Export the Option type so we can refer to in in the DHT.
  2. Fix interface conversion in RT.Print().
  3. Functions to get the number of peers for a Cpl/determine if a bucket is full.

@aarshkshah1992 aarshkshah1992 changed the title Export the Option type Kbucket refactoring for Content Routing Feb 27, 2020
Copy link
Member

@Stebalien Stebalien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge when ready.

options.go Outdated Show resolved Hide resolved
count := 0
b := rt.buckets[len(rt.buckets)-1]
for _, p := range b.peerIds() {
if CommonPrefixLen(rt.local, ConvertPeerID(p)) == int(cpl) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ouch. We should probably start storing these converted IDs. Sha256 is going to kill us.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Stebalien Great point. I never thought about the cost we pay every time we call this function. I've created an issue here:

libp2p/go-libp2p#812

table.go Show resolved Hide resolved
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

Successfully merging this pull request may close these issues.

2 participants