Skip to content

fix(byoc): use gRPC for PM ticket generation#5

Open
seanhanca wants to merge 2 commits intofeat/support-byoc-batchfrom
fix/payment-for-byoc
Open

fix(byoc): use gRPC for PM ticket generation#5
seanhanca wants to merge 2 commits intofeat/support-byoc-batchfrom
fix/payment-for-byoc

Conversation

@seanhanca
Copy link
Copy Markdown

Summary

  • Get OrchestratorInfo via gRPC (port 8935) instead of expecting it from /process/token which never returns it
  • Change payment type from "byoc" to "lv2v" since the signer only accepts lv2v for auto pixel calculation
  • Add urlparse import for deriving gRPC URL from BYOC HTTP origin

Root Cause

BYOC payment was silently skipped because _create_byoc_payment() expected an orchestrator_info field from the /process/token response, but the BYOC orch never includes it. The SDK logged "BYOC token missing orchestrator_info, trying without payment" and sent jobs without PM tickets — making all BYOC inference free.

Fix

Use the same gRPC get_orch_info() call that LV2V uses to get the serialized OrchestratorInfo protobuf, then pass it to the signer's /generate-live-payment endpoint. The BYOC orch serves gRPC on port 8935 (via Caddy) alongside its HTTP API on port 8936.

Verified on staging

  • BYOC jobs generate PM tickets: faceValue=2413920000000000 WEI, Signed numTickets=1
  • Signer tracks balance: oldBalance → newBalance
  • Orch returns non-zero Livepeer-Balance header
  • Requires companion config change: livepeer/simple-infra#24 (set price_per_unit to wei value)

Test plan

  • Run BYOC job against staging with signer, verify PM tickets in signer logs
  • Verify Livepeer-Balance header is non-zero in response
  • Verify no regression on BYOC jobs without signer (offchain mode)

🤖 Generated with Claude Code

seanhanca and others added 2 commits April 23, 2026 14:18
BYOC payment was broken because _create_byoc_payment() expected an
orchestrator_info field from /process/token, which the BYOC orch
never returns. This meant no PM tickets were ever generated.

Fix: get OrchestratorInfo via gRPC on port 8935 (same mechanism LV2V
uses), serialize it, and pass to signer /generate-live-payment. Also
change payment type from "byoc" to "lv2v" since the signer only
accepts that type for auto pixel calculation.

Verified on staging: BYOC jobs now generate PM tickets with
faceValue=2413920000000000 WEI, signer signs and tracks balance.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add Livepeer-Capability header to /generate-live-payment requests so
the signer forwards it to the remote signer webhook
(api.daydream.live/webhooks/remote-signer). This lets Daydream know
which capability (e.g. flux-dev, nano-banana) was used and bill
accordingly — no go-livepeer changes needed since r.Header is already
forwarded to the webhook body.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant