feat: prove accepted trades in the background ping loop - #417
Open
Step7750 wants to merge 4 commits into
Open
Conversation
- alarms/accepted_trade.ts: findAcceptedTrades (seller-side, mirrors nezha/phoenix predicate) + pingAcceptedTrades - gated on meta/notary accepted.background; per-trade 6h retry throttle since the alarm runs every 3 minutes - shared isBackgroundNotaryEnabled for rollback/accepted meta lookups - Trade.accepted_proof_verified_at; unit tests
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
/v1/meta/notaryaccepted.background; Firefox excluded as before.Closes CSF-1969
Note
Medium Risk
Extends background notary proving for marketplace trades; logic must stay aligned with server matching rules, but changes are gated on meta flags and throttled retries.
Overview
The periodic CSFloat trade ping now notarizes accepted sales in the background, parallel to existing rollback and failed-trade handling.
A new
accepted_trademodule matches pending seller sales to Steam history (committed/complete, in trade protection, asset sent to buyer, latest attempt wins over rollbacks) and skips trades already marked withnotary_accepted_at. Proof runs only whenaccepted.backgroundis enabled in notary meta (Firefox still excluded), with a 6-hour per-trade retry viaNOTARY_ACCEPTED_PROOF_ATTEMPTSso declined proofs are not retried every ~3-minute alarm tick, plus the existing 60-minute backoff after a background proof failure.notary.tsgeneralizes the background feature-flag check for both rollback and accepted.SlimTradegains optionalnotary_accepted_atfor client-side eligibility. Unit tests cover matching edge cases and retry filtering.Reviewed by Cursor Bugbot for commit eb9809b. Bugbot is set up for automated code reviews on this repo. Configure here.