livepeer / livepeer/livepeer-python-gateway

Payment responses are discarded instead of refreshing ticket params

Open
#55 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1
Forks
7
PR merge metrics
No merged PRs in 30d

Description

Both payment senders POST and throw the response away:

  • LivePaymentSession.send_payment (now via post_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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with LivePaymentSession.send_payment, PaymentSession.send_payment, and the post_empty path. Read the PaymentResult handling in server/segment_rpc.go:241 and server/ai_http.go:533, then compare it with go-livepeer's server/live_payment.go refreshSessionIfNeeded flow. Done means either payment responses refresh _payment_params without the reactive retry, or the deliberate discard and reactive behavior are documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.