Skip to content

Handle PENDING/NOT_FOUND in poll #421

Description

@AbelOsaretin

Description

Handle PENDING and NOT_FOUND statuses in the poll_until_confirmed loop. These are expected intermediate states during transaction confirmation.

Current Behavior

poll_until_confirmed in submit.rs matches on transaction status. PENDING and NOT_FOUND are handled by the default _ => arm, which logs and sleeps.

Desired Behavior

Explicitly match PENDING and NOT_FOUND with dedicated log levels:

  • PENDING: tracing::debug! with attempt count and next backoff
  • NOT_FOUND: tracing::debug! with attempt count — this is normal for very recent transactions
  • Both should continue the poll loop with exponential backoff

Implementation Details

In poll_until_confirmed, replace the _ => arm with explicit matches:

"PENDING" | "NOT_FOUND" => {
    tracing::debug!(
        hash,
        status = result.status,
        attempt,
        max_attempts = MAX_POLL_ATTEMPTS,
        next_backoff_ms = backoff_ms,
        "transaction still pending"
    );
    sleep_ms(backoff_ms).await;
    backoff_ms = (backoff_ms * 2).min(30_000);
}
  • Keep exponential backoff: 1s, 2s, 4s, ... capped at 30s
  • Max attempts: 10
  • Log at debug level (not warn — these are expected states)

Acceptance Criteria

  • PENDING status logs at debug level and continues polling
  • NOT_FOUND status logs at debug level and continues polling
  • Backoff doubles each attempt, capped at 30s
  • After MAX_POLL_ATTEMPTS, returns SubmitError::PollTimeout
  • Unit test: verify PENDING continues polling
  • Unit test: verify NOT_FOUND continues polling

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