fix(vta): say which leg went quiet when a TSP reply times out - #345
Merged
Merged
Conversation
Minting a persona DID fails with:
Failed to create persona DID: Failed to create DID via WebVH server:
tsp transport error: timed out waiting for the TSP reply to request
'urn:uuid:fa7c223d-…'
which names a transport and a UUID and nothing an operator can act on.
Its plain reading — "the VTA is unreachable" — is wrong, and sends them
to the wrong log.
What actually happened in the reported case: the VTA accepted the task
and relayed it onward to the DID hosting server, the hosting server
answered promptly, and the VTA refused every answer because it was not
wrapped in the `binding/tsp/0.1/envelope`. The reply the VTA sat waiting
for was one it had already thrown away. The VTA's own self-repair (wait,
re-relate, wait again) then outruns the SDK's hard-coded 60s budget in
`create_did_webvh` by a few hundred milliseconds, so its real 500 always
lands too late to be seen — the timeout masks the diagnosis every time,
by construction.
None of that is ours to fix, and this change does not try to. It makes
the failure legible (R6.4): a reply-timeout now says the request reached
the VTA and that the silent leg may be a peer's rather than ours, so the
next operator opens the VTA's log instead of ours. Every VtaError also
picks up `suggested_fix()` — a public SDK method written for exactly this,
non-CLI consumers that would otherwise fork the CLI's dispatch, and which
OpenVTC used nowhere.
Applied to the two WebVH-server-facing calls, which are the ones that
traverse the VTA→hosting-server leg.
Left alone deliberately: `vta_retryable` covers `DidcommTransport` but
not `TspTransport`. Widening it would override a deliberate SDK safety
decision — `dids/create` is `Keyed` in vta-sdk's `retry_safety` table, so
a blind retry risks a second orphan DID published in the log — to fix a
failure that retrying cannot fix anyway.
Signed-off-by: Glenn Gore <glenn.g@affinidi.com>
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.
What
Minting a persona DID fails with:
That names a transport and a UUID and nothing an operator can act on, and its
plain reading — "the VTA is unreachable" — is wrong.
Why the message is actively misleading
Diagnosed from a live VTA log plus the DID hosting control plane's own log:
refused a TSP frame that is not a binding envelope (got .../spec/trust-task-error/0.5).So the reply the VTA sat waiting for was one it had already thrown away. Worse,
the VTA's self-repair (wait ~30s → re-relate → wait ~30s) outruns the SDK's
hard-coded 60s budget in
create_did_webvh, so its real500lands a fewhundred milliseconds too late to be seen — 60.58s, 60.27s across the attempts in
the log. The timeout masks the diagnosis every time, by construction.
The root cause is not ours:
affinidi-webvh-servicenever wired in thebinding/tsp/0.1envelope on its TSP arm (thetrust-tasks-tspcrate isdeclared in its manifest and imported by nothing). That is fixed separately, in
that repo.
What this changes
Only legibility — R6.4, so the next operator opens the right log:
leg may be a peer's rather than ours.
VtaErrorpicks upsuggested_fix()— a public SDK method documented asexisting for exactly this (non-CLI consumers that would otherwise fork the
CLI's dispatch), which OpenVTC used nowhere.
Applied to the two WebVH-server-facing calls, the ones that traverse the
VTA→hosting-server leg. The original message, request id included, is kept — it
ties the TUI line to the VTA's own log entry for the same task.
Deliberately not changed
vta_retryablecoversDidcommTransportbut notTspTransport, which lookslike an oversight now TSP is the default transport. Widening it would override a
deliberate SDK safety decision —
dids/createisKeyedin vta-sdk'sretry_safetytable, so a blind retry risks a second orphan DID published in thelog — in order to fix a failure that retrying cannot fix anyway. Worth a separate
change if the retry story should consult that table rather than guess.
Testing
Two new tests pin both arms: a reply-timeout names the far leg and closes with
the SDK hint verbatim; any other TSP fault is not blamed on a far leg.
cargo fmt --all --check✅cargo clippy --all-targets✅ cleanRUSTDOCFLAGS="-D warnings" cargo doc --no-deps --workspace✅cargo test --workspace -- --include-ignored✅ 1,440+ tests, 0 failures