Skip to content

chore: update breez sdk to 0.28.3 - #1893

Merged
ovitrif merged 1 commit into
masterfrom
chore/breez-sdk-0.28.3
Nov 12, 2026
Merged

ovitrif merged 1 commit into
masterfrom
chore/breez-sdk-0.28.3

Conversation

@ovitrif

@ovitrif ovitrif commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator

Description

  • Bumps breez-sdk-spark from 0.28.2 to 0.28.3. From 0.28.2 it brings:
    • breez/spark-sdk#1315: fetch_lightning_send_status, which asks the Spark operators whether this wallet sent an invoice over Lightning, without the local payment list.
    • breez/spark-sdk#1309: swaps use version 2 adaptor signing. No app code changes for it.
    • breez/spark-sdk#1307: extra token metadata, which Bitkit doesn't use. The rest is docs and CLI samples.
  • The restore hold from fix: stop a restored wallet paying a spark-paid invoice again #1858 now asks the operators. After a restore, Spark's list can lack a send it made before the restore, so both rails refused every still-valid invoice dated before the restore that Spark hadn't listed, until it expired. Now, for such an invoice, both rails call fetch_lightning_send_status before paying:
    • Completed, pending or failed counts as sent, and the payment is refused as before.
    • No send lets it pay, unless the send prefers Spark (regtest only) and the invoice carries a Spark address.
    • Any error, or Spark not connected, refuses it.
  • The two refusals that waited for Spark's first sync after a restore are gone. Both restore paths set that marker together with the restore time, so the hold above already covers those invoices, and kept, they would refuse invoices the operators show unsent. sparkHistoryUnseededSince stays for seeding the kept send hashes.

Breez docs caveat: fetch_lightning_send_status sees only Lightning sends. A payment the SDK made as a direct Spark transfer to the invoice's Spark address isn't found, which is why "no send" pays only when that can't have happened. A Spark-preferring send pays that address by transfer, and Bitkit prefers Spark only on regtest, so on mainnet "no send" always pays.

Design

N/A — no UI changes.

Preview

N/A

QA Notes

Automated Checks

  • SparkRepoTest, each case on both rails (the node's earlierLightningSend and Spark's payInvoice) for a valid invoice dated before the restore:
    • completed, pending and failed are refused, and Spark never sends;
    • no send with Spark not preferred pays;
    • no send with Spark preferred and no Spark address pays;
    • no send with Spark preferred and a Spark address is refused;
    • a status that can't be fetched is refused.
  • SparkServiceTest: only spark-sdk's Spark-address short channel id counts as a Spark address hint.
  • By default the fake's status fetch fails, so a test that sets no answer is refused rather than paid.
  • Detekt, lint and the unit tests pass locally.

@ovitrif ovitrif self-assigned this Nov 12, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T16:29:32.210843Z 56d5781 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[High impact] The PR appears safe to merge; no actionable issues were found.

Summary

Updates breez-sdk-spark from 0.28.2 to 0.28.3 and asks Spark’s operators before allowing an older invoice after a restore.

  • Restored wallets check missing invoice sends with Spark operators.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Older invoice after restore] --> B{Local history shows paid or pending?}
    B -->|Yes| C[Keep existing paid or pending result]
    B -->|No| D{Operators report no Lightning send?}
    D -->|Send found, error, or disconnected| E[Refuse payment]
    D -->|No send| F{Spark preferred and address present?}
    F -->|Yes or address check fails| E
    F -->|No| G[Continue through final send checks]
Loading

Reviews (1) · Last reviewed commit: "chore: breez sdk 0.28.3" · Reviewed by Greptile

@ovitrif ovitrif added this to the 3.2.0 milestone Nov 12, 2026
@ovitrif

ovitrif commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator Author

Milestone 3.2.0: this PR moves the Spark integration to Breez SDK 0.28.3, which adds fetch_lightning_send_status and moves swaps to v2 FROST adaptor signing, both needed for the 3.2.0 Spark release. It closes no issue, so the milestone sits on this PR.

@github-actions

Copy link
Copy Markdown
Contributor

Regtest APK

Built from 56d5781 (run).

Download bitkit-dev-debug universal APK (expires in 30 days).

