Skip to content

CLI: compress blob-length validator rejections; quiet vault success output - #714

Merged
anderdc merged 1 commit into
testfrom
cli-terse-rejections-and-vault-success
Sep 2, 2026
Merged

CLI: compress blob-length validator rejections; quiet vault success output#714
anderdc merged 1 commit into
testfrom
cli-terse-rejections-and-vault-success

Conversation

@anderdc

@anderdc anderdc commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Two small operator-UX fixes (tickets from today's mainnet swap session).

Blob-length validator rejections → one human line

A validator-side RPC failure stuffs the entire JSON-RPC error dict into rejection_reason, so alw swap now / post-tx printed walls of JSON per validator (the V1–V6 spew). _terse() in validator_rejections.py now compresses any reason over 140 chars:

  • Anchor sim-log blobs → the Error Message text: V5: no sendTransaction: Signer is not a whitelisted validator
  • Plain RPC errors → the 'message' field: V1: no sendTransaction: Transaction simulation failed: Attempt to debit an account but found no record of a prior credit
  • Unstructured long strings → clipped with an ellipsis

Applied to the per-validator lines, the unmatched-headline fallback, and the raw_reason context that rule builders interpolate. Short reasons pass through byte-identical, so the prefix-match rules table and all existing translations are unaffected (the full raw string is still what gets matched).

This is the CLI half of the spew ticket; the validator-side half (not stuffing the dict in at the source, rpc.py's SolanaRpcError) is a follow-up.

alw vault success output

post-collateral (and every _report caller) dumped the raw event-name list on success. Events are failure diagnostics — they now print only when the call failed. Success = green line + extrinsic hash.

Tests

  • test_validator_rejections.py: +3, using the verbatim V1/V5 blobs from the mainnet session as fixtures.
  • test_cli_vault_admin.py: +2 (success hides events, failure keeps them).

Full suite: 2048 passed; the 3 test_bitcoin_signing.py failures are the known pre-existing order-dependent ones on test.

https://claude.ai/code/session_01QHBu426sa8enr9bYN5gnDX

…utput

A validator RPC failure smuggles the whole JSON-RPC error dict through
rejection_reason, flooding the terminal with per-validator JSON. _terse now
pulls the human sentence out — the Anchor 'Error Message' from sim logs when
present, else the RPC 'message' — and clips anything else at 140 chars. Short
reasons pass through untouched, so the prefix-match rules are unaffected.

alw vault success reads as one green line + extrinsic; the raw event-name
dump only prints when the call failed, where it is actual diagnostics.

Claude-Session: https://claude.ai/code/session_01QHBu426sa8enr9bYN5gnDX
@anderdc
anderdc merged commit 143114d into test Sep 2, 2026
3 checks passed
@anderdc
anderdc deleted the cli-terse-rejections-and-vault-success branch September 2, 2026 21:54
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