Skip to content

feat: estimate confirmation time for a custom fee - #1641

Open
ovitrif wants to merge 2 commits into
masterfrom
feat/custom-fee-confirm-estimate
Open

ovitrif wants to merge 2 commits into
masterfrom
feat/custom-fee-confirm-estimate

Conversation

@ovitrif

@ovitrif ovitrif commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #1634

Description

  • Estimates "Confirming in" for a custom on-chain fee from the current fee tiers, the same way the preset speeds do. Before, a custom fee always showed "Depends on the fee"; in the mainnet case behind the issue, 4 sat/vB against a fastest tier of 2 sat/vB was headed for the next block with no estimate shown.
    • At or above the fast tier: the fast time (±10-20 minutes).
    • Between tiers: the time of the tier it reaches.
    • Below the slow tier: the minimum tier's cautious "+2 hours".
    • With no fee tiers loaded: "Depends on the fee", as before.
  • iOS already maps a custom rate onto the tiers (TransactionSpeed.getFeeTierLocalized in SendConfirmationView), so this matches it and needs no iOS change.

Out of Scope

  • The tier label under the time that the issue suggests: neither app shows one for preset speeds today.
  • Transaction speed settings: "Depends on fee" stays for a custom default speed, which has no amount or live rate to compare.

Design

N/A — reuses the preset speeds' time copy.

Preview

Custom fee of 4 sat/vB with fee tiers 2 / 1 / 1 sat/vB, confirm sheet with details shown. Before and after:

Before After

QA Notes

Journeys

  • new custom-fee-confirmation-estimate.xml

Manual Tests

N/A

Automated Checks

  • added FeeRateTest.kt
  • updated SendConfirmScreenTest.kt (custom fee shows its tier's time)
  • ran compileDevDebugKotlin, detekt, lintDevDebug, FeeRateTest, and the new SendConfirmScreenTest case on an emulator

@ovitrif ovitrif added this to the 3.2.0 milestone Oct 20, 2026
@ovitrif ovitrif self-assigned this Oct 20, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 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-20T23:50:33.071975Z 25cb54f 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.

@ovitrif
ovitrif requested review from a team, ben-kaufman and coreyphillips and removed request for a team October 20, 2026 23:48

@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: 25cb54f35b

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

@greptile-apps

greptile-apps Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

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

Summary

Custom on-chain fees now show a confirmation-time estimate based on the loaded fee tiers.

  • Custom on-chain fees show the time for the tier they reach.

Tests and Android UI capture were not run during this review.

Reviews (1) · Last reviewed commit: "feat: estimate confirmation time for a c..." · Reviewed by Greptile

@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Regtest APK

Built from 2b146fe (run).

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

@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. Shows the matching preset's confirmation time for a custom on-chain fee rate on the send confirm sheet, falling back to the custom description when fee tiers are unknown. Reviewed 25cb54f, full tier.

What I checked, and 4 candidates I ruled out

Read in full: FeeRate.kt, SendConfirmScreen.kt (the OnChainDetails fee cell), FeeRateTest.kt, the onchainFeeUi writers in AppViewModel.kt
CI: lint, detekt, build, build-local green; e2e running
Build: Bitkit track: the branch was not built here (Android branches are not built on this box, iOS does not build on Linux), so this review is reasoned from the code and from CI.

Ruled out

  • Preset fees changed: the new branch only runs when feeUi.rate == FeeRate.CUSTOM; preset rates render as before.
  • Zero or missing rate: Custom(0u) (what FeeRate.CUSTOM.toSpeed() returns) and feeRates == null both keep CUSTOM, so no tier is invented; the test covers both.
  • Retained hardware payment: that path sets rate = CUSTOM with speed = Custom(hardwareFeeRate), so it now gets a tier estimate from the real rate, which is the intent.
  • Tier boundaries: fromSatsPerVByte uses >= per tier, and the tests pin exact-boundary, between-tier and below-slow cases.

Merge confidence: 4/5, the e2e shards had not finished at review time; FeeRateTest.kt covers the new mapping.

@ovitrif

ovitrif commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator Author

Pushed 2b146fe: adds journeys/send/custom-fee-confirmation-estimate.xml, the device walkthrough for the custom-fee estimate, as the Codex review asked. No code change.

@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 at 2b146fe: no issues found. iOS needs no twin: it already maps a custom rate onto the fee tiers (SendConfirmationView.swift:624), and the Android text matches.

  • Tier mapping: the custom rate and the tiers are both in sat/vB and compared per tier with >=, the same as iOS. Below the slow tier it shows "+2 hours". Fast shows only at or above the loaded fast tier.
  • Hardware retry: a retained hardware payment uses its real signed rate.
  • Parity: with no estimates loaded, this side shows "Depends on the fee" and iOS shows the normal-tier time.

Device gate (partial): 2b146fe — not run yet. Pending: send/custom-fee-confirmation-estimate.xml. It assumes the regtest Fast tier is below 50 sat/vB, so check the loaded tiers first.

Device results will follow in a separate review.

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

Device gate passed on regtest (emulator, Pixel 9). Approving; my earlier code scan found no issues.

The loaded tiers were Fast 3, Normal 1 and Slow 1 sat/vB, so the journey's assumption that Fast is below 50 holds.

custom-fee-confirmation-estimate.xml: all 5 steps passed. A custom 50 sat/vB rate shows "Custom (₿7 025)" with "±10-20 minutes".

Extra rates:

  • 3 sat/vB (= Fast): ±10-20 minutes.
  • 2 sat/vB (between Normal and Fast): ±20-60 minutes.
  • 1 sat/vB: ±20-60 minutes. Regtest has Normal and Slow at the same rate, and >= mid wins, as the code intends.

Preset speeds are unchanged: Fast ±10-20 minutes, Normal ±20-60 minutes, Slow ±1-2 hours. Nothing was broadcast and there was no crash.

Not reachable on regtest: a rate below Slow ("+2 hours"). Slow is 1 sat/vB and the custom screen won't continue at 0, so FeeRateTest covers that case.

Not from this PR: after a custom rate is set, the speed picker's Custom row still reads "Depends on the fee".

Device gate: 2b146fe — journeys: 1 passed, 0 failed (custom-fee-confirmation-estimate.xml), plus 3 extra rates and the presets; not run: below-Slow rate (unreachable on regtest, covered by FeeRateTest).

This branch has not been deployed

No deployments
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.

feat: estimate confirmation time for a custom on-chain fee

3 participants