livepeer / livepeer/livepeer-python-gateway
Payment responses are discarded instead of refreshing ticket params
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 1
- Forks
- 7
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
Both payment senders POST and throw the response away:
LivePaymentSession.send_payment(now viapost_empty)PaymentSession.send_payment(sync, lv2v path)
The orchestrator answers with a protobuf net.PaymentResult{Info: OrchestratorInfo} carrying refreshed ticket params — see Payment (server/segment_rpc.go:241) and PaymentForLiveRunnerSession (server/ai_http.go:533), which build oInfo and reuse the existing auth token. PaymentResult is never referenced in the SDK outside the generated protobuf module.
go-livepeer's own gateway applies it: livePaymentSender.SendPayment (server/live_payment.go:62-145) calls refreshSessionIfNeeded before every payment and folds the returned Info back in, refreshing at ~90% of the 30-minute auth-token validity.
The SDK instead recovers reactively: stale params make the signer return HTTP 480, get_payment catches SignerRefreshRequired and calls _refresh_payment_params against the orchestrator's /refresh-payment, bounded by max_refresh_retries.
So this is not a correctness bug — it costs one failed payment per refresh cycle (roughly one per 30 minutes at the current cadence), and it has been the behaviour on the lv2v path in production. Filing it because absorbing the response is strictly cheaper than round-tripping /refresh-payment after a failure, and because a reader of post_empty should know the discard is deliberate.
Worth deciding whether to parse PaymentResult and update _payment_params in place, or to keep the reactive path and document it. Pre-existing; not introduced by #53.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit LivePaymentSession.send_payment, PaymentSession.send_payment und dem post_empty-Pfad. Lies die Verarbeitung von PaymentResult in server/segment_rpc.go:241 und server/ai_http.go:533 und vergleiche sie mit dem refreshSessionIfNeeded-Ablauf von go-livepeer in server/live_payment.go. Erledigt ist die Aufgabe, wenn entweder Zahlungsantworten _payment_params ohne den reaktiven Wiederholungsversuch aktualisieren oder das absichtliche Verwerfen und das reaktive Verhalten dokumentiert sind.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- api, backend
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Ruhig
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 48/100