Skip to content

fix: use fast fee for hw transfer - #1089

Merged
piotr-iohk merged 2 commits into
masterfrom
fix/1088-hw-transfer-fast-fee
Jul 17, 2026
Merged

fix: use fast fee for hw transfer#1089
piotr-iohk merged 2 commits into
masterfrom
fix/1088-hw-transfer-fast-fee

Conversation

@piotr-iohk

Copy link
Copy Markdown
Collaborator

Fixes #1088

This PR makes Trezor → spending funding use a faster on-chain fee rate so LSP channel funding confirms more reliably.

Description

  • Uses the fast fee tier for hardware-wallet transfer funding instead of the settings default (medium), which can resolve to 1 sat/vB in a quiet fee market.
  • Raises the estimate-unavailable fallback from 1 to 3 sat/vB so compose still picks a usable rate when Blocktank fee estimates fail.
  • Updates unit coverage for the fast-rate path and the new fallback floor.

Related iOS: synonymdev/bitkit-ios#633

Preview

N/A

QA Notes

Manual Tests

  • 1. Pair Trezor with spendable UTXOs → Transfer → Spending → Sign: funding tx uses a fast-tier sat/vB (check explorer), not ~1 sat/vB when the market’s mid is 1.
  • 2. Complete HW transfer → Spending: funding confirms and the transfer progresses toward channel open without lingering unconfirmed for hours under a normal fee market.
  • 3. regression: Savings → Transfer → Spending: still works with the existing savings fee path.

Automated Checks

  • Unit tests modified: assert HW compose requests TransactionSpeed.Fast and uses a 3 sat/vB fallback when fee lookup fails in TransferViewModelTest.kt.
  • Local: just test file TransferViewModelTest, just lint.
  • CI: standard compile, unit test, and detekt checks run by the PR bot.

Made with Cursor

piotr-iohk and others added 2 commits July 16, 2026 16:53
Trezor → spending funding was using the settings default fee tier
(medium), which can resolve to 1 sat/vB and leave channel funding
unconfirmed. Use fast instead and raise the estimate-unavailable
fallback from 1 to 3 sat/vB.

Fixes #1088

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@greptile-apps

greptile-apps Bot commented Jul 16, 2026

Copy link
Copy Markdown

Greptile Summary

This PR uses faster fees for hardware-wallet funding. The main changes are:

  • Requests the fast fee tier for Trezor-to-spending transfers.
  • Raises the unavailable-estimate fallback from 1 to 3 sat/vB.
  • Updates unit coverage and the changelog.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
app/src/main/java/to/bitkit/viewmodels/TransferViewModel.kt Uses the fast fee tier for hardware-wallet funding and raises the fallback fee rate to 3 sat/vB.
app/src/test/java/to/bitkit/viewmodels/TransferViewModelTest.kt Verifies the fast fee request and updates the expected fallback fee rate.
changelog.d/next/1088.fixed.md Documents the improved confirmation reliability for hardware-wallet transfers.

Reviews (1): Last reviewed commit: "chore: rename changelog fragment" | Re-trigger Greptile

@piotr-iohk
piotr-iohk requested a review from jvsena42 July 16, 2026 15:33
Comment thread app/src/main/java/to/bitkit/viewmodels/TransferViewModel.kt
Comment thread app/src/main/java/to/bitkit/viewmodels/TransferViewModel.kt Fixed
Comment thread app/src/main/java/to/bitkit/viewmodels/TransferViewModel.kt Fixed
@piotr-iohk

Copy link
Copy Markdown
Collaborator Author

Tested end-to-end on mainnet (Trezor → spending / Blocktank channel open).

  • Funding tx used ~3 sat/vB (not the previous ~1 sat/vB mid/default path).
  • Tx confirmed within minutes and the channel opened successfully.
  • Previously the same flow could sit unconfirmed for hours at ~1 sat/vB.

Fix confirmed end-to-end on mainnet.

@piotr-iohk
piotr-iohk requested review from jvsena42 and pwltr July 17, 2026 08:43
@piotr-iohk
piotr-iohk enabled auto-merge July 17, 2026 08:52
@pwltr

pwltr commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Failing e2e test seems valid on first glance, also note related issue #1034

@piotr-iohk
piotr-iohk force-pushed the fix/1088-hw-transfer-fast-fee branch from f852500 to 5228c88 Compare July 17, 2026 10:14
@piotr-iohk

Copy link
Copy Markdown
Collaborator Author

Will address savings → spending (onTransferToSpendingConfirm / #1034) separately — that path needs more than a fee-tier swap (fee headroom / send-all edge cases under fast rates). This PR stays a targeted HW-wallet funding fee fix for #1088.

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

I'll handle #1034

@piotr-iohk
piotr-iohk merged commit f45c7e6 into master Jul 17, 2026
48 of 50 checks passed
@piotr-iohk
piotr-iohk deleted the fix/1088-hw-transfer-fast-fee branch July 17, 2026 11:22
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.

[Bug]: Trezor transfer to spending uses low on-chain fee rate

4 participants