routing+routerrpc: remove probability estimates from mc state snapshot

Probability estimates are amount dependent. Previously we assumed an
amount, but that starts to make less sense when we make probability more
dependent on amounts in the future.
This commit is contained in:
Joost Jager
2019-09-27 11:19:30 +02:00
parent 559d3c0910
commit fab13900e2
6 changed files with 119 additions and 303 deletions

View File

@@ -118,28 +118,11 @@ type timedPairResult struct {
// MissionControlSnapshot contains a snapshot of the current state of mission
// control.
type MissionControlSnapshot struct {
// Nodes contains the per node information of this snapshot.
Nodes []MissionControlNodeSnapshot
// Pairs is a list of channels for which specific information is
// logged.
Pairs []MissionControlPairSnapshot
}
// MissionControlNodeSnapshot contains a snapshot of the current node state in
// mission control.
type MissionControlNodeSnapshot struct {
// Node pubkey.
Node route.Vertex
// LastFail is the time of last failure.
LastFail time.Time
// OtherSuccessProb is the success probability for pairs not in
// the Pairs slice.
OtherSuccessProb float64
}
// MissionControlPairSnapshot contains a snapshot of the current node pair
// state in mission control.
type MissionControlPairSnapshot struct {
@@ -153,9 +136,6 @@ type MissionControlPairSnapshot struct {
// penalized.
MinPenalizeAmt lnwire.MilliSatoshi
// SuccessProb is the success probability estimation for this channel.
SuccessProb float64
// LastAttemptSuccessful indicates whether the last payment attempt
// through this pair was successful.
LastAttemptSuccessful bool
@@ -386,26 +366,10 @@ func (m *MissionControl) GetHistorySnapshot() *MissionControlSnapshot {
"node_failure_count=%v, pair_result_count=%v",
len(m.lastNodeFailure), len(m.lastPairResult))
nodes := make([]MissionControlNodeSnapshot, 0, len(m.lastNodeFailure))
for v, h := range m.lastNodeFailure {
otherProb := m.getPairProbability(v, route.Vertex{}, 0)
nodes = append(nodes, MissionControlNodeSnapshot{
Node: v,
LastFail: h,
OtherSuccessProb: otherProb,
})
}
pairs := make([]MissionControlPairSnapshot, 0, len(m.lastPairResult))
for fromNode, fromPairs := range m.lastPairResult {
for toNode, result := range fromPairs {
// Show probability assuming amount meets min
// penalization amount.
prob := m.getPairProbability(
fromNode, toNode, result.minPenalizeAmt,
)
pair := NewDirectedNodePair(fromNode, toNode)
@@ -413,7 +377,6 @@ func (m *MissionControl) GetHistorySnapshot() *MissionControlSnapshot {
Pair: pair,
MinPenalizeAmt: result.minPenalizeAmt,
Timestamp: result.timestamp,
SuccessProb: prob,
LastAttemptSuccessful: result.success,
}
@@ -422,7 +385,6 @@ func (m *MissionControl) GetHistorySnapshot() *MissionControlSnapshot {
}
snapshot := MissionControlSnapshot{
Nodes: nodes,
Pairs: pairs,
}