@talosmachina talosmachina left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No findings. Bumps breez-sdk-spark to 0.28.3 and lets the restore hold pay a pre-restore invoice once the Spark operators show no Lightning send of it and it cannot have gone out as a direct Spark transfer. Reviewed 56d5781, full tier, static: per this repo's track rules an automated review does not build the branch, so this is reasoned from the code, the SDK source and CI.

What I checked, and 5 candidates I ruled out

Read in full: the diff of SparkRepo.kt, SparkService.kt, CacheStore.kt, BackupRepo.kt, SparkRepoTest.kt, SparkServiceTest.kt; LightningRepo.payInvoice around the holdsRestoredInvoices() call.
SDK source checked (breez/spark-sdk at tag 0.28.3): fetch_lightning_send_status in crates/breez-sdk/core/src/sdk/payments/lightning_send_status.rs, the Spark address extraction in crates/spark/src/services/lightning.rs, prepare/bolt11.rs.
CI: build-and-test, lint, detekt, build-local, compose-ui green; the e2e shards were still running when this was written.

Ruled out

  • Spark address hint constant: SPARK_ADDRESS_HINT_SCID (17592187092992000001) equals RECEIVER_IDENTITY_PUBLIC_KEY_SHORT_CHANNEL_ID, and the SDK finds the address the same way, by any route hint hop carrying that scid, so carriesSparkAddress agrees with what a Spark-preferring send pays.
  • "No send" read too loosely: the SDK returns None only for an empty preimage request list, an unknown request status is an error, and any returned request is Failed, which isUnsentPerOperators refuses. Every failure path (error, not connected, unparseable invoice) returns false and refuses.
  • Dropping the unseeded refusal leaves a gap: both restore paths in BackupRepo (lines 1086 and 1251 at this head) set sparkHistoryUnseededSince and sparkRestoredAt in the same update, so any invoice the removed check refused is still caught by refuseUnverifiedRestoredInvoice, now with the operators' answer. holdsRestoredInvoices() narrowing to sparkRestoredAt therefore still decodes the invoice whenever the hold applies.
  • Upgraded installs carrying only the old marker: both markers came in on unreleased commits (no tag contains them), so no shipped install holds sparkHistoryUnseededSince without sparkRestoredAt.
  • A default that pays: the test fake's status fetch throws unless a test sets an answer, so a case that forgets to stub it is refused, and the new cases cover completed, pending, failed, no send with and without a Spark address or preference, and an unreachable operator on both rails.

Merge confidence: 4/5, no findings and unit CI green, but the e2e shards had not finished and the branch was not built here.

Reviewer model: Claude Opus 5.5
Reasoning effort: Not exposed (the run metadata available to this reviewer does not carry it)

@coreyphillips coreyphillips left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Two independent reviews, nothing blocking a merge.

worth doing, does not block

  • Operators' FAILED status still locks a pre-restore invoice out until it expires (app/src/main/java/to/bitkit/repositories/SparkRepo.kt:1480-1483)

nits

  • seedRestoredSendHashes KDoc still describes the removed holds (app/src/main/java/to/bitkit/repositories/SparkRepo.kt:1569-1572). The KDoc says seeding "ends only the wait for Spark's first listing" and that "an older invoice Spark hasn't listed stays refused until it expires". This PR removed the wait for the first listing, and that invoice now pays when the operators show it unsent. The CacheStore and BackupRepo comments were updated, but this one was missed.
  • New log line does not start with a verb (app/src/main/java/to/bitkit/repositories/SparkRepo.kt:1481)

@ovitrif

ovitrif commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator Author

Merging: CI is green, @coreyphillips approved this head and every thread is answered. The non-blocking points go in follow-up PRs: #1896 (a FAILED operator status no longer locks out a pre-restore invoice) and #1895 (overlapping Spark sends of one invoice).

@ovitrif
ovitrif merged commit df7f224 into master Nov 12, 2026
24 checks passed
@ovitrif
ovitrif deleted the chore/breez-sdk-0.28.3 branch November 12, 2026 17:05
@ovitrif

ovitrif commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator Author

@coreyphillips the stale seedRestoredSendHashes KDoc goes in the same follow-up PR as the FAILED and log-line points (#1896).

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