CLI: compress blob-length validator rejections; quiet vault success output - #714
Merged
Merged
Conversation
…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
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.
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, soalw swap now/post-txprinted walls of JSON per validator (the V1–V6 spew)._terse()invalidator_rejections.pynow compresses any reason over 140 chars:Error Messagetext:V5: no sendTransaction: Signer is not a whitelisted validator'message'field:V1: no sendTransaction: Transaction simulation failed: Attempt to debit an account but found no record of a prior creditApplied to the per-validator lines, the unmatched-headline fallback, and the
raw_reasoncontext 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'sSolanaRpcError) is a follow-up.alw vaultsuccess outputpost-collateral(and every_reportcaller) 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.pyfailures are the known pre-existing order-dependent ones ontest.https://claude.ai/code/session_01QHBu426sa8enr9bYN5gnDX