Skip to content

Handle FAILED status in poll #420

Description

@AbelOsaretin

Description

Handle FAILED status in the poll_until_confirmed loop. A FAILED status means the transaction was rejected on-chain (e.g., budget exceeded, invalid operation, auth failure).

Current Behavior

FAILED is matched in poll_until_confirmed and returns SubmitError::TransactionFailed with the diagnostic events. This is correct but needs proper error propagation.

Desired Behavior

When FAILED is detected:

  1. Extract diagnosticEventsXdr from the response
  2. Log at error level with the hash and events
  3. Return SubmitError::TransactionFailed { events } immediately (do not retry)
  4. The caller (execute_handler or set_prices_on_chain) should record the failure

Implementation Details

"FAILED" => {
    let events = result.diagnostic_events_xdr.unwrap_or_default();
    tracing::error!(hash, ?events, "transaction failed");
    return Err(SubmitError::TransactionFailed { events });
}
  • Do NOT retry on FAILED — the transaction is permanently rejected
  • Diagnostic events contain Soroban contract error details
  • The caller should parse the events to determine if it is a Budget, ExceededLimit (for order freeze logic)

Acceptance Criteria

  • FAILED status returns SubmitError::TransactionFailed immediately
  • Diagnostic events are captured and returned in the error
  • FAILED does NOT trigger a retry
  • Error is logged at error level with hash and events
  • Unit test: verify FAILED returns error with events

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions