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

Indicate the current index when waiting to reach tip for check:construction #370

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rllola
Copy link

@rllola rllola commented Oct 13, 2022

Motivation

When trying to run check:construction I was constantly getting the waiting for implementation to reach tip before testing... message but couldn't tell if any progress was made. After a while I stopped it thinking I was stuck in a loop when I was just syncing super slowly.

Solution

Add the current index and tip delay info to the message which show how we are progressing.

see

2022/10/13 10:17:53 waiting for implementation to reach tip before testing... (current index: 12590068, tip delay: 50000)
[MEMORY] Heap: 1103.031822MB Stack: 0.656250MB System: 1160.784706MB GCs: 6
2022/10/13 10:18:03 waiting for implementation to reach tip before testing... (current index: 12590100, tip delay: 50000)
[MEMORY] Heap: 1103.045753MB Stack: 0.656250MB System: 1160.784706MB GCs: 6
2022/10/13 10:18:13 waiting for implementation to reach tip before testing... (current index: 12590139, tip delay: 50000)
[MEMORY] Heap: 1103.075333MB Stack: 0.656250MB System: 1160.784706MB GCs: 6

}

if atTip {
return blockIdentifier.Index, nil
return blockIdentifier.Index, 0, nil
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this line be return blockIdentifier.Index, blockIdentifier.Index, nil? If the chain is at tip, I think it makes more sense the current index == tip index instead of current index == 0

Copy link
Author

Choose a reason for hiding this comment

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

Yeah that work too.

@@ -402,7 +402,7 @@ func (t *ConstructionTester) waitForTip(ctx context.Context) (int64, error) {
return tipIndex, nil
}

log.Println("waiting for implementation to reach tip before testing...")
log.Printf("waiting for implementation to reach tip before testing... (current index: %d, tip delay: %d)\n", currentIndex, t.config.TipDelay)
Copy link
Contributor

Choose a reason for hiding this comment

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

I am thinking if we want to show the current sync status and progress, other than tip delay probably we can also add current block timestamp so that we know how far are we from the tip

Copy link
Author

Choose a reason for hiding this comment

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

If I am not mistaken BlockIdentifier only has the hash and the index. We don't have the timestamp info to show, do we ?

@GeekArthur
Copy link
Contributor

GeekArthur commented Oct 14, 2022

I think this indication is useful for check:construction, @rllola can you address the comments (should be quick) then I can create new releases for coinbase/mesh-sdk-go#449 to include this indication?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants