Skip to content

Payment Persistence Gap Matrix #966

Description

@joostjager

This issue tracks crash and replay boundaries between LDK's persisted state and ldk-node's app-level payment records. It focuses on Lightning payments from both the sending and receiving node perspectives.

LDK persists ChannelManager, ChannelMonitors, and replayable LDK events. ldk-node separately persists PaymentDetails in PaymentStore and user-facing events in EventQueue. Because these are independent persistence streams, a crash or store error can leave the two views temporarily or permanently out of sync unless the event handling path or startup logic reconciles them.

Current main basis: 73be359ec5e8cddfc2463b8ed04bf2de038cdcd1.

PR is populated only when a currently open PR was identified as closing the scenario. Empty means no PR was identified yet.

Outbound

ScenarioConsequencePRIssue
LDK accepts or starts an outbound BOLT11 payment before ldk-node durably writes a PendingPaymentStore record.The payment may be in flight or may later complete while absent from ldk-node payment APIs.#969
ldk-node has a Pending outbound payment record after restart, but LDK no longer has corresponding recent payment state.The payment may appear permanently pending, and local duplicate protection may block retry incorrectly.#969, #171
PaymentSent or PaymentFailed update returns NotFound.A success or failure event may be queued while the payment record stays missing. For success, this can also weaken duplicate-payment protection if no Succeeded record is reconstructed.#968

Inbound

ScenarioConsequencePRIssue
BOLT11 invoice is created, but ldk-node crashes before the payment record is durably written and the invoice is never paid.The invoice may remain payable but invisible to ldk-node.#425, #51
BOLT11 auto-claim payment record is missing when PaymentClaimable or PaymentClaimed is handled.Current main can claim or report the payment without backfilling durable payment history; #948 reconstructs the missing record from replayed LDK payment events.#948#298
Manual-claim BOLT11 pending registration is lost before its durable write.The HTLC may not be surfaced for manual claim.#425, #51, #280
BOLT12 or spontaneous inbound PaymentClaimable insert fails.Debug builds panic at debug_assert!(false); non-debug builds log but do not request LDK replay, so funds may be claimed without a durable payment record. #948 fixes this path.#948#298, #381
PaymentClaimed update returns NotFound.Current main logs and still queues PaymentReceived, so the app can see a received-payment event while payment history is missing. #948 reconstructs the missing record.#948#298
Repeated inbound payments share a payment hash, but ldk-node does not track the LDK event payment_id.Distinct receives can overwrite or confuse each other. #948 tracks the LDK payment ID.#948#298, #472
Missing inbound payment records are not eagerly reconciled from LDK state on startup.Missing records surface only if the relevant LDK events are replayed; there is no startup backfill pass.#298

Cross-Cutting

ScenarioConsequencePRIssue
Startup restores PaymentStore by listing persisted keys, so stores that return only one page of keys require pagination to load every payment record.Records beyond the first page can remain persisted but absent from the in-memory PaymentStore after startup.#960
User-facing events derived from replayed LDK events have no stable app-event ID, event fingerprint, or queue-level dedupe.ldk-node may deliver duplicate app events. Payment events carry useful identifiers for app-side dedupe, but duplicate delivery is still implicit API behavior rather than an enforced queue contract.#967

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Payment Persistence Gap Matrix · Issue #966 · lightningdevkit/ldk-node · GitHub
Skip to content

Payment Persistence Gap Matrix #966

Description

@joostjager

This issue tracks crash and replay boundaries between LDK's persisted state and ldk-node's app-level payment records. It focuses on Lightning payments from both the sending and receiving node perspectives.

LDK persists ChannelManager, ChannelMonitors, and replayable LDK events. ldk-node separately persists PaymentDetails in PaymentStore and user-facing events in EventQueue. Because these are independent persistence streams, a crash or store error can leave the two views temporarily or permanently out of sync unless the event handling path or startup logic reconciles them.

