wallet: show the chain daemon's sync height and target on the child status
All checks were successful
ci / test (pull_request) Successful in 5m50s
ci / sdk (pull_request) Successful in 1m34s
ci / fuzz (pull_request) Successful in 4m54s
android-ci / android (pull_request) Successful in 12m39s

The user watching an in-process Cuprate node on Android saw only a phase
word (connecting, with 'wallet connect: Connection refused (os error
111)') and asked to see height vs tip.

- WalletChildStatus gains height / target_height, and line() appends
  'sync h/t' when a probe read either number. No percentage is invented
  when the daemon reports no target (h/0 is honest), and an off/exited
  child reports 0/0.
- Node::wallet_child_refresh fills them: one wallet-RPC get_info now
  answers both the readiness gate and the numbers (Wallet::chain_info,
  with chain_ready built on the same parse), and when the wallet RPC is
  down while the chain source is local/in-process, the loopback daemon
  is asked directly (ChildConfig::daemon_probe_addr). A refused daemon
  stays 0/0 — unknown, not caught up. Only refresh dials; the draw path
  reads two atomics.
- UniFFI WalletChildStatus carries the same two u64 fields so Android can
  show them; SDK test covers the round trip.

Tests: cargo test --locked --target x86_64-unknown-linux-gnu (all
green), clippy -D warnings clean; crates/onionwire-sdk cargo test
--locked + clippy clean (separate workspace).
This commit is contained in:
onionwire 2026-09-19 19:38:52 -04:00
commit 0a91744924
No known key found for this signature in database
5 changed files with 468 additions and 17 deletions

View file

@ -342,6 +342,22 @@ env-var presence, and `ready` is never reported for a child that has died.
- **`exited`** — a started child has died. Stop and start again; the status is
not stale, it is the process table.
The same one-liner carries the chain's own progress once a probe has read it:
```
child syncing · in-process node · sync 1160/3090939
```
Those are the **daemon's** height and the tip it is syncing towards — from the
wallet RPC's `get_info` when it answers, and, when the wallet RPC is *not*
answering (the `connecting` case, e.g. `Connection refused (os error 111)`) while
the chain source is `local node` or `in-process node`, from that loopback daemon
directly. `sync 0/0`, or no `sync` segment at all, means **unknown**: the child
is off or exited, the probe failed, or the daemon reported no target — which is
not the same as caught up, and is never a wallet-scan height. No percentage is
ever derived from it. `WalletChildStatus` (and the UniFFI record) carries the two
numbers as `height` / `target_height`.
`start` is idempotent: a live child is reported, not respawned. A start that
cannot spawn the binary is an error and leaves no child behind.