Skip to content

feat: prove Steam trade offer state via notary for buyer-side trades - #418

Open
Step7750 wants to merge 11 commits into
masterfrom
feat/csf-1979-notary-offer-state
Open

feat: prove Steam trade offer state via notary for buyer-side trades#418
Step7750 wants to merge 11 commits into
masterfrom
feat/csf-1979-notary-offer-state

Conversation

@Step7750

@Step7750 Step7750 commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Buyers now submit a notarized GetTradeOffer(s) proof for pending trades when the offer state they see on Steam differs from CSFloat's, or the trade is waiting on a cancel ping. Lets the offer state update from verified data when the seller is offline.
  • Skips offers changed in the last 5 minutes and accepted offers; batches multiple candidates into one proof.
  • Reuses the alarm's existing GetTradeOffers fetch; runs after other telemetry and shares the background notary failure cooldown.
  • Gated behind the offer_state notary meta flag.

Ref CSF-1979


Note

Medium Risk
Changes trade alarm ordering and when cancel vs notarized state signals fire, which can affect pending-trade resolution; gated by server meta and existing failure backoff.

Overview
Adds buyer-side background notary proofs so CSFloat can refresh Steam offer state from trusted GetTradeOffer(s) data when what the buyer sees on Steam disagrees with the server, or when a trade is wait_for_cancel_ping and the offer is no longer active. Seller-side proving is intentionally omitted because existing sent-offer pings already cover that path.

The trade-status alarm now makes one shared GetTradeOffers Steam call per run and passes it into sent-offer pings, cancel pings, and offer-state proving (fewer duplicate API hits). Order matters: rollback/failed/history telemetry still run first; proveBuyerOfferStates runs next so notarized state can land before the untrusted cancel ping; cancel pings moved to the end of that block.

New offer_state module encodes candidate selection (5-minute minimum age so seller telemetry gets first chance, skip accepted offers, batch multi-offer proofs) and reuses the existing background notary failure cooldown. Notary plumbing is generalized via submitNotaryProof, isBackgroundNotaryOfferStateEnabled, and offer_state on notary meta. SteamOffer gains optional updated_at / notarized_at fields for timing metadata.

Reviewed by Cursor Bugbot for commit b5c76ef. Bugbot is set up for automated code reviews on this repo. Configure here.

@Step7750
Step7750 requested a review from GODrums September 4, 2026 03:34

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit b5c76ef. Configure here.

} catch (e) {
console.error('failed to ping sent trade offer state', e);
errors.trade_offer_error = (e as any).toString();
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seller offer ping lost HTML fallback

Medium Severity

The alarm now drives pingSentTradeOffers from getSentAndReceivedTradeOffersFromAPI only. That path treats an empty Steam body as success and never clears a bad token or falls back to HTML, so seller offer telemetry can stop silently when GetTradeOffers returns nothing.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit b5c76ef. Configure here.

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