Commit c066fc4d authored by David Vorick's avatar David Vorick

change interaction exponentiation

Previously the exponentiation was set to the 6th power, however there are a lot
of controls in place that prevent a bad host from being used frequently, which
means that it can take a long time for a bad host to lose enough score to be
pruned from the set of contracts.

The new exponentitaion of 15 ensures that hosts with consistently bad records
are pruned relatively quickly, even though they are not going to be used very
much.
parent 56313e39
......@@ -101,22 +101,17 @@ func (hdb *HostDB) interactionAdjustments(entry modules.HostDBEntry) float64 {
// interactions with them. The two failed interactions will become
// irrelevant after sufficient interactions with the host.
hsi := entry.HistoricSuccessfulInteractions + 30
hfi := entry.HistoricFailedInteractions + 2
hfi := entry.HistoricFailedInteractions + 1
// Determine the intraction ratio based off of the historic interactions.
ratio := float64(hsi) / float64(hsi+hfi)
// Raise the ratio to the 6th power and return that.
//
// 98% = 0.885
// 95% = 0.735
// 93% = 0.646 - this is roughly the penalty applied to fresh hosts
// 90% = 0.531
// 85% = 0.377
// 75% = 0.177
// 60% = 0.046
// 50% = 0.015
return math.Pow(ratio, 6)
// Raise the ratio to the 15th power and return that. The exponentiation is
// very high because the renter will already intentionally avoid hosts that
// do not have many successful interactions, meaning that the bad points do
// not rack up very quickly. We want to signal a bad score for the host
// nonetheless.
return math.Pow(ratio, 15)
}
// priceAdjustments will adjust the weight of the entry according to the prices
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment