Skip to content

Payment responses are discarded instead of refreshing ticket params #55

Description

@rickstaa

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions