-
Notifications
You must be signed in to change notification settings - Fork 405
Add anti-probing penalty to ProbabilisticScorer
#1555
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 anti-probing penalty to ProbabilisticScorer
#1555
Conversation
Currently figuring out how to make a test happen, therefore still in draft mode. |
Codecov Report
@@ Coverage Diff @@
## main #1555 +/- ##
==========================================
- Coverage 91.04% 91.03% -0.01%
==========================================
Files 80 80
Lines 44072 44101 +29
Branches 44072 44101 +29
==========================================
+ Hits 40125 40148 +23
- Misses 3947 3953 +6
Continue to review full report at Codecov.
|
846cd6b
to
d7a72a0
Compare
lightning/src/routing/scoring.rs
Outdated
|
||
let network_graph = self.network_graph.read_only(); | ||
let mut anti_probing_penalty_msat = 0; | ||
if let Some(chan) = network_graph.channels().get(&short_channel_id) { |
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.
We shouldn't do a lookup here, we should instead shove the relevant info into EffectiveCapacity
so we can read it via the usage
.
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.
Hmpf, I agree that the lookup (especially on every invocation) is unfortunate. I now went this way with d19827e, but I'm not really happy about breaking the so far pretty clean interface of EffectiveCapacity
. At lest we will soon be able to remove the Option<>
around htlc_maximum_msat
and probably Unknown
.
97bb6eb
to
f92934d
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.
Basically LGTM
Looks like this needs rebase after #1550. Feel free to squash when you do so. |
e348b09
to
9ddfdfe
Compare
Squashed and rebased. |
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.
Makes #1519 all the more important.
9ddfdfe
to
85b7a7f
Compare
Currently, channel balances may be rather easily discovered through probing. This however poses a privacy risk, since the analysis of balance changes over adjacent channels could in the worst case empower an adversary to mount an end-to-end deanonymization attack, i.e., track who payed whom. The penalty added here is applied so we prefer nodes with a smaller `htlc_maximum_msat`, which makes balance discovery attacks harder to execute. As this improves privacy network-wide, we treat such nodes preferentially and hence create an incentive to restrict `htlc_maximum_msat`.
85b7a7f
to
800ccec
Compare
Currently, channel balances may be rather easily discovered through probing. This however poses a privacy risk, since the analysis of balance changes over adjacent channels could in the worst case empower an adversary to mount an end-to-end deanonymization attack, i.e., track who payed whom.
The penalty added here is applied so we prefer nodes with a smaller
htlc_maximum_msat
, which makes balance discovery attacks harder to execute. As this improves privacy network-wide, we treat such nodes preferentially and hence create an incentive to restricthtlc_maximum_msat
.Closes #1515