-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[autopilot] Trigger channel opening on external score update #3520
[autopilot] Trigger channel opening on external score update #3520
Conversation
a32705d
to
a2257f9
Compare
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.
Straight forward diff, only request is for an additional unit tests to exercise this new attachment trigger.
a2257f9
to
765b2ee
Compare
Unit test added. |
When appending to a slice, there is no guarantee the slice won't be modified. So instead of appending to the global slice availableHeuristics, we create a temporary local one.
This commit adds a new signal to the autopilot agent, meant to signal when any of the available heuristics has gotten an update. We currently use this to trigger a new channel opening after the external scores have been updated.
TestAgentHeuristicUpdateSignal tests that upon notification about a heuristic update, the agent reconsults the heuristic.
765b2ee
to
5a8ecfc
Compare
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.
LGTM 🚁
@@ -372,5 +379,11 @@ func (m *Manager) SetNodeScores(name string, scores map[NodeID]float64) error { | |||
return fmt.Errorf("heuristic with name %v not found", name) | |||
} | |||
|
|||
// If the autopilot agent is active, notify about the updated | |||
// heuristic. | |||
if m.pilot != nil { |
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.
m.IsActive()
here?
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.
LGTM 🦞
This PR adds a new signal to the autopilot agent, meant to signal
when any of the available heuristics has gotten an update.
We currently use this to trigger a new channel opening after the
external scores have been updated.