Skip to content

fix: only fee-bump transactions the wallet broadcast - #1706

Merged
ovitrif merged 4 commits into
masterfrom
fix/bump-own-txs-only
Oct 28, 2026
Merged

ovitrif merged 4 commits into
masterfrom
fix/bump-own-txs-only

Conversation

@ovitrif

@ovitrif ovitrif commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Twin: synonymdev/bitkit-ios#1140
Refs: synonymdev/ldk-node#129

This PR updates LDK Node to 0.7.0-rc.78, which contains synonymdev/ldk-node#129, so Boost only replaces outgoing transactions this wallet sent.

Description

  • Updates ldk-node-android to 0.7.0-rc.78 in gradle/libs.versions.toml. After it, bumpFeeByRbf replaces only transactions the wallet built and broadcast. Any other transaction ID returns the new NodeException.TransactionNotBroadcastByWallet before a replacement is built.
  • Maps NodeException.TransactionNotBroadcastByWallet in Errors.kt to "No broadcast record for this transaction", next to the other LDK Node errors.
  • Boosting a received transaction (CPFP) is unchanged.

Out of Scope

  • app/src/main/java/to/bitkit/ui: a dedicated Boost error message. The new error reaches the user through the existing LDK Node error text.
  • Sends made before this update: LDK Node holds no broadcast record for them, so an unconfirmed send from before the update cannot be boosted by replacement after it.
  • Channel force closes with the LSP: the closing transaction is not broadcast when the peer is trusted. That needs a separate LDK Node change, not part of fix: only fee-bump transactions the wallet broadcast ldk-node#129.

Design

N/A — no UI changes.

Preview

N/A — no user-visible UI change.

QA Notes

Setup

Regtest with on-chain funds, on a build of this PR.

