Skip to content

chore: remove the Boltz savings swap - #1562

Merged
ovitrif merged 1 commit into
masterfrom
chore/remove-boltz-swap
Nov 30, 2026
Merged

ovitrif merged 1 commit into
masterfrom
chore/remove-boltz-swap

Conversation

@coreyphillips

@coreyphillips coreyphillips commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1561
Twin: synonymdev/bitkit-android#2214

Unblocks the bitkit-core 0.8.0-rc16 bump (synonymdev/bitkit-core#230), which drops the Boltz API. bitkit-core stays on rc15 here.

Description

  • Removes the Boltz savings swap from feat: add boltz savings swap #632: BoltzService, the swap path in TransferViewModel, SavingsConfirmView and SavingsProgressView, the swap updates stream in WalletViewModel and its wipe step, SwapsListView, the Dev Settings toggle and Env.isSwapSupported.
  • Drops the 7 swap only strings from every Localizable.strings.

Out of Scope

  • Deleting an existing boltz.db or the stale savingsSwapEnabled default. Nothing reads them.

Design

N/A: no user-facing change. The swap was a mainnet Dev Settings option, and transfer to savings closes the channel as it did with the toggle off.

Preview

N/A

QA Notes

Setup

A debug build of this branch with a channel open.

Journeys

N/A: no journey changes.

Manual Tests

  • 1. Transfer to savings → confirm → swipe: the channel closes, as on master with the toggle off.
  • 2. Dev Settings has no Swaps section.

Automated Checks

  • removed SavingsSwapTests.swift, FakeSwapUpdatesStream.swift and the swap stream cases in WalletViewModelWipeTests.swift
  • moved the two payment failure message tests to PaymentFailureMessageTests.swift

Evidence

  • f50eda7, iPhone 17 simulator: SwiftFormat lint and validate-translations.js pass; unit tests pass (4,814 run, 0 failures).

Gaps

  • Manual tests not run.

bitkit-core 0.8.0-rc16 drops its Boltz module. Transfer to savings now only closes channels.
@greptile-apps

greptile-apps Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Confidence Score: 4/5 · Preserve recovery for existing unfinished swaps before merging.RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The changes affect savings transfers and the developer swap tools, but not other wallet workflows.

Preserve recovery for existing unfinished swaps before merging.

Summary

Removes the Boltz savings-swap feature while leaving bitkit-core on its current version.

  • Savings transfers now use Spark withdrawals and channel closes instead of Boltz swaps.
  • Developer swap tools and background swap tracking are gone.
  • Payment-failure tests move out of swap tests, and a key comment names the core API.

coreyphillips explicitly left deletion of boltz.db and the unused savingsSwapEnabled default out of scope because nothing reads them. Neither cleanup omission is reported.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Confirm transfer to Savings] --> B{Spark selected?}
  B -->|Yes| C[Recheck withdrawal fee]
  C --> D[Commit selected funds]
  B -->|No| D
  D --> E[Withdraw selected Spark balance]
  E --> F[Close selected channels]
  F --> G{Result}
  G --> H[Success]
  G --> I[Spark failure]
  G --> J[Retry failed channel closes]
Loading

Reviews (1) · Last reviewed commit: "chore: remove the Boltz savings swap" · Reviewed by Greptile

@greptile-apps

greptile-apps Bot commented Nov 30, 2026

Copy link
Copy Markdown

Comments Outside Diff

These findings could not be posted inline.

  • P1 Unfinished swaps lose recovery Bitkit/Services/BoltzService.swift:172 ▶

    If someone upgrades with an unfinished swap started through Dev Settings, deleting BoltzService removes both automatic claim retries and the manual “Claim now” action. A swap left before its claim broadcasts can no longer finish in the app.

    This also affects .invoiceSettled swaps without claimTxId: the existing recovery code documents that the Lightning payment can settle before the on-chain claim broadcasts. Keep a recovery-only path for existing swaps, or resolve pending swaps before removing it.

@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. Removes the Boltz savings swap (quote, slider, swap execution, updates stream, wipe step, Dev Settings entry and Swaps screens), leaving transfer to savings on the channel-close path it already took with the toggle off. Reviewed f50eda7, full tier, statically: iOS does not build on Linux, so CI is the gate.

What I checked, and 5 candidates I ruled out