Current main basis: 73be359ec5e8cddfc2463b8ed04bf2de038cdcd1.

PR is populated only when a currently open PR was identified as closing the scenario. Empty means no PR was identified yet.

Outbound

ScenarioConsequencePRIssue
LDK accepts or starts an outbound BOLT11 payment before ldk-node durably writes a PendingPaymentStore record.The payment may be in flight or may later complete while absent from ldk-node payment APIs.#969
ldk-node has a Pending outbound payment record after restart, but LDK no longer has corresponding recent payment state.The payment may appear permanently pending, and local duplicate protection may block retry incorrectly.#969, #171
PaymentSent or PaymentFailed update returns NotFound.A success or failure event may be queued while the payment record stays missing. For success, this can also weaken duplicate-payment protection if no Succeeded record is reconstructed.#968

Inbound

ScenarioConsequencePRIssue
BOLT11 invoice is created, but ldk-node crashes before the payment record is durably written and the invoice is never paid.The invoice may remain payable but invisible to ldk-node.#425, #51
BOLT11 auto-claim payment record is missing when PaymentClaimable or PaymentClaimed is handled.Current main can claim or report the payment without backfilling durable payment history; #948 reconstructs the missing record from replayed LDK payment events.#948#298
Manual-claim BOLT11 pending registration is lost before its durable write.The HTLC may not be surfaced for manual claim.#425, #51, #280
BOLT12 or spontaneous inbound PaymentClaimable insert fails.Debug builds panic at debug_assert!(false); non-debug builds log but do not request LDK replay, so funds may be claimed without a durable payment record. #948 fixes this path.#948#298, #381
PaymentClaimed update returns NotFound.Current main logs and still queues PaymentReceived, so the app can see a received-payment event while payment history is missing. #948 reconstructs the missing record.#948#298
Repeated inbound payments share a payment hash, but ldk-node does not track the LDK event payment_id.Distinct receives can overwrite or confuse each other. #948 tracks the LDK payment ID.#948#298, #472
Missing inbound payment records are not eagerly reconciled from LDK state on startup.Missing records surface only if the relevant LDK events are replayed; there is no startup backfill pass.#298

Cross-Cutting

ScenarioConsequencePRIssue
Startup restores PaymentStore by listing persisted keys, so stores that return only one page of keys require pagination to load every payment record.Records beyond the first page can remain persisted but absent from the in-memory PaymentStore after startup.#960
User-facing events derived from replayed LDK events have no stable app-event ID, event fingerprint, or queue-level dedupe.ldk-node may deliver duplicate app events. Payment events carry useful identifiers for app-side dedupe, but duplicate delivery is still implicit API behavior rather than an enforced queue contract.#967

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Payment Persistence Gap Matrix · Issue #966 · lightningdevkit/ldk-node · GitHub
Skip to content

Payment Persistence Gap Matrix #966

Description

@joostjager

This issue tracks crash and replay boundaries between LDK's persisted state and ldk-node's app-level payment records. It focuses on Lightning payments from both the sending and receiving node perspectives.

LDK persists ChannelManager, ChannelMonitors, and replayable LDK events. ldk-node separately persists PaymentDetails in PaymentStore and user-facing events in EventQueue. Because these are independent persistence streams, a crash or store error can leave the two views temporarily or permanently out of sync unless the event handling path or startup logic reconciles them.

Current main basis: 73be359ec5e8cddfc2463b8ed04bf2de038cdcd1.

PR is populated only when a currently open PR was identified as closing the scenario. Empty means no PR was identified yet.

Outbound

ScenarioConsequencePRIssue
LDK accepts or starts an outbound BOLT11 payment before ldk-node durably writes a PendingPaymentStore record.The payment may be in flight or may later complete while absent from ldk-node payment APIs.#969
ldk-node has a Pending outbound payment record after restart, but LDK no longer has corresponding recent payment state.The payment may appear permanently pending, and local duplicate protection may block retry incorrectly.#969, #171
PaymentSent or PaymentFailed update returns NotFound.A success or failure event may be queued while the payment record stays missing. For success, this can also weaken duplicate-payment protection if no Succeeded record is reconstructed.#968

