CLI: relay deposit confirms to the validator quorum only, stop waiting at quorum - #715
Merged
Merged
Conversation
Base automatically changed from
cli-terse-rejections-and-vault-success
to
test
September 2, 2026 21:54
…quorum The confirm relay broadcast to every serving permit-holder and gathered all responses on a 60s timeout — so with 1-of-6 whitelisted, the taker waited on five validators that can't submit claims (NotValidator) and read their errors. discover_quorum_axons resolves Config.validators → Binding → metagraph axon; resolve_relay_axons uses that set with needed=votes_needed(cfg), falling back LOUDLY to broadcast-all whenever the chain can't fully resolve the quorum — the relay may get noisier on a resolution failure, never narrower. The relay itself now uses broadcast_until_quorum (as miner activation already does), so one accept ends the wait; attestation is chain-driven, so unrelayed quorum members still pick the claim up from the PendingAttestation scan. Responses render by identity (vali 194: ok) instead of positional V-indexes. Claude-Session: https://claude.ai/code/session_01QHBu426sa8enr9bYN5gnDX
anderdc
force-pushed
the
cli-quorum-filtered-deposit-relay
branch
from
September 2, 2026 21:57
c8ccfe5 to
803cd3d
Compare
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.
Stacked on #714 (shares the rejection-renderer changes) — merge that first; GitHub will retarget this to
test.Fixes both halves of the deposit-relay pain from today's mainnet session:
A):broadcast_synapsegathered ALL responses on a 60s timeout, so dead/foreign axons held the relay long after the real validator accepted.B): 5 of 6 serving validators aren't in the contract quorum, can'tsubmit_swap_claim(program rejectsNotValidator), and their errors were rendered as if they mattered.What changed
discover_quorum_axons(dendrite_lite.py): resolves the contract's whitelist to axons —Config.validators→ Binding (validator Solana pubkey → hotkey) → metagraph axon — returning only members that fully resolve to a serving axon, plus a hotkey→label map. Verified live on mainnet:AuRf6Y…→5DtUJ9…→ uid 194.resolve_relay_axons(post_tx.py): uses the quorum set when it coversvotes_needed(cfg); otherwise falls back loudly to broadcast-all (yellow warning naming what didn't resolve). The relay can get noisier on a resolution failure — never narrower than the quorum. Bothpost-txand theswap now --sendpre-resolve path (funds-safety ordering preserved: resolution still happens before money moves) go through it.Early return: the relay now uses
broadcast_until_quorum(the same machinery miner activation has used all along) withneeded=votes_needed(cfg)— one accept ends the wait today, and printsQuorum reached — stopped waiting on N slower validator(s). Protocol-safe: attestation is chain-driven (solana_swap_loopscansPendingAttestationfrom chain state), so quorum members that didn't get the synapse still find the claim.No failure is papered over: zero accepts → exactly the old path (rejections rendered, 3×30s retry, exit 1). Quorum-member rejections still print in full and still fail the run.
Identity labels: responses render as
vali 194: okinstead ofV6: okwhen the target is known — positional indexes stop meaning anything on a filtered set.Tests
test_quorum_relay.py(+10): resolution happy path, unbound validator, non-serving axon, partial-resolution fallback, config-read-failure fallback, identity vs positional labels, and arelay_depositwiring test (quorum count flows through, early-stop line prints).test_swap_now_send_ordering.pyupdated to the resolver API — the funds-safety invariants (resolve-before-send, recoverable relay errors) still pin.Full suite: 2057 passed; the 3
test_bitcoin_signing.pyfailures are the known pre-existing order-dependent set.Local test plan (before merge)
alw swap quotesanity, then a small mainnet swap with--send: expectRelaying deposit to 1 validator(s),vali 194: ok, and a fast relay (no 60s tail).ALLWAYS_PROGRAM_IDpointed at a dead program in a scratch config) to see the loud fallback.alw swap post-tx <sig>re-relay of an already-confirmed deposit (idempotent) to exercise the non---sendpath.https://claude.ai/code/session_01QHBu426sa8enr9bYN5gnDX