generated from ipfs/ipfs-repository-template
-
Notifications
You must be signed in to change notification settings - Fork 4
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
routing: Add triert package with Xor Trie backed routing table #50
+2,262
−147
Merged
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
77203e1
routing: Add triert package with Xor Trie backed routing table
iand 7480743
go mod tidy
iand c3ea4a4
Remove unused package
iand b1c73aa
Fix comment
iand f8be3dc
Remove unused bucket size arg from New
iand e3df916
Update comment
iand 9edf486
Remove use of Hex in keyNodes map
iand c323ac3
Remove unused import
iand e01bef1
Remove context from closestAtDepth
iand f3338f8
Simplify NearestPeers
iand afc7f65
Fix CplSize
iand 9b99b49
Add trie implementation
iand e882e36
Add trie implementation
iand 535956b
Tidy up trie package
iand bfba04d
Improve trie test coverage
iand 29e5c75
go mod tidy
iand ba30518
Add BenchmarkBuildTable
iand ff09661
Add mutable Add/Remove to trie
iand f7ef0ca
Add benchmarks for key/trie
iand cc37031
Add benchmarks for routing/triert
iand 5b7a773
Add churn benchmark
iand e70e4ee
Convert trie README to doc.go
iand b5a1c51
Remove concurrent support
iand e92cc80
Fix build on older versions of Go
iand ce88d3b
Fix build on older versions of Go again
iand e262f29
Fix method signature of ReportTimePerItemMetric on pre 1.20 versions …
iand 608229b
Add key filters
iand 08b8669
Fix lint issues
iand 29a8ef1
Panic if BitAt index out of range
iand 5e3f1c9
Move merge keyutil package into testutil
iand 0b284ff
Check input length of RandomWithPrefix
iand 23f01c1
Random key generation uses bitlength instead of byte length
iand File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Remove context from closestAtDepth
commit e01bef18f7cdf95849cb5d510d8324f312edce34
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
What will this function be used for? I can only find usages in tests (I checked this repo + the go-libp2p-kad-dht/kbucket repos)
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.
It could be used to verify if a peer is already in the routing table or not, e.g in the context of libp2p/go-libp2p-kad-dht#811 where we send a kademlia request to the remote peer before adding it to the routing table.
In go-libp2p-kbucket this logic is implemented in https://github.com/libp2p/go-libp2p-kbucket/blob/6d85d4e63aa3b8e04b9b55e1de64be8a52532f21/table.go#L119. So there is no use case now (except testing), but it may be useful in the future.
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.
It's used in tests and potentially in other diagnostics / consistency checking. It's not part of the Table interface.
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.
If it's possible we could un-export it.
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 don't see the need to unexport it. It's a useful function for code that want to directly query the table