livepeer / livepeer/livepeer-python-gateway

Align pricing terminology: pixels_per_unit -> pricing_unit_size (track go-livepeer #3942)

Open Beginner friendly
#27 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Summary

Align the SDK's user-facing pricing terminology with go-livepeer, which is renaming the -pixelsPerUnit flag to -pricingUnitSize (see livepeer/go-livepeer#3942).

Background

pixelsPerUnit is really just a pricing scale factor: it is the number of work units that one quoted price covers, so price_per_work_unit = pricePerUnit / pixelsPerUnit. The "pixels" name is transcoding-era legacy and is confusing for non-video / BYOC / general-runner workloads, where there are no pixels.

go-livepeer#3942 introduces -pricingUnitSize as the primary flag and keeps -pixelsPerUnit as a deprecated alias. The wire/proto field (PriceInfo.pixelsPerUnit) is intentionally left unchanged for compatibility.

What to change in this SDK

User-facing terminology only — the generated proto field stays pixelsPerUnit:

  • examples/get_orchestrator_info.py
    • JSON dict key pixels_per_unit -> pricing_unit_size (snake_case analog of pricingUnitSize).
    • Text output ... wei per N pixel(s) -> ... wei per N work unit(s).
    • Keep reading the wire field via info.price_info.pixelsPerUnit.

Out of scope

  • src/livepeer_gateway/lp_rpc_pb2.py is generated from the proto and carries the wire field pixelsPerUnit; do not hand-edit it.

Related

  • go-livepeer#3942 (flag rename)
  • In-flight PR #20 (ja/live-runner) introduced a related unit_scale concept; it should adopt the same pricing_unit_size name for consistency.

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 examples/get_orchestrator_info.py and inspect how info.price_info.pixelsPerUnit is read. Rename the user-facing JSON key and pixel wording to pricing_unit_size and work units, while leaving src/livepeer_gateway/lp_rpc_pb2.py unchanged; done means the example uses the new terminology without changing the wire field.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Refactor
Difficulty
1/5
Estimated time
Under an hour
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.