Skip to content

fix: surface mid-flight error identity, liveness, observability (#1-#6,#10-#13)#131

Merged
AquiGorka merged 10 commits into
mainfrom
fix/error-bubbling
Jul 6, 2026
Merged

fix: surface mid-flight error identity, liveness, observability (#1-#6,#10-#13)#131
AquiGorka merged 10 commits into
mainfrom
fix/error-bubbling

Conversation

@AquiGorka

Copy link
Copy Markdown
Contributor

Mid-flight error-bubbling fix (ClickUp 86c8t0zux, half 2). Depends on moonlight-sdk#39 (pins ^0.11.1 for decodeContractError) — merge/publish the SDK first; CI here is red until 0.11.1 is on jsr.

Holes fixed

Model

Internally: preserve-and-wrap (new Error(msg,{cause})) — full chain in logs/OTel. Edge: translate once to a stable code at the API body; UI maps code→copy.

Verified live

On-chain revert → SOROBAN_1010 in the API body + single attempt + correlated logs; RPC-down → 503 in ~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.

AquiGorka added 10 commits July 1, 2026 18:40
error(err,msg,corr?) now flattens the whole cause chain into the log
line so a wrapped error preserves every layer's context (#5), and takes
optional correlation ids (bundle/account/trace id) rendered on every
sink (#6). Adds currentTraceId() to stamp the active trace id.
…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).
… preserve cause

On-network FAILED is terminal with a structured on-chain failureDetail
and no retry (#1,#12). A tx past its transaction.timeout is failed
instead of left PROCESSING forever (#3). Outer catches log the real
cause with correlation, not a generic message (#5,#6).
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.
@AquiGorka AquiGorka requested a review from pselle July 2, 2026 20:11
@AquiGorka AquiGorka merged commit d73c9d9 into main Jul 6, 2026
12 of 14 checks passed
@AquiGorka AquiGorka deleted the fix/error-bubbling branch July 6, 2026 12:42
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