Skip to content

Propagate dynamic BYOC capability prices#3931

Open
its-DeFine wants to merge 2 commits into
livepeer:feat/remote-signer-byocfrom
its-DeFine:feat/byoc-dynamic-capability-pricing
Open

Propagate dynamic BYOC capability prices#3931
its-DeFine wants to merge 2 commits into
livepeer:feat/remote-signer-byocfrom
its-DeFine:feat/byoc-dynamic-capability-pricing

Conversation

@its-DeFine
Copy link
Copy Markdown

@its-DeFine its-DeFine commented May 9, 2026

Summary

  • Store BYOC external capability prices as *AutoConvertedPrice handles instead of *big.Rat snapshots.
  • Wire RegisterExternalCapability() to preserve the dynamic price handle created from price_per_unit, price_scaling, and currency.
  • Add regression tests proving oracle/feed updates change advertised BYOC prices without re-registering the capability.
  • Add BYOC gateway-token coverage proving two registered external capabilities return distinct dynamic prices through /process/token, and both update after a feed change.

Refs #3929.

This is the first working slice for per-capability oracle pricing: BYOC prices now remain live after registration and the gateway-visible token path sees the current price for each requested external capability. It does not yet add separate per-capability oracle/feed selection fields.

Verification

Run inside dedicated PC2 VM go-livepeer-byoc-usdc-20260509 with Go 1.26.3 and Livepeer-patched FFmpeg libavfilter 10.1.100:

go test ./byoc -run TestGetToken_GatewaySeesDistinctDynamicBYOCPrices -count=1 -v
go test ./byoc -count=1
go test ./core -run TestBYOCExternalCapsDynamicPriceUpdates -count=1

Passed:

=== RUN   TestGetToken_GatewaySeesDistinctDynamicBYOCPrices
--- PASS: TestGetToken_GatewaySeesDistinctDynamicBYOCPrices (0.01s)
PASS
ok  github.com/livepeer/go-livepeer/byoc  0.031s
ok  github.com/livepeer/go-livepeer/byoc  0.080s
ok  github.com/livepeer/go-livepeer/core  0.037s

Previous focused coverage also passed in the same VM:

go test ./core -run 'TestBYOCExternalCaps(DynamicPriceUpdates|PriceInfo|SenderPricing|PriceEdgeCases)|TestNewAutoConvertedPrice|TestAutoConvertedPrice_Update|TestExternalCapability_GetPrice' -count=1
go test ./byoc -count=1

Also checked broader go test ./core ./byoc -count=1; ./byoc passed, while ./core hits existing base-branch failure TestPriceInfo_GivenNilRecipient_ReturnsNilError. Verified the same focused failure exists on base commit a78e876ff6c97d935344643c2547d0f84d4b26dd, so it is not introduced by this PR.

@github-actions github-actions Bot added go Pull requests that update Go code AI Issues and PR related to the AI-video branch. labels May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Issues and PR related to the AI-video branch. go Pull requests that update Go code

Projects

No open projects
Status: Triage

Development

Successfully merging this pull request may close these issues.

1 participant