Skip to content

Size payment tickets per job by default - #114

Draft
j0sh wants to merge 9 commits into
mainfrom
ja/ev
Draft

j0sh wants to merge 9 commits into
mainfrom
ja/ev

Conversation

@j0sh

@j0sh j0sh commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator

Node sizes payment tickets by default for all paid sessions. At the funded face value, fixed-price jobs use the fewest tickets that cover the quote within the signer limits. Metered tickets target three seconds of quoted usage while the signer bills elapsed time and applies carried credit.

TicketFaceValue sets the baseline winning payout. The example uses 0.0024 ETH based on recent Arbitrum redemption receipts. On Arbitrum One, payouts must exceed the fixed 0.000012 ETH redemption estimate. Node caps the payout by payer funding and derives the odds from the job's EV. Receipt admission checks funding and queue space for the full signed batch.

Fixes #91
Fixes #101

Split fixed-price quotes across the fewest tickets that fit the signer’s
limits. For metered jobs, target three seconds of quoted usage per ticket
and keep billing based on elapsed time and carried credit.

Size the winning payout from recent redemption fees and payer funding,
then derive the odds from ticket EV. Ensure the payer’s reserve can cover
every ticket winning in the fixed-price or metered opening batch.
j0sh added 2 commits December 4, 2026 19:02
Base the Arbitrum example on finalized redemption costs. Remove fee sampling and the public estimate route while retaining quote-based EV and payer funding checks.
@j0sh
j0sh requested a balanced review from Copilot December 5, 2026 03:04
@j0sh
j0sh temporarily deployed to docker-publish December 5, 2026 03:07 — with GitHub Actions Inactive
@j0sh
j0sh temporarily deployed to docker-publish December 5, 2026 03:07 — with GitHub Actions Inactive
@j0sh
j0sh temporarily deployed to docker-publish December 5, 2026 03:07 — with GitHub Actions Inactive
@j0sh
j0sh temporarily deployed to docker-publish December 5, 2026 03:07 — with GitHub Actions Inactive

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Ticket sizing rejects valid exact-limit quotes due to rounding, while a settlement race can overstate available reserve and produce terms that fail receipt-time funding checks.

2 open issues
What changed in this PR

Makes job-specific ticket sizing the default for paid sessions, adapting payouts and odds to payer funding and signer limits.

Changes:

  • Sizes fixed-price and metered tickets from quoted usage.
  • Adds recipient reserve checks and shared payment constants.
  • Updates configuration, documentation, and tests.
File Description
signer/​payment.go Uses shared opening-duration constant.
signer/​payment_test.go Tests adaptive quotes and signer payments.
redemption/​state.go Adds recipient-specific liability queries.
redemption/​redeemer_db.go Checks reserve during receipt storage.
redemption/​redeemer_db_test.go Tests winning-ticket reserve checks.
redemption/​http_test.go Checks unsupported fee-estimate route.
pm/​remotepayment.go Defines shared payment limits.
pm/​payerpolicy.go Uses shared batch limit.
orchestrator/​ticket_sizing.go Implements funding-aware ticket sizing.
orchestrator/​ticket_sizing_test.go Tests sizing and funding limits.
orchestrator/​redemption.go Passes funding into receipt storage.
orchestrator/​payment.go Handles challenge funding errors.
orchestrator/​payment_engine.go Integrates adaptive quotes and receipt checks.
orchestrator/​metrics.go Classifies unpayable quotes as rejected.
orchestrator/​metrics_test.go Updates receipt-storage test arguments.
orchestrator/​app.go Enables adaptive sizing and configuration.
orchestrator/​app_test.go Verifies adaptive startup parameters.
docs/​orchestrator.md Documents sizing and funding semantics.
configs/​orchestrator/​config.example.toml Updates commented payment configuration examples.
cmd/​livepeer/​testdata/​cli/​orchestrator-help.golden Updates expected sizing flag help.

Review effort: Balanced

Comment thread orchestrator/ticket_sizing.go Resolved
Comment thread orchestrator/ticket_sizing.go Resolved
Check the collateral watermark with pending liability before quoting. If normal quotes fail at a signer ceiling, use the largest funded face value that can encode the exact EV.
@j0sh
j0sh requested a balanced review from Copilot December 5, 2026 03:22
@j0sh
j0sh temporarily deployed to docker-publish December 5, 2026 03:25 — with GitHub Actions Inactive
@j0sh
j0sh temporarily deployed to docker-publish December 5, 2026 03:25 — with GitHub Actions Inactive
@j0sh
j0sh temporarily deployed to docker-publish December 5, 2026 03:25 — with GitHub Actions Inactive
@j0sh
j0sh temporarily deployed to docker-publish December 5, 2026 03:26 — with GitHub Actions Inactive

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Ticket sizing can return two tickets when one valid smaller-face ticket suffices, and adaptive challenge and refresh failure paths lack regression coverage.