Inbound

ScenarioConsequencePRIssue
BOLT11 invoice is created, but ldk-node crashes before the payment record is durably written and the invoice is never paid.The invoice may remain payable but invisible to ldk-node.#425, #51
BOLT11 auto-claim payment record is missing when PaymentClaimable or PaymentClaimed is handled.Current main can claim or report the payment without backfilling durable payment history; #948 reconstructs the missing record from replayed LDK payment events.#948#298
Manual-claim BOLT11 pending registration is lost before its durable write.The HTLC may not be surfaced for manual claim.#425, #51, #280
BOLT12 or spontaneous inbound PaymentClaimable insert fails.Debug builds panic at debug_assert!(false); non-debug builds log but do not request LDK replay, so funds may be claimed without a durable payment record. #948 fixes this path.#948#298, #381
PaymentClaimed update returns NotFound.Current main logs and still queues PaymentReceived, so the app can see a received-payment event while payment history is missing. #948 reconstructs the missing record.#948#298
Repeated inbound payments share a payment hash, but ldk-node does not track the LDK event payment_id.Distinct receives can overwrite or confuse each other. #948 tracks the LDK payment ID.#948#298, #472
Missing inbound payment records are not eagerly reconciled from LDK state on startup.Missing records surface only if the relevant LDK events are replayed; there is no startup backfill pass.#298

Cross-Cutting

ScenarioConsequencePRIssue
Startup restores PaymentStore by listing persisted keys, so stores that return only one page of keys require pagination to load every payment record.Records beyond the first page can remain persisted but absent from the in-memory PaymentStore after startup.#960
User-facing events derived from replayed LDK events have no stable app-event ID, event fingerprint, or queue-level dedupe.ldk-node may deliver duplicate app events. Payment events carry useful identifiers for app-side dedupe, but duplicate delivery is still implicit API behavior rather than an enforced queue contract.#967

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Payment Persistence Gap Matrix · Issue #966 · lightningdevkit/ldk-node · GitHub
Skip to content

Payment Persistence Gap Matrix #966

Description

@joostjager

This issue tracks crash and replay boundaries between LDK's persisted state and ldk-node's app-level payment records. It focuses on Lightning payments from both the sending and receiving node perspectives.

LDK persists ChannelManager, ChannelMonitors, and replayable LDK events. ldk-node separately persists PaymentDetails in PaymentStore and user-facing events in EventQueue. Because these are independent persistence streams, a crash or store error can leave the two views temporarily or permanently out of sync unless the event handling path or startup logic reconciles them.

Current main basis: 73be359ec5e8cddfc2463b8ed04bf2de038cdcd1.

PR is populated only when a currently open PR was identified as closing the scenario. Empty means no PR was identified yet.

Outbound

ScenarioConsequencePRIssue
LDK accepts or starts an outbound BOLT11 payment before ldk-node durably writes a PendingPaymentStore record.The payment may be in flight or may later complete while absent from ldk-node payment APIs.#969
ldk-node has a Pending outbound payment record after restart, but LDK no longer has corresponding recent payment state.The payment may appear permanently pending, and local duplicate protection may block retry incorrectly.#969, #171
PaymentSent or PaymentFailed update returns NotFound.A success or failure event may be queued while the payment record stays missing. For success, this can also weaken duplicate-payment protection if no Succeeded record is reconstructed.#968

Inbound

