Skip to content

fix: gsoc listner node selection#467

Merged
acha-bill merged 3 commits intomasterfrom
fix/gsoc-pushsync-1
Mar 4, 2025
Merged

fix: gsoc listner node selection#467
acha-bill merged 3 commits intomasterfrom
fix/gsoc-pushsync-1

Conversation

@acha-bill
Copy link
Contributor

Increase the depth for mining the soc addresses so that the listener node is picked more accurately when pushing out the chunk on the uploader.

Also increases the timeout to receive all messages.

@acha-bill acha-bill requested a review from gacevicljubisa March 3, 2025 12:31
@acha-bill acha-bill requested a review from istae March 3, 2025 13:48
return err
}
resourceId, socAddress, err := mineResourceId(ctx, addresses.Overlay, privKey, 1)
depth := 6
Copy link
Member

@gacevicljubisa gacevicljubisa Mar 3, 2025

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?

Copy link
Contributor

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?

Copy link
Contributor

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?

Copy link
Member

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

Copy link
Contributor Author

@acha-bill acha-bill Mar 3, 2025

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=cad272543ccb97a829694b6686ad8d9950a33a4a0a30e07c73c00b537bca39bf
Then you mine a soc for that target node with depth=1 and obtain
soc_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=cad272543ccb97a829694b6686ad8d9950a33a4a0a30e07c73c00b537bca39bf
mined 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.

Copy link
Member

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?

@acha-bill acha-bill merged commit 2c6e7b5 into master Mar 4, 2025
3 checks passed
@acha-bill acha-bill deleted the fix/gsoc-pushsync-1 branch March 4, 2025 20:03
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.

4 participants