-
Notifications
You must be signed in to change notification settings - Fork 371
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
Increase scoring params #3483
Increase scoring params #3483
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -488,7 +488,7 @@ where L::Target: Logger { | |||||
pub struct ProbabilisticScoringFeeParameters { | ||||||
/// A fixed penalty in msats to apply to each channel. | ||||||
/// | ||||||
/// Default value: 500 msat | ||||||
/// Default value: 1000 msat | ||||||
pub base_penalty_msat: u64, | ||||||
|
||||||
/// A multiplier used with the payment amount to calculate a fixed penalty applied to each | ||||||
|
@@ -500,7 +500,7 @@ pub struct ProbabilisticScoringFeeParameters { | |||||
/// | ||||||
/// ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30` | ||||||
/// | ||||||
/// Default value: 8,192 msat | ||||||
/// Default value: 1,000,000 msat | ||||||
/// | ||||||
/// [`base_penalty_msat`]: Self::base_penalty_msat | ||||||
pub base_penalty_amount_multiplier_msat: u64, | ||||||
|
@@ -518,7 +518,7 @@ pub struct ProbabilisticScoringFeeParameters { | |||||
/// | ||||||
/// `-log10(success_probability) * liquidity_penalty_multiplier_msat` | ||||||
/// | ||||||
/// Default value: 30,000 msat | ||||||
/// Default value: 450,000 msat | ||||||
/// | ||||||
/// [`liquidity_offset_half_life`]: ProbabilisticScoringDecayParameters::liquidity_offset_half_life | ||||||
pub liquidity_penalty_multiplier_msat: u64, | ||||||
|
@@ -540,7 +540,7 @@ pub struct ProbabilisticScoringFeeParameters { | |||||
/// probabilities, the multiplier will have a decreasing effect as the negative `log10` will | ||||||
/// fall below `1`. | ||||||
/// | ||||||
/// Default value: 192 msat | ||||||
/// Default value: 2880 msat | ||||||
pub liquidity_penalty_amount_multiplier_msat: u64, | ||||||
|
||||||
/// A multiplier used in conjunction with the negative `log10` of the channel's success | ||||||
|
@@ -554,7 +554,7 @@ pub struct ProbabilisticScoringFeeParameters { | |||||
/// track which of several buckets those bounds fall into, exponentially decaying the | ||||||
/// probability of each bucket as new samples are added. | ||||||
/// | ||||||
/// Default value: 10,000 msat | ||||||
/// Default value: 150,000 msat | ||||||
/// | ||||||
/// [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat | ||||||
pub historical_liquidity_penalty_multiplier_msat: u64, | ||||||
|
@@ -575,7 +575,7 @@ pub struct ProbabilisticScoringFeeParameters { | |||||
/// channel, we track which of several buckets those bounds fall into, exponentially decaying | ||||||
/// the probability of each bucket as new samples are added. | ||||||
/// | ||||||
/// Default value: 64 msat | ||||||
/// Default value: 960 msat | ||||||
/// | ||||||
/// [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat | ||||||
pub historical_liquidity_penalty_amount_multiplier_msat: u64, | ||||||
|
@@ -642,15 +642,15 @@ pub struct ProbabilisticScoringFeeParameters { | |||||
impl Default for ProbabilisticScoringFeeParameters { | ||||||
fn default() -> Self { | ||||||
Self { | ||||||
base_penalty_msat: 500, | ||||||
base_penalty_amount_multiplier_msat: 8192, | ||||||
liquidity_penalty_multiplier_msat: 30_000, | ||||||
liquidity_penalty_amount_multiplier_msat: 192, | ||||||
base_penalty_msat: 1000, | ||||||
base_penalty_amount_multiplier_msat: 1_000_000, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a bit hefty
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 8192 * 100 ~= 1_000_000 if you squint hard enough :) See the commit message for the reasoning - would I pay an extra 0.1% of current total flow over a channel for better routing ? yes. |
||||||
liquidity_penalty_multiplier_msat: 450_000, | ||||||
liquidity_penalty_amount_multiplier_msat: 2880, | ||||||
manual_node_penalties: new_hash_map(), | ||||||
anti_probing_penalty_msat: 250, | ||||||
considered_impossible_penalty_msat: 1_0000_0000_000, | ||||||
historical_liquidity_penalty_multiplier_msat: 10_000, | ||||||
historical_liquidity_penalty_amount_multiplier_msat: 64, | ||||||
historical_liquidity_penalty_multiplier_msat: 150_000, | ||||||
historical_liquidity_penalty_amount_multiplier_msat: 960, | ||||||
linear_success_probability: false, | ||||||
} | ||||||
} | ||||||
|
@@ -3012,47 +3012,47 @@ mod tests { | |||||
info, | ||||||
short_channel_id: 42, | ||||||
}); | ||||||
assert_eq!(scorer.channel_penalty_msat(&candidate, usage, ¶ms), 11497); | ||||||
assert_eq!(scorer.channel_penalty_msat(&candidate, usage, ¶ms), 247695); | ||||||
let usage = ChannelUsage { | ||||||
effective_capacity: EffectiveCapacity::Total { capacity_msat: 1_950_000_000, htlc_maximum_msat: 1_000 }, ..usage | ||||||
}; | ||||||
assert_eq!(scorer.channel_penalty_msat(&candidate, usage, ¶ms), 7408); | ||||||
assert_eq!(scorer.channel_penalty_msat(&candidate, usage, ¶ms), 186364); | ||||||
let usage = ChannelUsage { | ||||||
effective_capacity: EffectiveCapacity::Total { capacity_msat: 2_950_000_000, htlc_maximum_msat: 1_000 }, ..usage | ||||||
}; | ||||||
assert_eq!(scorer.channel_penalty_msat(&candidate, usage, ¶ms), 6151); | ||||||
assert_eq!(scorer.channel_penalty_msat(&candidate, usage, ¶ms), 167493); | ||||||
let usage = ChannelUsage { | ||||||
effective_capacity: EffectiveCapacity::Total { capacity_msat: 3_950_000_000, htlc_maximum_msat: 1_000 }, ..usage | ||||||
}; | ||||||
assert_eq!(scorer.channel_penalty_msat(&candidate, usage, ¶ms), 5427); | ||||||
assert_eq!(scorer.channel_penalty_msat(&candidate, usage, ¶ms), 156641); | ||||||
let usage = ChannelUsage { | ||||||
effective_capacity: EffectiveCapacity::Total { capacity_msat: 4_950_000_000, htlc_maximum_msat: 1_000 }, ..usage | ||||||
}; | ||||||
assert_eq!(scorer.channel_penalty_msat(&candidate, usage, ¶ms), 4955); | ||||||
assert_eq!(scorer.channel_penalty_msat(&candidate, usage, ¶ms), 149565); | ||||||
let usage = ChannelUsage { | ||||||
effective_capacity: EffectiveCapacity::Total { capacity_msat: 5_950_000_000, htlc_maximum_msat: 1_000 }, ..usage | ||||||
}; | ||||||
assert_eq!(scorer.channel_penalty_msat(&candidate, usage, ¶ms), 4736); | ||||||
assert_eq!(scorer.channel_penalty_msat(&candidate, usage, ¶ms), 146262); | ||||||
let usage = ChannelUsage { | ||||||
effective_capacity: EffectiveCapacity::Total { capacity_msat: 6_950_000_000, htlc_maximum_msat: 1_000 }, ..usage | ||||||
}; | ||||||
assert_eq!(scorer.channel_penalty_msat(&candidate, usage, ¶ms), 4484); | ||||||
assert_eq!(scorer.channel_penalty_msat(&candidate, usage, ¶ms), 142487); | ||||||
let usage = ChannelUsage { | ||||||
effective_capacity: EffectiveCapacity::Total { capacity_msat: 7_450_000_000, htlc_maximum_msat: 1_000 }, ..usage | ||||||
}; | ||||||
assert_eq!(scorer.channel_penalty_msat(&candidate, usage, ¶ms), 4484); | ||||||
assert_eq!(scorer.channel_penalty_msat(&candidate, usage, ¶ms), 142487); | ||||||
let usage = ChannelUsage { | ||||||
effective_capacity: EffectiveCapacity::Total { capacity_msat: 7_950_000_000, htlc_maximum_msat: 1_000 }, ..usage | ||||||
}; | ||||||
assert_eq!(scorer.channel_penalty_msat(&candidate, usage, ¶ms), 4263); | ||||||
assert_eq!(scorer.channel_penalty_msat(&candidate, usage, ¶ms), 139185); | ||||||
let usage = ChannelUsage { | ||||||
effective_capacity: EffectiveCapacity::Total { capacity_msat: 8_950_000_000, htlc_maximum_msat: 1_000 }, ..usage | ||||||
}; | ||||||
assert_eq!(scorer.channel_penalty_msat(&candidate, usage, ¶ms), 4263); | ||||||
assert_eq!(scorer.channel_penalty_msat(&candidate, usage, ¶ms), 139185); | ||||||
let usage = ChannelUsage { | ||||||
effective_capacity: EffectiveCapacity::Total { capacity_msat: 9_950_000_000, htlc_maximum_msat: 1_000 }, ..usage | ||||||
}; | ||||||
assert_eq!(scorer.channel_penalty_msat(&candidate, usage, ¶ms), 4044); | ||||||
assert_eq!(scorer.channel_penalty_msat(&candidate, usage, ¶ms), 135883); | ||||||
} | ||||||
|
||||||
#[test] | ||||||
|
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.
@TheBlueMatt
Should we use this opportunity to define constants for each parameter?
This could simplify documentation maintenance and allow us to define constants cleanly using multiplier syntax.
Something like:
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.
Ben showed the operands to show how much mutiny deviated from the defaults - I think we should set a single number for the default settings.