Repository navigation
Observe payer funds once per signer request - #38
Merged
Merged
Conversation
There was a problem hiding this comment.
🟢 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
force-pushed
the
ja-codex/payment-34-single-observation
branch
from
November 4, 2026 00:03
9b6cd0e to
574431e
Compare
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
force-pushed
the
ja-codex/payment-34-single-observation
branch
from
November 6, 2026 23:02
2062c73 to
fccf209
Compare
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.