Skip to content

fix(solana): a settle whose outcome the gateway does not know is waited out, never "no charge" - #177

Merged
VickyXAI merged 1 commit into
mainfrom
fix/solana-settle-outcome-unknown
Oct 12, 2026
Merged

VickyXAI merged 1 commit into
mainfrom
fix/solana-settle-outcome-unknown

Conversation

@VickyXAI

Copy link
Copy Markdown
Contributor

Follow-up to #176, from its pre-merge review (Opus + Fable reviewer passes). #176 merged before this landed, so it ships separately. No version bump.

With #176 every finished video reaches the payment-signed path on its first paid poll. When that settle times out, sol.blockrun.ai answers 402 Payment settlement outcome unknown with Retry-After: 90 and holds the job's claim; other polls get settlement in progress on a concurrent poll. The helper ignored Retry-After, spent its 3 re-signs one poll interval apart (~15s into a 90s hold) and threw "no charge was made" while that payment could still land — the tool then booked nothing.

  • Held answers (isSettleHeld, classified on this answer's body and reason, never the remembered reason) honour Retry-After, re-sign with a fresh blockhash and do not spend the re-sign budget; the deadline bounds them. A later header-less 402 (Payment verification failed) still takes the bounded re-sign path.
  • Once a payment's outcome is open, every exit is a BilledJobError billing "unknown" — the deadline, a 500 poll answer, an unreadable challenge, a funding refusal of the fresh settle — so blockrun_video books the quote and says the job MAY have been charged.
  • A completion 402 whose challenge cannot be read falls back to payment-signed polling instead of aborting the finished job.
  • Music/image (settled at POST) never enter the held path; Base and the account rail are untouched.

Tests: 5 added in test/solana-poll-ownership.test.ts, each red against the pre-fix solana-402.ts. typecheck, build, CLI-load and brand checks pass; npm test 1419/1419.

…ed out, never "no charge"

Every finished video now reaches the payment-signed path on its first paid
poll (#176). When that settle times out, sol answers 402 "Payment settlement
outcome unknown" with Retry-After: 90 and holds the job's claim; other polls
get "settlement in progress on a concurrent poll". The helper ignored
Retry-After, spent its 3 re-signs one poll interval apart and threw "no
charge was made" inside the hold, while that payment could still land.

- Held answers (isSettleHeld, classified on THIS answer's body and reason,
  never the remembered reason) honour Retry-After, re-sign with a fresh
  blockhash and do not spend the re-sign budget; the deadline bounds them.
  A later header-less 402 ("Payment verification failed") still takes the
  bounded re-sign path.
- Once a payment's outcome is open, EVERY exit is a BilledJobError billing
  "unknown" — the deadline, a 500 poll answer, an unreadable challenge, a
  funding refusal of the fresh settle — so the tool books the quote and says
  the job MAY have been charged.
- A completion 402 whose challenge cannot be read falls back to
  payment-signed polling instead of aborting the finished job.

Tests: 5 added in test/solana-poll-ownership.test.ts; each is red against
the pre-fix solana-402.ts.
@VickyXAI
VickyXAI merged commit d7c097d into main Oct 12, 2026
3 checks passed
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