livepeer / livepeer/livepeer-python-gateway

Payment responses are discarded instead of refreshing ticket params

未关闭
#55 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
Python
星标
1
派生
7
PR 合并指标
30 天内没有已合并 PR

描述

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.

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 LivePaymentSession.send_payment、PaymentSession.send_payment 和 post_empty 路径开始。阅读 server/segment_rpc.go:241 和 server/ai_http.go:533 中对 PaymentResult 的处理,然后将其与 go-livepeer 的 server/live_payment.go 中的 refreshSessionIfNeeded 流程进行比较。完成的标准是:支付响应在不进行反应式重试的情况下刷新 _payment_params,或者记录下有意丢弃和反应式行为。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
api, backend
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
48/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。