Skip to content
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

Force enqueue second forward event for phantom receives #2395

Merged
merged 1 commit into from
Jul 11, 2023

Conversation

wpaulino
Copy link
Contributor

@wpaulino wpaulino commented Jul 5, 2023

This was a regression resulting from f2453b7 since we now process events in a loop until there aren't any left. Phantom receives rely on two calls to ChannelManager::process_pending_htlc_forwards before emiting the PaymentClaimable event, providing better privacy to make them look "real" by taking more time.

Fixes #2378.

@wpaulino wpaulino added this to the 0.0.116 milestone Jul 5, 2023
@codecov-commenter
Copy link

codecov-commenter commented Jul 5, 2023

Codecov Report

Patch coverage: 96.66% and project coverage change: -0.01 ⚠️

Comparison is base (86fd9e7) 90.32% compared to head (4cb4918) 90.32%.

❗ Current head 4cb4918 differs from pull request most recent head 313af81. Consider uploading reports for the commit 313af81 to get more accurate results

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2395      +/-   ##
==========================================
- Coverage   90.32%   90.32%   -0.01%     
==========================================
  Files         106      106              
  Lines       54968    54979      +11     
  Branches    54968    54979      +11     
==========================================
+ Hits        49651    49659       +8     
- Misses       5317     5320       +3     
Impacted Files Coverage Δ
lightning/src/ln/functional_test_utils.rs 87.98% <91.66%> (+0.14%) ⬆️
lightning-invoice/src/utils.rs 97.49% <100.00%> (+<0.01%) ⬆️
lightning/src/ln/channelmanager.rs 86.26% <100.00%> (-0.01%) ⬇️

... and 4 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@tnull tnull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, interesting, good catch!

lightning/src/ln/channelmanager.rs Outdated Show resolved Hide resolved
@wpaulino wpaulino force-pushed the phantom-deduped-forward-event branch from 4cb4918 to 313af81 Compare July 6, 2023 18:12
tnull
tnull previously approved these changes Jul 7, 2023
Copy link
Contributor

@tnull tnull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

lightning/src/ln/functional_test_utils.rs Show resolved Hide resolved
Copy link
Contributor

@alecchendev alecchendev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM outside the remaining comments

lightning/src/ln/channelmanager.rs Outdated Show resolved Hide resolved
This was a regression resulting from f2453b7 since we now process events
in a loop until there aren't any left. Processing events is done in
batches and they are not removed until we're done processing each batch.
Since handling a `PendingHTLCsForwardable` event will call back into the
`ChannelManager`, we'll still see the original forwarding event not
removed. Phantom payments will need an additional forwarding event
before being claimed to make them look real by taking more time.
@wpaulino wpaulino force-pushed the phantom-deduped-forward-event branch from 89cf906 to 81722ca Compare July 10, 2023 16:49
@tnull tnull merged commit 31a0456 into lightningdevkit:main Jul 11, 2023
14 checks passed
@wpaulino wpaulino deleted the phantom-deduped-forward-event branch July 11, 2023 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PendingHTLCsForwardable Events generating during process_pending_htlc_forwards are deduped out
5 participants