Skip to content

CLI: actionable validator rejection messages + loading indicators#217

Merged
LandynDev merged 1 commit intotestfrom
cli/validator-rejection-ux
Apr 26, 2026
Merged

CLI: actionable validator rejection messages + loading indicators#217
LandynDev merged 1 commit intotestfrom
cli/validator-rejection-ux

Conversation

@LandynDev
Copy link
Copy Markdown
Collaborator

Summary

  • Centralizes per-validator broadcast result rendering in allways/cli/validator_rejections.py — a prefix-matched rules table maps every reject_synapse(...) reason from axon_handlers.py to an actionable, user-facing explanation, plus a deterministic-vs-transient classification.
  • Wires the translator into the four CLI sites that broadcast to validators: alw swap now (reserve + confirm), alw swap post-tx, alw swap resume-reservation, alw miner activate. Replaces the ad-hoc friendly_rejection helper in miner_commands.py.
  • Suppresses the Retry? prompt for deterministic failures (insufficient source balance, invalid proof, wrong direction, swap amount out of range, miner not active, etc.) — retrying with the same inputs can't fix them, so don't ask.
  • Adds spinners around the remaining intermittent steps in alw swap now / post-tx / resume: reading miner commitments, eligibility check, protocol bounds query, balance check, validator discovery, broadcast, TAO transfer. Never wraps an interactive signing prompt.

Before

    V1: no Insufficient source balance
No validators accepted the reservation.
Retry? [Y/n]:

After

  V1: no Insufficient source balance

Source address tb1qg6da0krxahqyjhtdmnrrf8qfeqzyfc6ge9kp6j does not hold enough BTC.
Fund it with at least 0.0008 BTC and try again.
Retrying with the same inputs will not change this — fix the underlying issue first.

Test plan

  • pytest tests/ — 311 passed (added 11 translator tests)
  • ruff format && ruff check — clean
  • Trigger insufficient-balance reject in dev environment, confirm new message
  • Trigger miner-busy reject (transient), confirm Retry? still appears
  • Trigger no-validator-response, confirm new copy
  • BTC external-signing flow — confirm no spinner above the paste prompt
  • alw miner activate with unregistered hotkey, confirm translator headline replaces the prereqs list

Aggregates per-validator broadcast results into a centralized translator
that maps validator-side rejection reasons to user-facing explanations,
classifies failures as deterministic vs transient, and suppresses retry
prompts when retrying the same inputs cannot help.

Applied to alw swap now (reserve + confirm), alw swap post-tx,
alw swap resume-reservation, and alw miner activate. Replaces the
ad-hoc friendly_rejection helper. Adds spinners around the remaining
intermittent steps in the swap flow (commitment read, eligibility
check, bounds query, balance check, validator discovery, broadcast,
TAO transfer) — never around interactive signing prompts.
@LandynDev LandynDev merged commit ec0d10d into test Apr 26, 2026
3 checks passed
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.

1 participant