') + ')', '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('^' + ".*" + ', '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" + ', '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('^' + ".*" + ', '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); } })(); })(); Note that abandon_payment does not persist the state update in docs by TheBlueMatt · Pull Request #1907 · lightningdevkit/rust-lightning · GitHub
Skip to content

Note that abandon_payment does not persist the state update in docs - #1907

Merged
TheBlueMatt merged 1 commit into
lightningdevkit:mainfrom
TheBlueMatt:2022-12-abandon-crash-reset
Dec 12, 2022
Merged

Note that abandon_payment does not persist the state update in docs#1907
TheBlueMatt merged 1 commit into
lightningdevkit:mainfrom
TheBlueMatt:2022-12-abandon-crash-reset

Conversation

@TheBlueMatt

Copy link
Copy Markdown
Collaborator

If a user calls abandon_payment, then restarts without freshly persisting the ChannelManager, the payment will still be pending on restart. This was unclear from the docs (and the docs seemed to imply otherwise). Because this doesn't materially impact the usability of abandon_payment (users shouldn't be called retry_payment on an abandoned one anyway), we simply document it.

Fixes#1804.

@TheBlueMattTheBlueMatt added this to the 0.0.113 milestone Dec 8, 2022
@codecov-commenter

codecov-commenter commented Dec 8, 2022

Copy link
Copy Markdown

Codecov Report

Base: 90.60% // Head: 91.00% // Increases project coverage by +0.39% 🎉

Coverage data is based on head (9792ca3) compared to base (d9d4611).
Patch coverage: 50.00% of modified lines in pull request are covered.

❗ Current head 9792ca3 differs from pull request most recent head 1969b48. Consider uploading reports for the commit 1969b48 to get more accurate results

Additional details and impacted files
@@ Coverage Diff @@## main #1907 +/- ##
==========================================
+ Coverage 90.60% 91.00% +0.39% 
==========================================
Files 91 94 +3 Lines 48656 51856 +3200 Branches 48656 51856 +3200 ==========================================
+ Hits 44087 47191 +3104 - Misses 4569 4665 +96 
Impacted FilesCoverage Δ
lightning/src/ln/channelmanager.rs89.89% <50.00%> (+3.20%)⬆️
lightning/src/ln/functional_tests.rs96.96% <0.00%> (-0.18%)⬇️
lightning/src/offers/payer.rs33.33% <0.00%> (ø)
lightning/src/offers/invoice_request.rs95.00% <0.00%> (ø)
lightning/src/offers/merkle.rs100.00% <0.00%> (ø)
lightning/src/ln/features.rs99.77% <0.00%> (+0.09%)⬆️
lightning/src/chain/onchaintx.rs93.77% <0.00%> (+0.82%)⬆️
lightning/src/offers/parse.rs94.87% <0.00%> (+1.39%)⬆️
lightning/src/util/ser.rs93.38% <0.00%> (+1.44%)⬆️
lightning/src/offers/offer.rs94.68% <0.00%> (+2.90%)⬆️
... and 1 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

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

Comment threadlightning/src/ln/channelmanager.rs Outdated
Comment threadlightning/src/ln/channelmanager.rs Outdated
Comment threadlightning/src/ln/channelmanager.rs Outdated
Comment threadlightning/src/ln/channelmanager.rs Outdated
@tnull

tnull commented Dec 9, 2022

Copy link
Copy Markdown
Contributor

LGTM, feel free to squash.

Comment threadlightning/src/ln/channelmanager.rs
Comment threadlightning/src/ln/channelmanager.rs Outdated
Comment threadlightning/src/ln/channelmanager.rs Outdated
Comment threadpending_changelog/matt-abandon-restart.txt
@dunxen

Copy link
Copy Markdown
Contributor

Looks good for squash from my side.

If a user calls `abandon_payment`, then restarts without freshly
persisting the `ChannelManager`, the payment will still be pending
on restart. This was unclear from the docs (and the docs seemed to
imply otherwise). Because this doesn't materially impact the
usability of `abandon_payment` (users shouldn't be called
`retry_payment` on an abandoned one anyway), we simply document it.
Fixeslightningdevkit#1804.
@TheBlueMatt
TheBlueMattforce-pushed the 2022-12-abandon-crash-reset branch from 9792ca3 to 1969b48CompareDecember 12, 2022 19:59
@TheBlueMatt

Copy link
Copy Markdown
CollaboratorAuthor

Squashed without further changes, diff from the other day is:

$ git diff-tree -U1 cf63c49 1969b48b7
diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs
index 0aa89b5dc..29304cadb 100644
--- a/lightning/src/ln/channelmanager.rs+++ b/lightning/src/ln/channelmanager.rs@@ -2764,3 +2764,3 @@ impl<M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelManager<M, T, K, F
/// After this method returns, no future calls to [`retry_payment`] for the given `payment_id`
-	/// are allowed. If no such event has been generated, an [`Event::PaymentFailed`] event will be+	/// are allowed. If no [`Event::PaymentFailed`] event had been generated before, one will be
/// generated as soon as there are no remaining pending HTLCs for this payment.

@TheBlueMatt
TheBlueMatt merged commit b291f4a into lightningdevkit:mainDec 12, 2022
Sign up for freeto 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.

Crash Safety of abandon_payment/PaymentFailed

5 participants

@TheBlueMatt@codecov-commenter@tnull@dunxen@wpaulino