Skip to content

fix(byoc): per-signer payment type (dual-path) — rescue from prod image into ja/live-runner#46

Merged
seanhanca merged 1 commit into
ja/live-runnerfrom
fix/byoc-dual-path-payment
Jul 18, 2026
Merged

fix(byoc): per-signer payment type (dual-path) — rescue from prod image into ja/live-runner#46
seanhanca merged 1 commit into
ja/live-runnerfrom
fix/byoc-dual-path-payment

Conversation

@seanhanca

Copy link
Copy Markdown
Contributor

Why

The production SDK (sdk-service:byoc-dual-path-1bf13cd) carries a load-bearing byoc-payment fix that exists in no branch — only in the running container. That's an operational liability and it blocks a unified gateway. This ports it onto ja/live-runner (the Live Runner + Scope branch, PR #20 → main) so the consolidated gateway keeps BYOC payment working while gaining LR.

What

  • _payment_type_for_signer(signer_url)legacy Daydream signer (signer.daydream.live) → type:"lv2v" + string capability; modern signers (pymthouse DMZ, …) → type:"byoc" + BYOC capabilities protobuf.
  • _create_byoc_payment — assemble the payment payload + orch-discovery capabilities per the resolved type.
  • capabilities.pyCapabilityId.BYOC + byoc_capabilities_from_app().

Two files, +52/−9. Byte-identical to what runs in prod today.

Relationship to #41

PR #41 sends type:"byoc" unconditionally and depends on an undeployed go-livepeer signer+orch change. Against signer.daydream.live (which only accepts lv2v today) that reproduces the 2026-07-13 “invalid job type” outage. This PR is the superset: per-signer switching keeps the legacy signer working and enables modern signers. Recommend closing #41 in favor of this.

Follow-on

The same per-signer type logic generalizes to the live-runner payment path, which will let us drop the lr-gateway lv2v workaround once this lands.

Test

  • python -m py_compile (passes locally)
  • submit_byoc_job against signer.daydream.livetype:lv2v → 200 (no regression)
  • submit_byoc_job against a modern signer → type:byoc + caps proto → 200

🤖 Generated with Claude Code

The production SDK build (sdk-service:byoc-dual-path-1bf13cd) carries a
load-bearing byoc-payment fix that exists in NO branch — only in the running
container. This ports it onto ja/live-runner so the unified gateway keeps BYOC
payment working (and stops the fix living only as a deployed image).

- `_payment_type_for_signer(signer_url)`: legacy Daydream signer
  (signer.daydream.live) → type:"lv2v" + string `capability`; modern signers
  (pymthouse DMZ, …) → type:"byoc" + BYOC capabilities protobuf.
- `_create_byoc_payment`: build the payment payload + orch-discovery
  capabilities per the resolved type.
- `capabilities.py`: `CapabilityId.BYOC` + `byoc_capabilities_from_app()`.

Why this over #41: #41 sends type:"byoc" unconditionally and depends on an
undeployed go-livepeer signer+orch change — against signer.daydream.live (which
only accepts lv2v today) that reproduces the 2026-07-13 "invalid job type"
outage. This per-signer switch is the superset that keeps the legacy signer
working while allowing modern signers. It also generalizes to the live-runner
payment path (removing the lr-gateway lv2v workaround).

Verified: byte-identical to the code running in prod today.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

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: 917967a3-fac7-4f09-9234-61d02f9274d9

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 fix/byoc-dual-path-payment

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.

@seanhanca
seanhanca merged commit 4e46379 into ja/live-runner Jul 18, 2026
1 check passed
@seanhanca
seanhanca deleted the fix/byoc-dual-path-payment branch July 18, 2026 06:06
seanhanca added a commit that referenced this pull request Jul 18, 2026
…ibling to #46) (#47)

Sibling to #46. #46 gives the **BYOC** payment path a per-signer
dual-path; this gives the **Live Runner** payment path the same, so
selecting an LR runner doesn't break payment on the default (Daydream)
signer.

## The bug
`_get_runner_payment` (live_runner.py) hardcoded `type="live"` for every
non-scope runner. `signer.daydream.live` only accepts `lv2v` → **`400
invalid job type`** → LR payment fails. The `lr-gateway` `lv2v` patch
only fixed the isolated sidecar; the gateway itself was still broken for
LR + Daydream. Without this, the transparent-routing plan's **Scenario 1
(Daydream + LR) breaks**.

## The fix
- Canonical `_payment_type_for_signer` moved to **`remote_signer.py`**
(the module that owns `LivePaymentSession`) so **both** payment paths
share it and LR does **not** import the soon-deprecated `byoc.py`.
Legacy Daydream → `lv2v`; modern signers → `byoc`.
- `_get_runner_payment`: Scope/LV2V stays `lv2v`; every other runner
uses the per-signer switch.

Two files, +28/−2. Both compile.

## Verified
Generalizes the exact fix proven on-chain via the lr-gateway `lv2v`
patch: LR single-shot + Daydream signer → `Payment tickets processed,
totalTickets=1` on Arbitrum.

## Follow-up
Once #46 merges, `byoc.py`'s local `_payment_type_for_signer` copy
should import this canonical one (trivial dedup) — the two PRs touch
disjoint files so they merge without conflict.

## Test
- [ ] `py_compile` (passes locally)
- [ ] LR + Daydream signer → `type:lv2v` → ticket redeems (the
Scenario-1 gate)
- [ ] LR + modern signer → `type:byoc` (gated on the pymthouse upstream
fix + orch byoc-single-shot verification)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.8 <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