Repository navigation
fix: send at the fee rates confirm showed - #1724
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryOn-chain sends now pass the fee rates saved in
Acknowledged scope: Reviews (1) · Last reviewed commit: "fix: send at the fee rates confirm showe..." · Reviewed by Greptile |
talosmachina
left a comment
There was a problem hiding this comment.
No findings. Passes the send flow's SendUiState.feeRates to LightningRepo.sendOnChain, so the broadcast uses the rates the Confirm fee was computed from instead of a fresh Blocktank fetch at swipe time. Reviewed f3ec065, light tier (1 production line), static: the branch was not built here, CI is the gate.
What I checked, and 4 candidates I ruled out
Read: AppViewModel.sendOnchain, proceedWithOnchainPayment, resetSendState, refreshOnchainSendIfNeeded, refreshOnchainFeeUi, getFeeEstimate; LightningRepo.sendOnChain, calculateTotalFee, getFeeRateForSpeed; CoreService.getFees.
Call sites traced: sendOnchain has one caller (proceedWithOnchainPayment); SendUiState.feeRates is written only in resetSendState.
Ruled out
- Confirm and broadcast still disagree: the Confirm fee comes from
getFeeEstimate->calculateTotalFee(feeRates = currentState.feeRates), and UTXO preselection usesgetFeeRateForSpeed(speed, currentState.feeRates), so all three now read the same snapshot. - Null rates when Blocktank was unreachable at flow start:
getFeeRateForSpeedfalls back togetFees()on null, the same path as before the change. - Custom speed:
getSatsPerVByteForis applied to the sameFeeRatesobject on both sides, so a custom rate resolves the same way at Confirm and at send. - Other on-chain senders (transfers, CPFP, hardware) losing fresh rates: they call
sendOnChainor their own paths directly, notAppViewModel.sendOnchain, and are untouched.
CI: build, build-local and lint pending at review time; Greptile passed.
Test: ordinary send pays the fee rates shown on confirm asserts feeRates = eq(confirmedRates) on sendOnChain.
Merge confidence: 4/5, no findings and the change is covered by the new test, but CI had not finished when this was posted.
Reviewer model: claude-opus-5-5
Reasoning effort: Not exposed (the reviewer session's run metadata does not report it)
Regtest APKDownload bitkit-dev-debug universal APK (expires in 30 days). |
jvsena42
left a comment
There was a problem hiding this comment.
Approving. No findings.
Every on-chain send path now uses the same fee-rate snapshot Confirm showed: ordinary, max, Paykit request, custom fee, hardware wallet, transfer and boost. When no rates are available, the fallback is unchanged. iOS needs no twin, because Confirm and the send both read selectedFeeRateSatsPerVByte there.
Out of scope, pre-existing: the swipe-time sanity warning and maxSendOnchainSats still use a fresh getFees(), and neither platform puts an age limit on the snapshot. The age limit is tracked in #1723.
No device check needed: the change is the fee-rate source, the new unit test in AppViewModelSendFlowTest covers it, and it changes nothing visible unless rates move between Confirm and the swipe.
QA: case 1 passesTested f3ec065, dev debug build, Pixel 7 emulator (Android 16), staging regtest. To make the rates move on demand, a local copy had a debug-only hook (never pushed): once a flag file exists,
case12x.mp4 |
Closes #1722
Description
SendUiState.feeRates) fromAppViewModel.sendOnchaintoLightningRepo.sendOnChain, so the broadcast pays the rate the Confirm screen showed. Before,feeRateswas left null and the repo fetched fresh rates at swipe time; if Blocktank's rates moved between review and swipe, the transaction paid a different rate from the one the user approved. When the send flow has no rates, the repo still fetches them as before.selectedFeeRateSatsPerVByte(comment on the issue).Out of Scope
AppViewModel.kt: the fee sanity check that runs on swipe (calculateTotalFeebefore the fee warning) still estimates with freshly fetched rates. It only decides whether to warn and never sets the fee paid.Design
N/A — no UI changes.
Preview
N/A — no user-visible changes.
QA Notes
Setup
Dev build (regtest, staging Blocktank). Fund the wallet's savings address with
./lsp POST /regtest/chain/depositand mine 3 blocks with./lsp POST /regtest/chain/mine '{"count":3}', as injourneys/README.md.Journeys
N/A — not drivable; see Manual Tests.
Manual Tests
sendOnChain: … satsPerVByte=log line) matches the rate and fee Confirm showed — changing fee rates during a send is not in CapabilitiesAutomated Checks
AppViewModelSendFlowTest.kt— an ordinary send passes the Confirm screen's fee rates tosendOnChainEvidence
Normal (₿ 141). The app loggedsendOnChain: sats=50000, isTransfer=false, isMaxAmount=false, satsPerVByte=1, and the activity shows a fee of 141. This covers the send path at an unchanged rate.onchain-send2x.mp4
CoreService.getFees()return every fresh rate ×10 once a flag file exists; the flag was set while Confirm showedNormal (₿ 141). Fresh rates moved tomid=10, and the swipe-time fee check estimated 1405, but the app loggedsendOnChain: … satsPerVByte=1and the activity shows a fee of 141 (result).case12x.mp4
sendOnChainreceivesnullinstead of the Confirm rates.Gaps
None.
Models used
claude-opus-5-5(reasoning:low)claude-opus-5-5(reasoning:low)claude-sonnet-5-5(reasoning:low)