Skip to content

Expose probe status in recent payments#4603

Merged
TheBlueMatt merged 1 commit intolightningdevkit:mainfrom
tnull:2026-05-expose-probe-recent-payments
May 8, 2026
Merged

Expose probe status in recent payments#4603
TheBlueMatt merged 1 commit intolightningdevkit:mainfrom
tnull:2026-05-expose-probe-recent-payments

Conversation

@tnull
Copy link
Copy Markdown
Contributor

@tnull tnull commented May 7, 2026

Previously, ChannelManager::list_recent_payments didn't give us the means to discern 'real' payments from inflight probes. In lightningdevkit/ldk-node#815 we found that we need a way to re-derive which probes are still pending so our accounting of inflight probing amounts is still correct after restart.

To this end, we here let callers distinguish liquidity probes while they are pending or abandoned.

Co-Authored-By: HAL 9000

Previously, `ChannelManager::list_recent_payments` didn't give us the
means to discern 'real' payments from inflight probes. In
lightningdevkit/ldk-node#815 we found that we
need a way to re-derive which probes are still pending so our accounting
of inflight probing amounts is still correct after restart.

To this end, we here let callers distinguish liquidity probes while they
are pending or abandoned.

Co-Authored-By: HAL 9000

Co-Authored-By: HAL 9000
Signed-off-by: Elias Rohrer <dev@tnull.de>
@ldk-reviews-bot
Copy link
Copy Markdown

ldk-reviews-bot commented May 7, 2026

I've assigned @tankyleo as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

@ldk-claude-review-bot
Copy link
Copy Markdown
Collaborator

I've reviewed every file and hunk in this diff thoroughly. Here's my assessment:

The import change (removing #[cfg(test)] from use crate::ln::outbound_payment;) is correct and necessary since outbound_payment::payment_is_probe is now called from non-test code in list_recent_payments().

The payment_is_probe function (pub(super)) is correctly accessible from channelmanager.rs, takes the right parameters (&PaymentHash, &PaymentId, [u8; 32]), and the call sites pass the correct arguments.

The Fulfilled variant intentionally does not get is_probe — probes use fabricated payment hashes that will never be claimed, so they cannot enter the Fulfilled state. This is correct.

Existing consumers of RecentPaymentDetails::Pending and RecentPaymentDetails::Abandoned (fuzz target in chanmon_consistency.rs, the expect_recent_payment! macro in offers_tests.rs) all use .. in their patterns, so they are unaffected by the new field.

Test coverage checks both is_probe: true (for probes in both Pending and Abandoned states) and is_probe: false (in test_trivial_inflight_htlc_tracking via structural equality).

Serialization: probing_cookie_secret is persisted (field 11, serialized as required, deserialized as option with fallback to new random bytes), so is_probe works correctly across restarts for any node that has previously serialized this secret.

No issues found.

@ldk-reviews-bot ldk-reviews-bot requested a review from tankyleo May 7, 2026 13:27
@codecov
Copy link
Copy Markdown

codecov Bot commented May 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.12%. Comparing base (1d36f7b) to head (419908d).
⚠️ Report is 33 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4603      +/-   ##
==========================================
- Coverage   86.16%   86.12%   -0.05%     
==========================================
  Files         156      157       +1     
  Lines      108669   108812     +143     
  Branches   108669   108812     +143     
==========================================
+ Hits        93638    93715      +77     
- Misses      12420    12484      +64     
- Partials     2611     2613       +2     
Flag Coverage Δ
tests 86.12% <100.00%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@TheBlueMatt TheBlueMatt merged commit dc78922 into lightningdevkit:main May 8, 2026
22 of 24 checks passed
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.

4 participants