2 open issues
2 resolved since last review

Review effort: Balanced

Comment thread orchestrator/ticket_sizing.go Resolved
Comment thread orchestrator/ticket_sizing.go Resolved
Check failed challenge and refresh responses over HTTP. Clarify that fixed quotes keep the funded face value when a batch fits within signer limits.
@j0sh
j0sh requested a balanced review from Copilot December 5, 2026 03:31
@j0sh
j0sh temporarily deployed to docker-publish December 5, 2026 03:34 — with GitHub Actions Inactive
@j0sh
j0sh temporarily deployed to docker-publish December 5, 2026 03:35 — with GitHub Actions Inactive
@j0sh
j0sh temporarily deployed to docker-publish December 5, 2026 03:35 — with GitHub Actions Inactive
@j0sh
j0sh temporarily deployed to docker-publish December 5, 2026 03:35 — with GitHub Actions Inactive
@j0sh
j0sh temporarily deployed to docker-publish December 5, 2026 03:44 — with GitHub Actions Inactive
@j0sh
j0sh temporarily deployed to docker-publish December 5, 2026 03:45 — with GitHub Actions Inactive
@j0sh
j0sh temporarily deployed to docker-publish December 5, 2026 03:45 — with GitHub Actions Inactive
@j0sh
j0sh deployed to docker-publish December 5, 2026 03:45 — with GitHub Actions Active

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The lottery-dependent reserve check lets payers retry rejected batches without consuming nonces, receiving credited expected value while filtering out higher payouts.

1 open issue
1 resolved since last review

Review effort: Balanced

Comment thread redemption/redeemer_db.go Resolved
Use the whole signed batch to check funding and queue capacity. Persist liability only for winning tickets.
@j0sh
j0sh requested a balanced review from Copilot December 5, 2026 03:50
@j0sh
j0sh deployed to docker-publish December 5, 2026 03:53 — with GitHub Actions Active
@j0sh
j0sh deployed to docker-publish December 5, 2026 03:53 — with GitHub Actions Active
@j0sh
j0sh deployed to docker-publish December 5, 2026 03:53 — with GitHub Actions Active
@j0sh
j0sh deployed to docker-publish December 5, 2026 03:53 — with GitHub Actions Active

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Ticket sizing can produce payouts below redemption costs, preventing credited wins from being redeemed; final payouts need minimum-value validation, including the exact-EV fallback.

1 open issue
1 resolved since last review

Review effort: Balanced

Comment thread orchestrator/ticket_sizing.go Resolved
Use the fixed redemption estimate on Arbitrum One when sizing initial quotes and exact-EV fallbacks. Keep the transaction-specific cost check at redemption.
@j0sh
j0sh requested a balanced review from Copilot December 5, 2026 03:59
@j0sh
j0sh deployed to docker-publish December 5, 2026 04:02 — with GitHub Actions Active
@j0sh
j0sh deployed to docker-publish December 5, 2026 04:03 — with GitHub Actions Active
@j0sh
j0sh deployed to docker-publish December 5, 2026 04:03 — with GitHub Actions Active
@j0sh
j0sh deployed to docker-publish December 5, 2026 04:03 — with GitHub Actions Active

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Human assessment is needed because recipient-only quoting can exceed payer-wide collateral limits, causing receipt admission to reject tickets even without a funding change.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

Account for outstanding wins across recipients when quoting available payer collateral, using the same calculation as receipt admission.
@j0sh
j0sh requested a balanced review from Copilot December 5, 2026 04:07
@j0sh

j0sh commented Dec 5, 2026

Copy link
Copy Markdown
Collaborator Author

2b3e1bb addresses the payer-wide collateral concern in the previous Copilot review. Quote sizing and receipt admission now use the same collateral calculation. The regression covers a payer with outstanding wins for a previous recipient and verifies that the new quote can be paid with the same funding observation.

@j0sh
j0sh deployed to docker-publish December 5, 2026 04:10 — with GitHub Actions Active
@j0sh
j0sh deployed to docker-publish December 5, 2026 04:11 — with GitHub Actions Active
@j0sh
j0sh deployed to docker-publish December 5, 2026 04:11 — with GitHub Actions Active
@j0sh
j0sh deployed to docker-publish December 5, 2026 04:11 — with GitHub Actions Active

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Payment-domain review is needed to validate cross-recipient TicketBroker collateral assumptions and the fixed Arbitrum redemption-cost floor before deploying the default-on payment-sizing and commitment changes.

No open issues 🎉

Review effort: Balanced

This branch was successfully deployed

1 active deployment
docker-publish — 2b3e1bbc Deployed Dec 5, 2026 by j0sh via docker-pr / promote #239
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.

Default ticket face value too low Investigate payer-specific ticket face value and win probability

2 participants