ScenarioConsequencePRIssue
BOLT11 invoice is created, but ldk-node crashes before the payment record is durably written and the invoice is never paid.The invoice may remain payable but invisible to ldk-node.#425, #51
BOLT11 auto-claim payment record is missing when PaymentClaimable or PaymentClaimed is handled.Current main can claim or report the payment without backfilling durable payment history; #948 reconstructs the missing record from replayed LDK payment events.#948#298
Manual-claim BOLT11 pending registration is lost before its durable write.The HTLC may not be surfaced for manual claim.#425, #51, #280
BOLT12 or spontaneous inbound PaymentClaimable insert fails.Debug builds panic at debug_assert!(false); non-debug builds log but do not request LDK replay, so funds may be claimed without a durable payment record. #948 fixes this path.#948#298, #381
PaymentClaimed update returns NotFound.Current main logs and still queues PaymentReceived, so the app can see a received-payment event while payment history is missing. #948 reconstructs the missing record.#948#298
Repeated inbound payments share a payment hash, but ldk-node does not track the LDK event payment_id.Distinct receives can overwrite or confuse each other. #948 tracks the LDK payment ID.#948#298, #472
Missing inbound payment records are not eagerly reconciled from LDK state on startup.Missing records surface only if the relevant LDK events are replayed; there is no startup backfill pass.#298

Cross-Cutting

ScenarioConsequencePRIssue
Startup restores PaymentStore by listing persisted keys, so stores that return only one page of keys require pagination to load every payment record.Records beyond the first page can remain persisted but absent from the in-memory PaymentStore after startup.#960
User-facing events derived from replayed LDK events have no stable app-event ID, event fingerprint, or queue-level dedupe.ldk-node may deliver duplicate app events. Payment events carry useful identifiers for app-side dedupe, but duplicate delivery is still implicit API behavior rather than an enforced queue contract.#967

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' Payment Persistence Gap Matrix · Issue #966 · lightningdevkit/ldk-node · GitHub
Skip to content

Payment Persistence Gap Matrix #966

Description

@joostjager

This issue tracks crash and replay boundaries between LDK's persisted state and ldk-node's app-level payment records. It focuses on Lightning payments from both the sending and receiving node perspectives.

LDK persists ChannelManager, ChannelMonitors, and replayable LDK events. ldk-node separately persists PaymentDetails in PaymentStore and user-facing events in EventQueue. Because these are independent persistence streams, a crash or store error can leave the two views temporarily or permanently out of sync unless the event handling path or startup logic reconciles them.

Current main basis: 73be359ec5e8cddfc2463b8ed04bf2de038cdcd1.

PR is populated only when a currently open PR was identified as closing the scenario. Empty means no PR was identified yet.

Outbound

ScenarioConsequencePRIssue
LDK accepts or starts an outbound BOLT11 payment before ldk-node durably writes a PendingPaymentStore record.The payment may be in flight or may later complete while absent from ldk-node payment APIs.#969
ldk-node has a Pending outbound payment record after restart, but LDK no longer has corresponding recent payment state.The payment may appear permanently pending, and local duplicate protection may block retry incorrectly.#969, #171
PaymentSent or PaymentFailed update returns NotFound.A success or failure event may be queued while the payment record stays missing. For success, this can also weaken duplicate-payment protection if no Succeeded record is reconstructed.#968

Inbound

ScenarioConsequencePRIssue
BOLT11 invoice is created, but ldk-node crashes before the payment record is durably written and the invoice is never paid.The invoice may remain payable but invisible to ldk-node.#425, #51
BOLT11 auto-claim payment record is missing when PaymentClaimable or PaymentClaimed is handled.Current main can claim or report the payment without backfilling durable payment history; #948 reconstructs the missing record from replayed LDK payment events.#948#298
Manual-claim BOLT11 pending registration is lost before its durable write.The HTLC may not be surfaced for manual claim.#425, #51, #280
BOLT12 or spontaneous inbound PaymentClaimable insert fails.Debug builds panic at debug_assert!(false); non-debug builds log but do not request LDK replay, so funds may be claimed without a durable payment record. #948 fixes this path.#948#298, #381
PaymentClaimed update returns NotFound.Current main logs and still queues PaymentReceived, so the app can see a received-payment event while payment history is missing. #948 reconstructs the missing record.#948#298
Repeated inbound payments share a payment hash, but ldk-node does not track the LDK event payment_id.Distinct receives can overwrite or confuse each other. #948 tracks the LDK payment ID.#948#298, #472
Missing inbound payment records are not eagerly reconciled from LDK state on startup.Missing records surface only if the relevant LDK events are replayed; there is no startup backfill pass.#298

