-
Notifications
You must be signed in to change notification settings - Fork 387
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
storagenode/contact: create chore for nodes to ping satellites #2877
Conversation
Make sure to update storj-sim and testplanet |
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.
This is great!
} | ||
|
||
// PingStats contains information regarding who and when the node was last pinged | ||
type PingStats struct { |
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 do we need to track when/who the node was last pinged?
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.
just for the node dashboard
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 believe the dashboard indicates the last time you were contacted to let you know you are still externally accessible
func (stats *PingStats) WhenLastPinged() (when time.Time, who storj.NodeID, addr string) { | ||
stats.mu.Lock() | ||
defer stats.mu.Unlock() | ||
return stats.lastPinged, stats.whoPingedNodeID, stats.whoPingedAddress |
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 looks like this method WhenLastPinged
isn't currently being used anywhere. Is there a use case for this method to be used in the future? Im just thinking that if the node restarts for any reason, pingStats will get reset and these fields will be empty. Not sure if that will affect anything
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 will be used by the dashboard to get the last contacted time. I'm also using it in the test
} | ||
} | ||
|
||
// Run the contact chore on a regular interval with jitter |
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.
not sure if we should expand on this comment a little bit and explain what is meant by jitter
What: Creates a chore for nodes to announce themselves to their trusted satellites. Runs on startup and every hour thereafter
Why: Kademlia Removal
Please describe the tests:
Please describe the performance impact:
Code Review Checklist (to be filled out by reviewer)