Journeys

  • journeys/boost/rbf-own-send.xml — boost an unconfirmed send this wallet made: the replacement keeps the amount, raises the fee, gets a new TXID and confirms — passed at 5996ce1 (@jvsena42's run)
  • journeys/boost/cpfp-receive.xml — boost an unconfirmed incoming payment: a Boost Fee child appears, the receive keeps its TXID and both confirm — passed at 5996ce1 (@jvsena42's run)

Manual Tests

  • 1. Upgrade from a build on 0.7.0-rc.77 with an existing wallet and channels → the node starts, channels reconnect and balances match — upgrade path not in Capabilities

Automated Checks

  • ran compileDevDebugKotlin and testDevDebugUnitTest against the published 0.7.0-rc.78; both pass, including the new NodeException.TransactionNotBroadcastByWallet mapping.

Gaps

  • Manual test 1 ran for an on-chain-only wallet (@jvsena42's review): the node starts, history is intact, and sends and boosts work. The channel part has not run.

@ovitrif
ovitrif marked this pull request as ready for review October 27, 2026 17:44
@ovitrif
ovitrif requested review from a team, ben-kaufman and pwltr and removed request for a team October 27, 2026 17:44
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T17:46:02.211353Z 3eff12b Draft marked ready
ℹ️ 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.

@ovitrif
ovitrif requested review from piotr-iohk and removed request for pwltr October 27, 2026 17:44

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3eff12b36e

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread gradle/libs.versions.toml Resolved
@greptile-apps

greptile-apps Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The behavior change is limited to on-chain transaction boosting.

The PR appears safe to merge, with a non-blocking request to test the new rejection rule.

Findings

  1. P2 New rejection rule lacks coverage ▶

Summary

Updates ldk-node-android to 0.7.0-rc.78 so replacement fee bumps require a wallet broadcast record.

  • RBF Boost only replaces transactions this wallet broadcast.

Acknowledged scope from ovitrif:

  • Sends made before this upgrade cannot be replaced because they lack broadcast records.
  • Trusted-LSP force-close support needs a separate LDK Node change.
  • A dedicated Boost error message is deferred.

Reviews (1) · Last reviewed commit: "fix: name the missing broadcast record i..." · Reviewed by Greptile

Comment thread gradle/libs.versions.toml Resolved

@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 ldk-node-android to 0.7.0-rc.78, so bumpFeeByRbf refuses any txid this wallet did not build and broadcast, and maps the new NodeException.TransactionNotBroadcastByWallet in LdkError. Reviewed 3eff12b, full tier (dependency manifest). Static review: the auto review does not build bitkit-android branches.

What I checked, and 5 candidates I ruled out

Read: the v0.7.0-rc.77..v0.7.0-rc.78 diff of synonymdev/ldk-node (src/wallet/mod.rs, src/payment/onchain.rs, src/error.rs, bindings/ldk_node.udl, the generated Kotlin), Errors.kt, BoostTransactionViewModel.kt, the boost gating in ActivityDetailScreen.kt, and the send path in LightningService.kt / OnchainSendAttemptStore.kt.
Release: tag v0.7.0-rc.78 is 1976754, published, and contains the merge of synonymdev/ldk-node#129 (e794b35).
CI at review time: lint, detekt, build-local green; build and the e2e shards (including onchain_boost_receive_widgets and send) still running.

Ruled out

  • Bitkit's own sends get no broadcast record: Bitkit never calls send_to_address; every on-chain send goes through prepareSendToAddress / prepareSendAllToAddress and PreparedOnchainSend.broadcast() (LightningService.kt:991-1017, also PaykitPaymentProofRepo.kt:578). rc.78 calls record_broadcast_txid inside broadcast() before dispatch (onchain.rs:224), so a send made after the update is boostable.
  • Boosting a boost: the RBF and CPFP paths record the replacement/child txid before broadcasting, and cancel the wallet tx if the record write fails, so a second RBF on the replacement still passes the check.
  • Record lost on restore: the record is written through the node's kv_store, which Bitkit builds as the VSS store (buildWithVssStore), so it travels with the rest of the node state.
  • FFI error index shift: TransactionNotBroadcastByWallet takes index 59 and every later NodeException moves up one, but reader and writer ship together in the same AAR, and the app matches by type (PaykitPaymentProofRepo.kt:762, QuickPayRepo.kt:845), never by index.
  • Sends from before the update can no longer be boosted: they fail into the existing generic boost-error toast. Stated under Out of Scope, so deliberate.

Merge confidence: 4/5, no findings, but the dependency bump has no automated test of the Boost path, the build and e2e shards had not finished, and manual tests 1 to 3 are unrun.

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Regtest APK

Built from 5996ce1 (run).

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

@ovitrif

ovitrif commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator Author

Pushed 2a08963: adds journeys/boost/rbf-own-send.xml and journeys/boost/cpfp-receive.xml, the device journeys for boosting a wallet-made send (replacement) and an incoming payment (child). This answers the journey finding; the QA notes now list them, and the upgrade from 0.7.0-rc.77 stays the only manual test.

Comment thread journeys/boost/rbf-own-send.xml Resolved
@ovitrif

ovitrif commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator Author

Pushed 5996ce1: journeys/boost/rbf-own-send.xml now taps ContinueAmount and checks SendConfirm before swiping, so the journey reaches the boost steps (@ben-kaufman's point). The failing onboarding_backup_numberpad E2E shard is @backup_1 waiting for WidgetSave; it fails the same way on other open PRs and is not from this change.

@ovitrif
ovitrif requested a review from ben-kaufman October 27, 2026 18:33

@jvsena42 jvsena42 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Code scan: no HIGH or MEDIUM.

  • Every legitimate bump still works: RBF on your own sends (all app sends go through the prepared broadcast, including recovery re-preparation), CPFP on received transactions, and bumps after a restore, since the broadcast record lives in the VSS store.
  • Hardware-wallet sends and transfers stay excluded from Boost.
  • A counterparty-crafted RBF is refused with nothing queued.
  • Sends made before the upgrade (v3.0.0 ships ldk-node rc.74) can no longer be bumped, which the PR body acknowledges.

Performance-relevant: ldk-node rc.78 adds a synchronous VSS write (record_broadcast_txid) to every send and boost. That is one extra round trip normally, and up to 180 s of retries when VSS is degraded.

Device gate (partial): not run yet. Pending: boost/rbf-own-send.xml and boost/cpfp-receive.xml, and timing a send against master on the same network.

@jvsena42

Copy link
Copy Markdown
Member

Device gate (partial): 5996ce1 (CI APK), Gate_Throwaway emulator, regtest on staging. The wallet was created on master and funded with 1 000 000 sat, then upgraded in place to this build.

  • boost/rbf-own-send.xml: pass.
    • The fee went from 141 to 422 sat, the TXID changed (8343c3ff → 0535abd5), and the activity shows "BOOSTED TRANSACTION 1 (RBF)" with the boosting status, then Confirmed after mining.
    • The first run also boosted ("RBF transaction created successfully!"), but a shared staging block confirmed it before the Boosting status could be seen. That is an environment issue.
  • boost/cpfp-receive.xml: pass. An unmined 100 000 sat deposit offered CPFP. The child 02a17fc0 produced a Boost Fee entry of 3 833 sat, the TXID stayed the same, and the activity shows "BOOSTED TRANSACTION 1 (CPFP)", then both confirmed after mining.
  • Observation, likely pre-existing: right after a boost the list briefly shows the sheet's estimate (-10 626 for RBF) until a resync shows the real fee (10 422).

Still running: the negative check (a transaction the wallet didn't broadcast offers no RBF), and send timing against master for the ldk-node rc.78 broadcast-record write.

@jvsena42 jvsena42 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approving. The code scan had no HIGH or MEDIUM, and the device gate passed.

Device gate: 5996ce1 (CI APK), Gate_Throwaway emulator, regtest on staging. The wallet was created and funded on master, then upgraded in place to this build.

  • boost/rbf-own-send.xml: pass. The fee went from 141 to 422 sat, the TXID changed, the activity shows "BOOSTED TRANSACTION 1 (RBF)", and it confirmed after mining. The re-run was needed because a shared staging block confirmed the first send before the Boosting status could be seen.

  • boost/cpfp-receive.xml: pass. A Boost Fee entry appeared, the receive kept its TXID, and both confirmed.

  • Negative check: an incoming payment offers only CPFP.

  • A send broadcast before the upgrade still opens the RBF sheet. The swipe then fails with "this wallet has no broadcast record for it" and the generic "Boost Failed" toast. The PR body already lists this as out of scope.

  • Upgrading an on-chain-only wallet from ldk-node rc.77 to rc.78 kept the node starting, the history intact, and sends and boosts working.

  • Perf, 6 sends per build, alternating builds:

    this PR master
    Swipe to "Accepted on-chain send", median 1.95 s 1.75 s
    "Created new transaction" to "Successfully broadcast", median 0.234 s 0.168 s

    The ~65 ms difference is about one VSS round trip, from the new broadcast-record write.

⚠️ Not run: the channel part of manual test 1. No channel was opened on this wallet.

Observation, not from this PR: right after a boost, the activity list shows the boost sheet's estimate until the next sync (-10 626 for RBF against an actual 10 422).

CI is green at 5996ce1.

@ovitrif
ovitrif merged commit a518e53 into master Oct 28, 2026
21 checks passed
@ovitrif
ovitrif deleted the fix/bump-own-txs-only branch October 28, 2026 07:47
@ovi-reviewer ovi-reviewer Bot mentioned this pull request Nov 12, 2026
3 tasks
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.

4 participants