livepeer / livepeer/go-livepeer

Live runner: rename internal pixel terminology to pricing/time units (follow-up to #3952, #3942)

Open
#3,953 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

tech debt
Dominant language
Go
Stars
586
Forks
226
Avg merge
1d 17h
Merged PRs (30d)
19

Description

Context

After livepeer/go-livepeer#3952 the live runner is priced and metered per second of compute (nanoseconds), and livepeer/go-livepeer#3942 renames the user-facing -pixelsPerUnit flag to -pricingUnitSize. The internal code on the live runner path still uses "pixels" terminology (PixelsPerUnit, inPixels, pixels), which is now a misnomer: the metered quantity is time, not pixels. It only remains for wire compatibility and leftover naming.

Why

Readability and consistency. A developer reading the live runner pricing/payment code sees pixels for what is actually per-second / nanosecond metering, and the names diverge from the pricingUnitSize terminology adopted in livepeer/go-livepeer#3942. This is a naming/cleanup task with no behavior change.

Scope: live-runner-specific (safe to rename)

  • ai/runner/live_runner.go: LiveRunnerPriceInfo.PixelsPerUnit and its JSON tag pixels_per_unit -> PricingUnitSize / pricing_unit_size; the converter and convertedPriceInfo locals.
  • SDK livepeer-python-gateway live_runner.py: the pixels_per_unit dataclass field -> pricing_unit_size (aligns with livepeer/livepeer-python-gateway#27).
  • server/remote_signer.go live runner (lv2v) path: the local pixels variable, the InPixels field / inPixels JSON tag and its "Number of pixels..." comment, and the "pixels" metrics label.

Shared / wire: needs coordination (likely separate)

  • server/live_payment.go (calculateFee(inPixels, ...), inPixels fields) and server/live_payment_processor.go (processSegmentFunc(inPixels int64)) are shared with the realtime-AI / transcoding payment paths; rename only if done across all callers.
  • net.PriceInfo.pixelsPerUnit (proto field 2) is the wire field shared across transcoding/AI. This is the coordinated, versioned rename already noted as a follow-up in ENG-113 and is out of scope here.

Preconditions (do not start until merged)

  • livepeer/go-livepeer#3952 merged (per-second live runner pricing).
  • livepeer/go-livepeer#3942 merged (-pricingUnitSize flag).

Related: ENG-113 (pricing flag/term rename).

Contributor guide

Open the contributing guide

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

Wait for go-livepeer#3952 and #3942 to merge, then inspect ai/runner/live_runner.go, live_runner.py in the livepeer-python-gateway SDK, and the live-runner path in server/remote_signer.go. Rename only the listed live-runner-specific identifiers and comments, preserve shared wire fields and payment paths, and confirm the changes are naming-only with no behavior change.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.