Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions pkg/check/gsoc/gsoc.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ func run(ctx context.Context, uploadClient *bee.Client, listenClient *bee.Client
if err != nil {
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?

logger.Infof("gsoc: mining resource id for overlay=%s, depth=%d", addresses.Overlay, depth)
resourceId, socAddress, err := mineResourceId(ctx, addresses.Overlay, privKey, depth)
if err != nil {
return err
}
Expand Down Expand Up @@ -169,7 +171,7 @@ func run(ctx context.Context, uploadClient *bee.Client, listenClient *bee.Client
}

select {
case <-time.After(1 * time.Minute):
case <-time.After(3 * time.Minute):
return fmt.Errorf("timeout: not all messages received")
case <-done:
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/check/pss/pss.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func (c *Check) testPss(nodeAName, nodeBName string, clients map[string]*bee.Cli

for {
select {
case <-time.After(1 * time.Minute):
case <-time.After(3 * time.Minute):
return fmt.Errorf("correct message not received after %s", 1*time.Minute)
case msg, ok := <-ch:
if !ok {
Expand Down