Skip to content

feat(signer, orch): BYOC per-capability pricing and payment alignment#3977

Closed
eliteprox wants to merge 7 commits into
feat/add-model-id-signer-kafkafrom
feat/byoc-per-cap-pricing-from-capabilities
Closed

feat(signer, orch): BYOC per-capability pricing and payment alignment#3977
eliteprox wants to merge 7 commits into
feat/add-model-id-signer-kafkafrom
feat/byoc-per-cap-pricing-from-capabilities

Conversation

@eliteprox

@eliteprox eliteprox commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

What does this pull request do? Explain your changes. (required)

  • Remote signer always charges BYOC live payments from OrchestratorInfo.CapabilitiesPrices when a matching Capability_BYOC model constraint is present, instead of the flat base price.
  • Keys price resolution on the existing request capabilities blob (ModelIDForCapability(Capability_BYOC)), matching how orch already advertises BYOC prices.
  • BYOC with a usable cap price → bill compute-seconds at that rate. Native lv2v (and BYOC with no matching price) → keep base price + pixel billing.
  • Does not add capability / model_id string fields to RemotePaymentRequest. Usage attribution already works when the gateway sends BYOC capabilities (see livepeer-python-gateway bd8e780).
    This is the minimal pricing half of what feat(signer): BYOC per-capability pricing + real capability/model usage labels #3972 bundled with a redundant request-format change for usage labels.

Test plan

  • TestResolveByocPrice — match / fallback / invalid-duplicate skip, keyed off BYOC caps
  • TestGenerateLivePayment_ByocCapabilityPricing — per-cap seconds fee, 2:1 tariff ratio, unknown-cap fallback to base + pixels, doubling-guard not tripped
  • Confirm live-runner payments with BYOC capabilities bill at the advertised per-cap rate on a signer build of this branch

How did you test each of these updates (required)

go test -tags=mainnet,experimental ./server/ -run 'TestResolveByocPrice|TestGenerateLivePayment_Byoc' -count=1

Does this pull request close any open issues?

Checklist:

eliteprox added 4 commits July 9, 2026 17:10
Resolve per-capability BYOC fees from the orchestrator's advertised
CapabilitiesPrices, keyed on Capability_BYOC constraints already present
in the request capabilities blob. No RemotePaymentRequest format change.

Gated behind default-OFF -byocPerCapPricing. When OFF or no usable cap
price matches, behavior stays on the base-price / lv2v pixel path.
Select the pricing basis from the request capability type rather than
req.Type: a BYOC capability is charged per-capability over compute-seconds,
while lv2v (and everything else) keeps its existing pricing. Since BYOC
jobs always send type:"lv2v", the capability in the request is the real
signal; resolveByocPrice returns nil for non-BYOC caps so lv2v is unchanged.

Extract the per-capability price lookup into a shared findCapPriceInfo
helper reused by resolveByocPrice and remote_discovery capabilityPrice.
The requirePositiveRate flag preserves each caller's semantics (signer
skips non-positive rates and keeps scanning; discovery allows a zero/free
rate on first match).
Eliminate the ByocPerCapPricing configuration option from the LivepeerConfig structure and its associated logic throughout the codebase. Update related tests to reflect the change in naming and functionality, ensuring consistency in pricing behavior for live payments.
@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5a8ffb12-bd40-46ed-8222-45822f7dd208

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/byoc-per-cap-pricing-from-capabilities

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the go Pull requests that update Go code label Jul 10, 2026
@eliteprox eliteprox changed the title Feat/byoc per cap pricing from capabilities feat(signer): BYOC per-capability pricing from existing capabilities Jul 10, 2026
@eliteprox eliteprox changed the title feat(signer): BYOC per-capability pricing from existing capabilities feat(signer): always apply BYOC per-capability pricing Jul 10, 2026
@eliteprox eliteprox changed the title feat(signer): always apply BYOC per-capability pricing feat(signer): BYOC per-capability pricing from existing capabilities Jul 10, 2026
Issue TicketParams at the same GetPriceForJob rate used for BYOC
execution so Payment.ExpectedPrice matches recipientRandHash.
Keep OrchestratorInfo.PriceInfo as the sole rate for ExpectedPrice,
require explicit inPixels for non-lv2v jobs, and sign BYOC jobs as
request+parameters for current network orchestrators.
@eliteprox eliteprox changed the title feat(signer): BYOC per-capability pricing from existing capabilities feat(signer, orch): BYOC per-capability pricing from existing capabilities Jul 10, 2026
@eliteprox eliteprox changed the title feat(signer, orch): BYOC per-capability pricing from existing capabilities feat(signer, orch): BYOC per-capability pricing and payment alignment Jul 10, 2026
@eliteprox eliteprox closed this Jul 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go Pull requests that update Go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant