livepeer / livepeer/livepeer-python-gateway
Payment responses are discarded instead of refreshing ticket params
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Python
- Star
- 1
- Fork
- 7
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
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.
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với LivePaymentSession.send_payment, PaymentSession.send_payment và đường dẫn post_empty. Đọc cách xử lý PaymentResult trong server/segment_rpc.go:241 và server/ai_http.go:533, sau đó so sánh với luồng refreshSessionIfNeeded của go-livepeer trong server/live_payment.go. Được xem là hoàn tất khi các phản hồi thanh toán cập nhật _payment_params mà không thực hiện retry phản ứng, hoặc khi việc loại bỏ có chủ ý và hành vi phản ứng được ghi lại.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- python
- Lĩnh vực
- api, backend
- Loại issue
- Tính năng
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 48/100