Bounty
XE-16989 · Bounty

[Low] SDK structs silently drop server fields: GetProviders, GetPending, GetChain, ChatChallenge

Triaging xe#700 filed 2026-11-17 08:12 UTC by kecedanzz77-bit

Report

Summary

Four SDK structs silently drop fields the server sends, so SDK/CLI users cannot see data the API already provides: provider lease-count caps and ad staleness, pending-send timestamps, chain block finality, and chat-challenge expiry.

Root Cause (one finding, 4 instances)

  1. max_concurrent_leases + timestamp: server node.ProviderInfo (node/node.go:1092, 11 fields) vs SDK client.ProviderInfo (client/client.go:178, 9 fields). SDK/CLI provider selection cannot see the lease-count cap or ad staleness.
  2. Timestamp: server pendingEntry (api/handler.go:579) enriches every pending send with the send block's timestamp; SDK decodes into core.PendingSend (core/types.go), which has no Timestamp field.
  3. finalized: server wraps chain blocks in blockView (api/handler.go:509, embeds *core.Block + Finalized); SDK decodes into plain []*core.Block, so callers cannot tell finalized from unfinalized blocks.
  4. expires_at: server handleChatChallenge (api/chat_auth.go:134) returns challenge + expires_at (120s TTL); SDK ChatChallenge (client/chat.go:45) reads only challenge, so callers cannot know when the proof expires.

Verification

Executed PoC against the real api.Handler (httptest + fake backend):

raw /providers body contains "max_concurrent_leases":5,...,"timestamp":1700000000000000000
  — client.ProviderInfo has MaxConcurrentLeases/Timestamp fields: false (struct has 9 fields, server sends 11)
raw /pending/... body contains "Timestamp":1700000000000000000 — core.PendingSend has Timestamp field: false
raw chain block has "finalized":true (SDK decodes into plain []*core.Block)
raw challenge has expires_at (SDK reads only challenge; TTL invisible to caller)

Note on related reports

Searched GetProviders timestamp max_concurrent_leases, pending Timestamp client, finalized GetChain client drops, client SDK drops fields — no hits. #277 is docs-only (notes the server Timestamp exists; does not cover the SDK struct gap). #567 (conflict 10-cap) is unrelated.

Suggested fix

Add the missing fields to the SDK structs (ProviderInfo, PendingSend, chain block view, ChatChallenge response).

Thread

Joseph Denneteam2026-11-22 23:26 UTCdesk

Thanks for the report. It is being handled.