Cross-Cutting

ScenarioConsequencePRIssue
Startup restores PaymentStore by listing persisted keys, so stores that return only one page of keys require pagination to load every payment record.Records beyond the first page can remain persisted but absent from the in-memory PaymentStore after startup.#960
User-facing events derived from replayed LDK events have no stable app-event ID, event fingerprint, or queue-level dedupe.ldk-node may deliver duplicate app events. Payment events carry useful identifiers for app-side dedupe, but duplicate delivery is still implicit API behavior rather than an enforced queue contract.#967

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Payment Persistence Gap Matrix · Issue #966 · lightningdevkit/ldk-node · GitHub
Skip to content

Payment Persistence Gap Matrix #966

Description

@joostjager

This issue tracks crash and replay boundaries between LDK's persisted state and ldk-node's app-level payment records. It focuses on Lightning payments from both the sending and receiving node perspectives.

LDK persists ChannelManager, ChannelMonitors, and replayable LDK events. ldk-node separately persists PaymentDetails in PaymentStore and user-facing events in EventQueue. Because these are independent persistence streams, a crash or store error can leave the two views temporarily or permanently out of sync unless the event handling path or startup logic reconciles them.

Current main basis: 73be359ec5e8cddfc2463b8ed04bf2de038cdcd1.

PR is populated only when a currently open PR was identified as closing the scenario. Empty means no PR was identified yet.

Outbound

ScenarioConsequencePRIssue
LDK accepts or starts an outbound BOLT11 payment before ldk-node durably writes a PendingPaymentStore record.The payment may be in flight or may later complete while absent from ldk-node payment APIs.#969
ldk-node has a Pending outbound payment record after restart, but LDK no longer has corresponding recent payment state.The payment may appear permanently pending, and local duplicate protection may block retry incorrectly.#969, #171
PaymentSent or PaymentFailed update returns NotFound.A success or failure event may be queued while the payment record stays missing. For success, this can also weaken duplicate-payment protection if no Succeeded record is reconstructed.#968

Inbound

ScenarioConsequencePRIssue
BOLT11 invoice is created, but ldk-node crashes before the payment record is durably written and the invoice is never paid.The invoice may remain payable but invisible to ldk-node.#425, #51
BOLT11 auto-claim payment record is missing when PaymentClaimable or PaymentClaimed is handled.Current main can claim or report the payment without backfilling durable payment history; #948 reconstructs the missing record from replayed LDK payment events.#948#298
Manual-claim BOLT11 pending registration is lost before its durable write.The HTLC may not be surfaced for manual claim.#425, #51, #280
BOLT12 or spontaneous inbound PaymentClaimable insert fails.Debug builds panic at debug_assert!(false); non-debug builds log but do not request LDK replay, so funds may be claimed without a durable payment record. #948 fixes this path.#948#298, #381
PaymentClaimed update returns NotFound.Current main logs and still queues PaymentReceived, so the app can see a received-payment event while payment history is missing. #948 reconstructs the missing record.#948#298
Repeated inbound payments share a payment hash, but ldk-node does not track the LDK event payment_id.Distinct receives can overwrite or confuse each other. #948 tracks the LDK payment ID.#948#298, #472
Missing inbound payment records are not eagerly reconciled from LDK state on startup.Missing records surface only if the relevant LDK events are replayed; there is no startup backfill pass.#298

