-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add probe state machine #111
Conversation
See also iand/zikade#3 |
routing/probe.go
Outdated
Clock: clock.New(), // use standard time | ||
Concurrency: 3, | ||
Timeout: time.Minute, | ||
CheckInterval: 6 * time.Hour, |
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.
Clock: clock.New(), // use standard time | |
Concurrency: 3, | |
Timeout: time.Minute, | |
CheckInterval: 6 * time.Hour, | |
Clock: clock.New(), // use standard time | |
Concurrency: 3, // MAGIC | |
Timeout: time.Minute, // MAGIC | |
CheckInterval: 6 * time.Hour, // MAGIC |
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.
Jorropo suggested this to mark values we pulled out of thin air
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.
Done
routing/probe.go
Outdated
func (u unaddressedNodeInfo[K, A]) ID() kad.NodeID[K] { return u.NodeID } | ||
func (u unaddressedNodeInfo[K, A]) Addresses() []A { return nil } | ||
|
||
// ProbeState is the state of a probe. |
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.
// ProbeState is the state of a probe. | |
// ProbeState is the state of the [Probe] state machine. |
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.
Done
cfg.CheckInterval = -1 | ||
require.Error(t, cfg.Validate()) | ||
}) | ||
} |
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.
nit, all the above require
could be assert
's
|
||
nv2 := &nodeValue[key.Key8]{ | ||
NodeID: kadtest.NewID(key.Key8(4)), | ||
NextCheckDue: clk.Now().Add(-time.Minute), |
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.
Might be worth enforcing that even if nv2.NextCheckDue
is after nv1.NextCheckDue
the value will be replaced. So that we're not clever in that regard.
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.
Done
This adds the initial state machine for running regular connectivity checks against nodes in the routing table. Scoring of useful nodes is not included and is to be added in a later change.
Part of #45