feat: prove Steam trade offer state via notary for buyer-side trades - #418
Open
Step7750 wants to merge 11 commits into
Open
feat: prove Steam trade offer state via notary for buyer-side trades#418Step7750 wants to merge 11 commits into
Step7750 wants to merge 11 commits into
Conversation
Buyers prove GetTradeOffer when their view diverges from CSFloat's offer state; either party proves when a trade waits on a cancel ping. Gated by the offer_state notary meta flag. Ref CSF-1979
…d cancel ping; batch GetTradeOffers unfiltered
…tch fails instead of refetching
…ays telemetry pings
… already cover the rest
…ing wait covers it
…ailure cooldown like other provers
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ 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(); | ||
| } |
There was a problem hiding this comment.
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)
Reviewed by Cursor Bugbot for commit b5c76ef. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
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.GetTradeOffersfetch; runs after other telemetry and shares the background notary failure cooldown.offer_statenotary 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 iswait_for_cancel_pingand 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
GetTradeOffersSteam 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;proveBuyerOfferStatesruns next so notarized state can land before the untrusted cancel ping; cancel pings moved to the end of that block.New
offer_statemodule 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 viasubmitNotaryProof,isBackgroundNotaryOfferStateEnabled, andoffer_stateon notary meta.SteamOffergains optionalupdated_at/notarized_atfields for timing metadata.Reviewed by Cursor Bugbot for commit b5c76ef. Bugbot is set up for automated code reviews on this repo. Configure here.