live runner: metered session dies after ~600 tickets because ticket params are never rotated
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 76/100
Direzione di ricerca
Inizia in src/livepeer_gateway/remote_signer.py leggendo send_payment(), _payment_request() e run_payments(); confronta il loro comportamento con i dettagli della risposta e del flusso di aggiornamento descritti qui. Usa live-runner-test/realtime_transcription_soak.py per riprodurre il problema della sessione. Il lavoro è completato quando i pagamenti riusciti mantengono aggiornati i parametri del ticket o si riprendono da un nonce del mittente non valido, e le sessioni lunghe non terminano più al raggiungimento del limite del nonce.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
A metered live-runner session dies after ~600 signed tickets because the SDK reuses the ticket params from the original 402 challenge for the session's whole life. The orchestrator's recipient caps distinct sender nonces per recipientRand at 600 (pm/recipient.go:26, maxSenderNonces), so once that many tickets have been signed against one params set, every further payment is rejected:
HTTP 400 ... body='invalid ticket senderNonce: too many values sender=0x491F...E0DB nonce=611'
The SDK retries the same doomed nonce sequence, the orchestrator releases the session a few seconds later, and the stream ends.
How fast this happens is set by the orchestrator's ticketEV, not by anything the client controls: tickets per payment is fee / ticketEV. Measured against two orchestrators serving livepeer-example/realtime-transcription at the same price (73562861230 wei/s):
| orch | faceValue | winProb | ticketEV | tickets/payment | 600 reached after |
|---|---|---|---|---|---|
0xdc28F2… |
1.196e15 | 8.361e-04 | 1e12 wei | 1.0 | ~600 payments (~30 min) |
0x9727b4… |
1.196e15 | 8.361e-06 | 1e10 wei | 30.4 | ~20 payments (~60 s) |
Both configurations are legal. Payment cadence is irrelevant: total tickets is spend / ticketEV however you batch them.
Root cause
src/livepeer_gateway/remote_signer.py (same on main and rs/live-runner-session-payments):
send_payment()POSTs to the session payment URL and discards the response (_post_empty, line 273). go-livepeer returnsPaymentResult{Info: oInfo}on every successful payment (server/ai_http.go:569), and thatOrchestratorInfocarries freshTicketParamswith a new seed — i.e. a newrecipientRandthat would reset the nonce map._payment_request()always sends"orchestrator": self._challenge.payment_params, the params from the initial 402, for the entire session.run_payments()treats any 4xx except 408/429 as fatal, so the nonce error stops funding instead of refreshing.
Refresh is wired up, but only for one trigger: the signer returns HTTP 480 when it knows params expired, raising SignerRefreshRequired → POST /refresh-payment. The 600-nonce cap is a recipient-side limit the signer cannot see, so it never fires. That is why the 1e12 ticketEV orchestrator survives: its params expire (40 blocks) and get refreshed before 600 tickets accumulate. It is timing, not correctness — a long enough session there fails identically.
Fix
- Preferred: consume
PaymentResult.Info.TicketParamsfrom each successful payment and use it for the next cycle. Matches what the orchestrator already sends and is safe at anyticketEV. - Minimum: treat
invalid ticket senderNonceliketicketparams expired— call/refresh-paymentand retry. go-livepeer's own gateway does exactly this (server/ai_process.go:1556,isInvalidTicketSenderNonce).
Reproduction
24h WebSocket soak of livepeer-example/realtime-transcription, one held session streaming 16 kHz PCM, signer at a $0.50/hour cap:
- against the
1e10ticketEV orchestrator: 200 sessions in 5.2h, lifetimes median 87s / min 86s / max 88s, first payment failure at a constant +67s, 1,182 payment failures, 197 forced reconnects. Deterministic, not flaky. - against the
1e12ticketEV orchestrator: 1 session, unbroken 5.17h, 4TicketParams expiredfailures, all self-recovered.
The socket itself never faulted in either lane: 0 stalls, 0 transcript gaps, 0 socket errors across 9.9h of streaming. The only failure mode is payments.
Harness: live-runner-test/realtime_transcription_soak.py.
- Lingua principale
- Python
- Stelle
- 1
- Fork
- 8
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di livepeer/livepeer-python-gateway
-
call_runner rejects a top-level JSON array, so a runner cannot pass one throughForse già presa @rickstaa l’ha presa 51 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
livepeer/livepeer-python-gateway#64 · 1 commento ·
-
Align pricing terminology: pixels_per_unit -> pricing_unit_size (track go-livepeer #3942)Forse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. ApertaImprovement
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
livepeer/livepeer-python-gateway#27 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
trickle_publisher: `_resolve_next_seq` fallback drops first video segment + logs noisy warningForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 70/100
livepeer/livepeer-python-gateway#12 · 1 commento ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
livepeer/livepeer-python-gateway#70 · 2 commenti ·
Tutte le issue di livepeer/livepeer-python-gateway
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
Deepak3699/Ai_Mentor#244 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
btclib-org/btclib-node#1880 ·
I maintainer di solito rispondono entro 1 giorno
-
CONTRIBUTING.md: say how ticketless bug fixes and feature PRs are handledForse già presa @khuisman l’ha presa oggi. Apertav0.9.2
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 84/100
khuisman/mcp-gee-sweet#941 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
pyjanitor-devs/pyjanitor#1758 ·
I maintainer di solito rispondono entro 1 giorno
-
bug ready for review
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
odysseus-dev/odysseus#6641 ·
I maintainer di solito rispondono entro 1 giorno