Skip to content

Observe payer funds once per signer request - #38

Merged
j0sh merged 2 commits into
mainfrom
ja-codex/payment-34-single-observation
Nov 6, 2026
Merged

j0sh merged 2 commits into
mainfrom
ja-codex/payment-34-single-observation

Conversation

@j0sh

@j0sh j0sh commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Payment preparation observes payer funds once and reuses that immutable observation for both the single-ticket precheck and full-batch exposure check. Both checks still precede authorization and signing. The direct paid-request path falls from 29 to 22 RPC round trips.

Adds one shared counting RPC fixture, removes tests for funding failures that required a second observation, and corrects the resulting obsolete HTTP 500 description. Reused code retains its source attribution.

Validation: the baseline and candidate were checked with the same counting harness; affected package tests, go test -race ./..., go vet ./..., formatting, and diff checks passed.

Closes #34.

Copilot AI balanced review requested due to automatic review settings November 3, 2026 23:25

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.

🟢 Approval recommended

No active review issues remain for the change that reuses payer-funds observations to reduce RPC round trips.

No open issues 🎉

What changed in this PR

This PR addresses #34 by reusing one payer-funds observation for both signer validation checks, reducing the direct paid-request path from 29 to 22 RPC round trips while keeping validation before authorization and signing.

Changes:

  • Separates payer observation from expiry and funding-policy validation.
  • Adds shared RPC counting coverage and verifies observation reuse, immutability, and batch rejection before authorization or signing.
  • Removes unreachable second-observation failure tests and updates the HTTP 500 documentation.
File Description
signer/​service_test.go Tests observation reuse and rejected-batch ordering; removes obsolete failure cases.
signer/​payment.go Reuses payer funds for precheck and full-batch validation.
signer/​payment_test.go Asserts the direct paid-request budget of 22 RPC calls.
internal/​test/​chainrpc.go Adds a shared counting RPC fixture for payment tests.
docs/​http-api.md Removes the obsolete post-precheck funding-failure description.

Review effort: Balanced

@j0sh
j0sh force-pushed the ja-codex/payment-34-single-observation branch from 9b6cd0e to 574431e Compare November 4, 2026 00:03
@j0sh
j0sh added this pull request to stack #60 November 6, 2026 22:50
Copilot AI balanced review requested due to automatic review settings November 6, 2026 22:54

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.

🟢 Approval recommended

The review identifies no active issues with the payer-funds observation reuse change.

No open issues 🎉

Review effort: Balanced

@j0sh
j0sh temporarily deployed to docker-publish November 6, 2026 22:56 — with GitHub Actions Inactive
@j0sh
j0sh temporarily deployed to docker-publish November 6, 2026 22:57 — with GitHub Actions Inactive
@j0sh
j0sh temporarily deployed to docker-publish November 6, 2026 22:57 — with GitHub Actions Inactive
@j0sh
j0sh temporarily deployed to docker-publish November 6, 2026 22:57 — with GitHub Actions Inactive
mikezupper and others added 2 commits November 6, 2026 15:02
Add a counting RPC fixture and paid-request baseline, separate the
signer's funds observation from policy checks, and reuse that observation
for the batch recheck. Squash Mike Zupper's three original commits.

Source-Repository: https://github.com/BlueClawNetwork/livepeer-node
Source-Pull-Request: BlueClawNetwork#1
Original-Commit: 285eda9
Original-Commit: f3f1e4b
Original-Commit: b8cad3d
Adapt the imported counting RPC fixture and payment tests to the Node
integration. Retain one funds observation per request, consolidate
failure coverage, and correct the resulting HTTP failure documentation.
@j0sh
j0sh force-pushed the ja-codex/payment-34-single-observation branch from 2062c73 to fccf209 Compare November 6, 2026 23:02
Copilot AI balanced review requested due to automatic review settings November 6, 2026 23:02
@j0sh
j0sh temporarily deployed to docker-publish November 6, 2026 23:04 — 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.

🟢 Approval recommended

No active review issues remain for the payer-funds observation reuse change.

No open issues 🎉

Review effort: Balanced

@j0sh
j0sh temporarily deployed to docker-publish November 6, 2026 23:05 — with GitHub Actions Inactive
@j0sh
j0sh temporarily deployed to docker-publish November 6, 2026 23:05 — with GitHub Actions Inactive
@j0sh
j0sh temporarily deployed to docker-publish November 6, 2026 23:05 — with GitHub Actions Inactive
@j0sh
j0sh merged commit 4662540 into main Nov 6, 2026
14 checks passed
@j0sh
j0sh deleted the ja-codex/payment-34-single-observation branch November 6, 2026 23:18
j0sh added a commit that referenced this pull request Nov 6, 2026
Depends on #38. Merge after that
PR.

Paid signer and orchestrator processes share an immutable, canonical
block/round observation across requests and readiness. Warm metadata
reads use memory; independent redemption and finality reads continue
through the direct chain adapter.

Separates the protocol L1 clock, chain block identity, current round,
and initialized round. Freshness checks distinguish contact from head/L1
progress, preserve valid state across verified polling gaps, and
invalidate proven reorgs before further reads. Admission and
retained-snapshot consumers revalidate locally at their commit
boundaries.

Corrects the existing readiness description because its previous expiry
wording becomes inaccurate. Source attribution is retained.

Validation: full race suite, vet, Staticcheck, formatting, and diff
checks passed; regressions cover stale providers, reorgs, L1 rollback,
delayed signing/commit, and readiness recovery.

Closes #31.

This branch was previously deployed

1 inactive deployment
docker-publish — fccf209d Deployed Nov 6, 2026 by j0sh via docker-pr / promote #90
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.

Observe payer funds once per signer request

3 participants