fix: surface mid-flight error identity, liveness, observability (#1-#6,#10-#13)#131
Merged
Conversation
…stic reverts
Decode the soroban contract code from a caught submit error and persist
a structured failureDetail {code,source,message} on terminal failure so
the API carries the real identity instead of failureDetail:null (#1).
Log the real cause with correlation instead of a generic
"Slot execution failed" (#5,#6). Classify decoded reverts as
deterministic and fail them immediately with no retry (#12).
Bounded-timeout the admission-path on-chain reads (channel resolve, UTXO balances) so an unreachable RPC returns a structured 503 CHANNEL_RPC_UNAVAILABLE instead of hanging the request for minutes (#2). Adds 503 to the allowed error-status set. Removes NO_OPERATIONS_PROVIDED (BND_007), unreachable behind the schema's operationsMLXDR.min(1) (#13).
… resubmitting On rehydration, a PROCESSING bundle that already has a linked transaction is left for the verifier to reconcile against the chain rather than re-executed, preventing a crash between submit and record from double-submitting (#11).
A failed poll now marks its span ERROR with recordException and records a health state exposed via /health, instead of being swallowed; fetchCouncilConfig logs its failures instead of returning null silently (#10).
A precise auth failure (a PlatformError with its own status/code) is rethrown as-is; only genuinely unexpected errors become the generic CHALLENGE_VERIFICATION_FAILED 500 (#4).
…ion RPC ExecutionError now keeps the original colibri error as `cause` so its meta.data.match (the soroban code) survives to decodeContractError and the logs — without this the revert flattened to a generic code. calculateOperationAmounts (the first on-chain read of admission) is now timeout-wrapped too, so an unreachable RPC fast-fails with 503 there and not only at the later balance read (#1, #2).
Restores the jsr:@moonlight/moonlight-sdk import (dropping the local-path dev scaffolding used during development) and pins ^0.11.1, which publishes decodeContractError.
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.
Mid-flight error-bubbling fix (ClickUp 86c8t0zux, half 2). Depends on moonlight-sdk#39 (pins
^0.11.1fordecodeContractError) — merge/publish the SDK first; CI here is red until 0.11.1 is on jsr.Holes fixed
failureDetail {code,source,message}(wasnull); API returns it.503 CHANNEL_RPC_UNAVAILABLE(~10s) instead of hanging.transaction.timeout→ dropped tx → FAILED, not stuck PROCESSING./healthwatcher signal.BND_007(zod min(1) covers empty-ops).Model
Internally: preserve-and-wrap (
new Error(msg,{cause})) — full chain in logs/OTel. Edge: translate once to a stablecodeat the API body; UI maps code→copy.Verified live
On-chain revert →
SOROBAN_1010in the API body + single attempt + correlated logs; RPC-down →503in ~10s (was ~890s).Tests
test:unit 133/0 · test:pay 116/0 · test:entities 10/0 · test:integration 100/0 (deno 2.8.2). local-dev e2e/otel/governance/lifecycle/pos-instant/invite-gate + testnet run-local 1-6 all green.