Read in full: the diff of TransferViewModel.swift, WalletViewModel.swift, SavingsConfirmView.swift, SavingsProgressView.swift, DevSettingsView.swift, MainNavView.swift, NavigationViewModel.swift, AppScene.swift, Env.swift, the test changes
Dangling references at the head: none for BoltzService, BoltzSwap, BoltzPairInfo, SwapUpdatesStreaming, SwapsListView, AmountSlider, SavingsTransferMode, SavingsSwapState; the project uses synchronized groups, so the deleted files need no project.pbxproj edit
CI: SwiftFormat and translation validate green; Run Tests, Run Integration Tests and build-local still running at the time of review

Ruled out

  • A swap in flight when a user upgrades: the reverse swap's preimage stays on the device, so without the claim Boltz cannot settle the hold invoice; the lockup times out and the HTLC fails back. Funds are held until the timeout, not lost, and only a mainnet build with the Dev Settings toggle on could have one.
  • Strings still in use: none of the 7 removed keys is referenced from Swift; lightning__savings_confirm__amount_too_low, still used by SavingsConfirmView, is kept.
  • Wipe ordering: stopForWipe now goes straight to stopNodeLocked(clearEventCallback: true), which keeps its node-still-running guard; the swap-stream timeout it drops guarded only the stream.
  • SavingsProgressView losing the wallet environment object: runChannelClose and the Spark failure path do not read it.
  • Lost coverage of the Spark fee pin: the "close instead" tests are renamed onto the plain commit (testCommitWaitsForTheSparkFee, testCommitWithdrawsSparkAtTheFeeShown...) with the same assertions; the payment-failure message cases moved to PaymentFailureMessageTests.swift and PaymentFailureReason.userMessage is still used by SendFailure.

Merge confidence: 4/5, no findings, but the unit and integration jobs had not finished on f50eda7 when this was written.

Reviewer model: claude-opus-5-5
Reasoning effort: not exposed (the review runner does not report it)

@coreyphillips

Copy link
Copy Markdown
Contributor Author

Not changing

  • @greptile-apps[bot]: A recovery path can't outlive the change this PR exists to unblock. It would call boltzStartSwapUpdates and boltzClaimReverseSwap, and bitkit-core 0.8.0-rc16 removes both, so any code kept here would be deleted by the bump. The exposure was also already this narrow on master: the swap only ran on mainnet behind a hidden Dev Settings toggle, and the auto-claim stream was gated on that same toggle (swapUpdatesStream.isSwapEnabled in ensureSwapUpdatesRunning), so turning it off had the same effect. Anyone who used the toggle should settle their swaps on v3.2.0 before upgrading. That is a release step, not a code change.

@ovi-reviewer ovi-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: ✅ Approve

Review: full diff, 33 files.

Findings: None.

QA for f50eda7:

Tested on an iPhone 17 Pro simulator, iOS 27.0, using a fresh Debug build and local regtest funds.

Transfer a channel balance to savings ✅ Confirming and swiping closes the channel and shows success.

Manual case 1: transferred a 500,000 sat channel balance through confirmation and swipe. The app showed “Funds moved to savings”; the peer's channel list independently confirmed that no open channel remained.

transfer-savings-2x.2x.mp4


Dev Settings has no Swaps section ✅ No swap section, navigation row or toggle remains.

Manual case 2: scrolled Dev Settings from top to bottom. There was no Swaps section, Swaps row or Enable Savings Swap toggle.

dev-settings-2x.2x.mp4


Both requested manual cases were driven. Spark withdrawals, wallet stop/wipe and the payment-message test changes were reviewed in code; no device case exercised those paths.

Pair PR: synonymdev/bitkit-android#2214 matches the removal and retains the same channel-close and Spark-withdrawal behavior.

Related report: earlier static review.


Reviewed by gpt-6.1-sol-high

@ovitrif ovitrif left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

utAck

@ovitrif

ovitrif commented Nov 30, 2026

Copy link
Copy Markdown
Collaborator

@coreyphillips Merged, as it was approved and green.

@ovitrif
ovitrif merged commit 69c32aa into master Nov 30, 2026
23 checks passed
@ovitrif
ovitrif deleted the chore/remove-boltz-swap branch November 30, 2026 23:28
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.

chore: remove the Boltz savings swap

3 participants