Cross-Cutting

ScenarioConsequencePRIssue
Startup restores PaymentStore by listing persisted keys, so stores that return only one page of keys require pagination to load every payment record.Records beyond the first page can remain persisted but absent from the in-memory PaymentStore after startup.#960
User-facing events derived from replayed LDK events have no stable app-event ID, event fingerprint, or queue-level dedupe.ldk-node may deliver duplicate app events. Payment events carry useful identifiers for app-side dedupe, but duplicate delivery is still implicit API behavior rather than an enforced queue contract.#967

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); Payment Persistence Gap Matrix · Issue #966 · lightningdevkit/ldk-node · GitHub
Skip to content

Payment Persistence Gap Matrix #966

Description

@joostjager

This issue tracks crash and replay boundaries between LDK's persisted state and ldk-node's app-level payment records. It focuses on Lightning payments from both the sending and receiving node perspectives.

LDK persists ChannelManager, ChannelMonitors, and replayable LDK events. ldk-node separately persists PaymentDetails in PaymentStore and user-facing events in EventQueue. Because these are independent persistence streams, a crash or store error can leave the two views temporarily or permanently out of sync unless the event handling path or startup logic reconciles them.

Current main basis: 73be359ec5e8cddfc2463b8ed04bf2de038cdcd1.

PR is populated only when a currently open PR was identified as closing the scenario. Empty means no PR was identified yet.

Outbound

ScenarioConsequencePRIssue
LDK accepts or starts an outbound BOLT11 payment before ldk-node durably writes a PendingPaymentStore record.The payment may be in flight or may later complete while absent from ldk-node payment APIs.#969
ldk-node has a Pending outbound payment record after restart, but LDK no longer has corresponding recent payment state.The payment may appear permanently pending, and local duplicate protection may block retry incorrectly.#969, #171
PaymentSent or PaymentFailed update returns NotFound.A success or failure event may be queued while the payment record stays missing. For success, this can also weaken duplicate-payment protection if no Succeeded record is reconstructed.#968

Inbound

ScenarioConsequencePRIssue
BOLT11 invoice is created, but ldk-node crashes before the payment record is durably written and the invoice is never paid.The invoice may remain payable but invisible to ldk-node.#425, #51
BOLT11 auto-claim payment record is missing when PaymentClaimable or PaymentClaimed is handled.Current main can claim or report the payment without backfilling durable payment history; #948 reconstructs the missing record from replayed LDK payment events.#948#298
Manual-claim BOLT11 pending registration is lost before its durable write.The HTLC may not be surfaced for manual claim.#425, #51, #280
BOLT12 or spontaneous inbound PaymentClaimable insert fails.Debug builds panic at debug_assert!(false); non-debug builds log but do not request LDK replay, so funds may be claimed without a durable payment record. #948 fixes this path.#948#298, #381
PaymentClaimed update returns NotFound.Current main logs and still queues PaymentReceived, so the app can see a received-payment event while payment history is missing. #948 reconstructs the missing record.#948#298
Repeated inbound payments share a payment hash, but ldk-node does not track the LDK event payment_id.Distinct receives can overwrite or confuse each other. #948 tracks the LDK payment ID.#948#298, #472
Missing inbound payment records are not eagerly reconciled from LDK state on startup.Missing records surface only if the relevant LDK events are replayed; there is no startup backfill pass.#298

Cross-Cutting

ScenarioConsequencePRIssue
Startup restores PaymentStore by listing persisted keys, so stores that return only one page of keys require pagination to load every payment record.Records beyond the first page can remain persisted but absent from the in-memory PaymentStore after startup.#960
User-facing events derived from replayed LDK events have no stable app-event ID, event fingerprint, or queue-level dedupe.ldk-node may deliver duplicate app events. Payment events carry useful identifiers for app-side dedupe, but duplicate delivery is still implicit API behavior rather than an enforced queue contract.#967

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions