-
Notifications
You must be signed in to change notification settings - Fork 32
fix: gsoc listner node selection #467
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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.
Uh oh!
There was an error while loading. Please reload this page.
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.
Why depth of 6?
Can you change the var name to describe why this depth, or to add comment?
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.
maybe the depth should be configurable, so we can 1 for the CI, and and a different value for the testnet?
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.
for depth, maybe commitment depth can be used from the /status endpoint?
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 can be retrieved from here
Uh oh!
There was an error while loading. Please reload this page.
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.
Depth here is the number matching prefix between the mined soc address and the nodes overlay. Not the committed depth or storage depth
It increases the likelihood that the listener node is the one selected for push.
Say you have a target listener node
n1=cad272543ccb97a829694b6686ad8d9950a33a4a0a30e07c73c00b537bca39bfThen you mine a soc for that target node with
depth=1and obtainsoc_addr=c19aa88ebd6853ef048a7503d9d9b5241db7a3583865ea54b8d9e61598a16fa9.The chunk could be pushed out instead to another node (having the same depth as the soc)
n2=c8fe3459d51267f1d1fbc7b3d7542845d6c5c865027ce5ab1cebd56a13c2ec6e.So the test will fail.
Increasing the depth gives us more guarantee that our listener will be selected.
e.g with depth=6,
when the target node is
n1=cad272543ccb97a829694b6686ad8d9950a33a4a0a30e07c73c00b537bca39bfmined soc will be
soc_addr=cad272....It's also unlikely that there's another node with that prefix. So our target node will be selected for push.
In nugeons original integration tests, he used 11
https://github.com/anythread/gsoc/blob/master/test/index.spec.ts#L24
11 takes a long time to mine and 6 seems to be sweet spot between testnet and CI.
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.
Can you change the var name for beter description, something like:
prefixMatchDepth, or anything that describes it better?