feat(signer, orch): BYOC per-capability pricing and payment alignment#3977
Closed
eliteprox wants to merge 7 commits into
Closed
feat(signer, orch): BYOC per-capability pricing and payment alignment#3977eliteprox wants to merge 7 commits into
eliteprox wants to merge 7 commits into
Conversation
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.
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
…pricing-from-capabilities
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this pull request do? Explain your changes. (required)
OrchestratorInfo.CapabilitiesPriceswhen a matchingCapability_BYOCmodel constraint is present, instead of the flat base price.capabilitiesblob (ModelIDForCapability(Capability_BYOC)), matching how orch already advertises BYOC prices.lv2v(and BYOC with no matching price) → keep base price + pixel billing.capability/model_idstring fields toRemotePaymentRequest. Usage attribution already works when the gateway sends BYOC capabilities (see livepeer-python-gatewaybd8e780).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 capsTestGenerateLivePayment_ByocCapabilityPricing— per-cap seconds fee, 2:1 tariff ratio, unknown-cap fallback to base + pixels, doubling-guard not trippedHow did you test each of these updates (required)
Does this pull request close any open issues?
Checklist:
makeruns successfully./test.shpass