Skip to content

Sea orm integration#3

Closed
dcorral wants to merge 19 commits into
mainfrom
sea-orm-integration
Closed

Sea orm integration#3
dcorral wants to merge 19 commits into
mainfrom
sea-orm-integration

Conversation

@dcorral
Copy link
Copy Markdown

@dcorral dcorral commented Jan 15, 2026

No description provided.

txalkan and others added 18 commits December 17, 2025 12:53
Reordered settle/cancel to avoid deleting claimables before we know the LDK
action succeeded. In invoice_settle, call claim_funds first and return an error
if LDK rejects it; only then best-effort remove the claimable entry. In
invoice_cancel, fetch the claimable without removing it, attempt
fail_htlc_backwards, return an error if that fails, and only then clean up the
claimable.

This prevents losing the ability to retry/cancel when LDK rejects the call.
Add mark_claimable_settling() to atomically mark claimable HTLCs as "settling" before calling claim_funds(), preventing the background expiry task from racing to fail_htlc_backwards on the same payment hash.
settle_twice_succeeds: if the invoice is already settled, settling will succeed;
cancel_then_settle_fails: cancel first, settle must fail;
settle_then_cancel_fails: settle first, cancel must fail;
expire_hodl_invoice: short-expiry path; settle/cancel fail after expiry;
expire_hodl_invoice_by_blocks: block-driven expiry; settle/cancel fail after;
reject_wrong_preimage_settle: good preimage still suceeds.
Make invoice_settle() idempotent by first checking whether the payment has already succeeded before marking the claimable as settling. This enables safe retries after the claimable entry has been cleaned up by the PaymentClaimed event.
Apply formatting and modify gh action to apply formatting in all push/pr
@dcorral dcorral changed the base branch from feat_hodl_invoice to main January 15, 2026 13:10
@txalkan
Copy link
Copy Markdown
Member

txalkan commented Jan 15, 2026

Hey! This is how I see the timeline right now:

  1. thunder-swap client for submarine swaps POC - it needs some last updates to RLN, @bandrivskiy working on deploying the new instance.
  2. Merge Support HODL Invoices #2 and send PR to RGB-Tools.
  3. Once Support HODL Invoices #2 is merged, pull it into Sea orm integration #3 and finalize this PR. Then, send this feature's PR to RGB-Tools.

Let me know if this ordering works @gofman8

@dcorral dcorral closed this Jan 15, 2026
@dcorral
Copy link
Copy Markdown
Author

dcorral commented Jan 15, 2026

Closed in favor of #4 which has a clean history

@dcorral dcorral deleted the sea-orm-integration branch January 15, 2026 14:48
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.

3 participants