Skip to content

Test Spark Lightning sends and on-chain deposits - #319

Merged
piotr-iohk merged 11 commits into
mainfrom
codex/spark-send-deposit
Nov 24, 2026
Merged

piotr-iohk merged 11 commits into
mainfrom
codex/spark-send-deposit

Conversation

@piotr-iohk

@piotr-iohk piotr-iohk commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • @spark_2 sends a Lightning payment from a fresh Spark wallet. It verifies settlement at the fixture’s Lightning node and reconciles the outgoing activity, fee, and wallet balances.
  • @spark_3 follows one Spark deposit from the mempool to confirmation. It verifies the credit against the displayed claim fee and checks that the balance and single history entry persist after relaunch.
  • Both local nightly workflows use the shared launcher, which now runs the entire Spark spec.

The shared fixture in #317 and the Android nightly have merged. The iOS nightly has also merged. Both scheduled workflows now use the launcher on E2E main.

Local validation

  • At 1f4fcb1, all three Spark cases passed on an iPhone 17 simulator running iOS 27.2, Xcode 27.2, and XCUITest 12.20.0. The run used the cached ARM64 simulator app from iOS run 44713976121 and the pinned bitkit-docker fixture at a73f84c.
  • The Android 13 emulator passed all three cases at 2f82c25. The iOS 26.0 simulator passed at 1de58ca.
  • TypeScript, ESLint, Prettier, shell syntax, the fixture helper checks, the delayed wallet reminder checks, and all 32 shared Python tests passed.

Android nightly validation

The November 24 nightly received the payment, then failed to read the detailed Spark balance on all three attempts. The fixed transfer buttons clipped the amount while the balance row was already visible. Failed run

Commit 1f4fcb1 checks the visibility of the amount and scrolls it into view before asserting the value. The hosted Linux nightly checked out this exact commit and ran all three Spark cases against Android master at 69931fb9. All three passed on the first attempt in 5m 11s. Passing Android run

At be1fd44, the hosted Android nightly again passed all three Spark cases on the first attempt. With two confirmed deposits on a local Android 13 emulator, the history assertion correctly failed with Expected: 1, Received: 2. The same wallet had passed the one-deposit check before and after relaunch. Final Android run · Review fix and evidence

Base automatically changed from codex/spark-receive to main November 23, 2026 08:51
@piotr-iohk
piotr-iohk marked this pull request as ready for review November 24, 2026 07:56

@talosmachina talosmachina 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.

No findings. Adds @spark_2 (Lightning send from Spark, settlement checked at the fixture's LDK node, fee and balances reconciled) and @spark_3 (on-chain deposit from mempool to confirmation, claim fee read from the UI, balance and single history row checked again after relaunch), plus the local-backend verbs they need, and makes the launcher run the whole Spark spec. Reviewed 1f4fcb1, full tier.

What I checked, and 6 candidates I ruled out

Read in full: test/specs/spark.e2e.ts, the spark-* cases of scripts/local-backend, scripts/run-spark-e2e.sh; against the pinned bitkit-docker@a73f84c: spark (send, tx, invoice, api), spark-regtest/scripts/fund.sh, lib.sh, miner.sh, spark-regtest/compose.yml.
Helpers traced: ciIt, waitForWalletHomeCondition, tryDismissQuickPayIntroIfVisible, enterAmount, getAmountUnder, launchFreshApp, getClipboardPlaintext.
Build: skipped: talos-pr-run could not confirm the author's permission on this repo and fails closed, so this review is static. The PR has no checks on this repo; the evidence is the linked nightly runs.

Ruled out

  • spark-fund txid parse: fund.sh logs [fund] sent <sats> to <addr> in <txid> as its last line and -m 0 skips the mine, so ([a-f0-9]{64})$ matches and the tx is still unconfirmed for the mempool assertion.
  • Mempool state racing a block: the pinned miner defaults to SPARK_BLOCK_INTERVAL_SECONDS=0, mining only on request once the stack is ready, so in the mempool holds until spark-mine.
  • did not answer retry never matching: execFile rejects with stderr in the message, and the pinned api() writes exactly that text when esplora has not indexed the tx yet.
  • spark-tx output shape: spark tx prints the transaction object, then one compact line per outspend; jq -s '.[0]' keeps the transaction only.
  • Expected 6 sat send fee: 2 sats + 4,000 ppm of 1,000 sats is 6, and funding exactly 1,006 sidesteps the provider's missing leaf swap, as the comment says.
  • beforeEach with ciIt skips: a skipped ciIt does not run the hook, and the launcher unsets CI, so every attempt reinstalls and runs all three cases.

Merge confidence: 4/5, no findings, but nothing was built or run here and the repo runs no CI on the PR.

@piotr-iohk

Copy link
Copy Markdown
Collaborator Author

@ovi-reviewer review

@piotr-iohk
piotr-iohk requested review from a team, jvsena42 and ovitrif and removed request for a team November 24, 2026 08:38

@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

Findings:

  • LOW test/specs/spark.e2e.ts:121 The Android deposit-history assertion can miss a duplicate below the fold, including after relaunch. Count entries across the full deposit list.

QA for 1f4fcb1:

The Android nightly dispatch ran the full Spark spec at this commit. The iOS cases ran on iOS 27.0 with XCUITest 12.20.0 and a simulator-only Electrum port override for the isolated fixture. iOS app at c52c593

Receive Lightning into Spark on Android ✅ The nightly verified the 10,000-sat credit in activity, Spending and Spark.
Send Lightning from Spark on Android ✅ The nightly verified settlement of 1,000 sats, a 6-sat activity fee and zero final balances.
Confirm an on-chain Spark deposit on Android ✅ The nightly verified confirmation of the 100,000-sat deposit and checked the net credit and visible history after relaunch.
Receive Lightning into Spark on iOS ✅ Appium verified the 10,000-sat credit in activity, Spending and Spark.

ios-spark-receive.2x.mp4

Send Lightning from Spark on iOS ✅ The fixture verified settlement of 1,000 sats, and Appium verified the 6-sat fee and zero final balances.

ios-spark-send.2x.mp4

Confirm an on-chain Spark deposit on iOS ✅ The fixture verified the 100,000-sat output from mempool to confirmation, and Appium verified the net credit and deposit entry after relaunch.

ios-spark-deposit.2x.mp4

Full review of f148eab…1f4fcb1, covering all four changed files. The README was checked against the launcher and the two nightly workflow definitions.


Reviewed by gpt-6.2-sol-high

Comment thread test/specs/spark.e2e.ts Resolved

@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

@talosmachina talosmachina 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.

Re-review of be1fd44 after 1f4fcb1. My earlier review had no findings. The one new commit makes the Android single-deposit check count the whole history: it scrolls SparkScrollView to its end, then asserts SparkBalance is still on screen before counting SparkDeposit rows. That answers the open point from @ovi-reviewer about UiAutomator2 leaving offscreen rows out. No new findings. Full tier, diff since 1f4fcb1.

What I checked, and 3 candidates I ruled out

Read: getSparkDepositClaimFee whole at be1fd44 and both of its @spark_3 call sites (before and after relaunch); SparkDetailScreen.kt in bitkit-android at 69931fb9, the master commit the nightly ran.
Build: skipped. talos-pr-run could not check the author's permission on this repo and fails closed, so this review is static. The repo runs no CI on the PR, and the PR body's passing nightly is for 1f4fcb1, not this head.

Ruled out

  • Rows hidden under the fixed transfer buttons: on Android the buttons sit in their own Column below the PullToRefreshBox, outside SparkScrollView, so they cannot cover a row inside the scroll viewport.
  • Balance-plus-end not covering every deposit: at 69931fb9 the deposits section is the first thing after the SparkBalance row, so with the view scrolled to its end and the balance row displayed, every deposit row is between them and inside the viewport.
  • A scroll loop that never ends on short content: mobile: scrollGesture returns false when the element cannot scroll any further, including when it never could, so a fresh wallet whose details fit on one screen passes on the first iteration.

Merge confidence: 4/5. Still no findings, but nothing was built or run here, and nothing has run this head on a device that the PR shows.

@piotr-iohk
piotr-iohk requested a review from ovitrif November 24, 2026 09:27

@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

Findings: None. The Android deposit-history check now reaches the end of the list and verifies the balance above it is still visible before counting deposits. The new assertion also rejected a second deposit in the author's Android 13 run. Resolved thread

QA for be1fd44:

Confirm an on-chain Spark deposit on Android ✅ The hosted Android 13 run passed the updated deposit history check before and after relaunch.

The exact E2E head passed on the first attempt. Android nightly job

Confirm an on-chain Spark deposit on iOS ✅ The 135-sat claim fee, 99,865-sat net credit and single matching deposit persisted after relaunch.

The fixture verified the 100,000-sat output from mempool to confirmation. Appium verified the displayed fee, balance and deposit history on iOS 27.0.

ios-spark-deposit.2x.mp4

The same Android job also passed Lightning receive and send. Both unchanged iOS Lightning cases passed at 1f4fcb1. Earlier review and recordings

The 1f4fcb1…be1fd44 delta changes only the deposit helper. The Android and iOS deposit cases exercise the whole change.


Reviewed by gpt-6.2-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

@piotr-iohk
piotr-iohk merged commit 991bbfb into main Nov 24, 2026
1 check passed
@piotr-iohk
piotr-iohk deleted the codex/spark-send-deposit branch November 24, 2026 10:11
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