DAH-2585: unlock coldkey before the fund spinner hides its password prompt - #99
Open
arhangel66 wants to merge 2 commits into
Open
DAH-2585: unlock coldkey before the fund spinner hides its password prompt#99arhangel66 wants to merge 2 commits into
arhangel66 wants to merge 2 commits into
Conversation
taiberium
approved these changes
Aug 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
lium fundreads as hung onChecking wallet registration.... On 2026-08-04 a customer gave up after minutes and sent 5 TAO to the company coldkey manually — money that stays unaccounted until registration completes.It was never hung; it was waiting for a password that does not look like a question.
Both funding paths wrap
CheckWalletRegistrationActioninui.load("Checking wallet registration", ...). For a wallet that is not registered yet, that action callsLium.add_wallet(), which signs withbt_wallet.coldkey— and reading.coldkeymakesbittensor_walletprintEnter your password:straight to the terminal, on the same line, with no newline.Measured under a pty against a real encrypted wallet (bittensor_wallet 4.0.1), sitting on the prompt for 4 s without answering:
\r\x1b[2K) sequences after the prompt appeared: 0ESC[?25l(hide cursor) had been sent,ESC[?25hhad not — the cursor is hidden at the promptSo the prompt is not repainted away. The spinner freezes mid-frame and the prompt lands glued to the tail of that dead line, cursor hidden, nothing echoing:
A stopped spinner with text stuck to it reads as a crashed command, not as a question — which is exactly how it was reported.
Fix
Unlock the coldkey in
lium fundbefore the first spinner opens, in both the TAO and the--alphapath (newUnlockColdkeyAction). The prompt then gets its own clean line with a visible cursor, before anyStatusis running.unlock_coldkey()caches the decrypted keypair on the wallet, so the later signing does not ask again — measured password prompts stay at 1.In the alpha path
Lium()now constructs before the unlock, so a missing API key aborts without asking for a password first. The TAO path already had that order.Trade-off
The password is now requested on every
lium fundrun, before the amount prompt and the confirm — including for already-registered wallets that previously only got asked after confirming. Accepted: the run ends in a coldkey signature anyway, and a wrong password now fails before any network call instead of after.Two known limits, unchanged by this PR: the Rust prompt reads the controlling tty (a piped password is not consumed), and a wrong password has no retry — the command has to be re-run.
Tests
Three regression tests in
test/test_fund_cli.py: the unlock precedes everyui.loadspinner on both paths, and a coldkey that fails to decrypt aborts before registration or transfer. All three fail if the unlock is removed (verified by mutatingUnlockColdkeyActioninto a no-op).Pre-deploy verification
Staging, encrypted coldkey, unregistered wallet: the password prompt appears on its own line before the spinner, and registration completes.
Post-deploy verification
+1 d: a fresh coldkey funds end-to-end — the pay-tao listener logs
Transfer matched company wallet, with noCRITICAL: No Stripe customer ID.