Repository navigation
Cache configured recipient activity in payment observations - #41
Merged
Merged
Conversation
Source-Repository: https://github.com/livepeer/go-livepeer Original-Commit: 5bfee8f76a16b61a779c635c68deb379a5612665 Source-Scope: core/orchestrator.go:isActive
The node address might be different than the ticket recipient address since a node can receive tickets on behalf of another address. Source-Repository: https://github.com/livepeer/go-livepeer Original-Commit: 9bfeaee0c2da8cfd57953d9be9acd0d1c8d5a0a4 Source-Scope: core/orchestrator.go:isActive
Source-Repository: https://github.com/livepeer/go-livepeer Original-Commit: 4d6e27449c06913d75150e7c1a710f1e326835d5 Source-Scope: core/orchestrator.go:isActive
Source-Repository: https://github.com/livepeer/go-livepeer Original-Commit: 1bdb33454063e35fe34030a60d347a53434732e7 Source-Scope: core/orchestrator.go:isActive
j0sh
force-pushed
the
ja-codex/payment-35-recipient-activity
branch
2 times, most recently
from
November 4, 2026 00:21
09046a8 to
8bed256
Compare
Read the canonical activity predicate once during the existing bounded refresh. Challenge, receipt, and readiness use that immutable result; unknown, stale, foreign, and invalidated observations refuse locally. Keep the ticket recipient distinct from the node key. The approved scope uses one fixed recipient and canonical confirmation instead of transplanting upstream event arithmetic or storage. Provenance: livepeer/go-livepeer core/orchestrator.go and eth/watchers/orchestratorwatcher_test.go at 597f882cb9f4d42ad8430b0f592afd5929af4a6b, originally by Nico Vergauwen (activity admission introduced in 5bfee8f76a16b61a779c635c68deb379a5612665). Per-entry isolation and warm-path tests adapt Mike Zupper (BlueClawNetwork/livepeer-node PR #1), including 68c7834 and bbe126e. MIT notices retained. Retain the scoped go-livepeer source history as an additional parent. Its original authors, committers, dates, and messages are preserved; Original-Commit records upstream identities. This commit owns the Node adaptation and integration. Source-Repository: https://github.com/livepeer/go-livepeer Source-Revision: 597f882cb9f4d42ad8430b0f592afd5929af4a6b Source-History: 7d00675
j0sh
force-pushed
the
ja-codex/payment-35-recipient-activity
branch
from
November 6, 2026 23:14
8bed256 to
6cd8956
Compare
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the recipient-activity caching changes.
No open issues 🎉
What changed in this PR
This PR extends the shared payment observer to cache activity for the configured ticket recipient at the observation’s canonical block. It builds on retained contract bindings so warm payment admission and readiness checks can use local activity state while keeping the recipient distinct from the node signing key.
Changes:
- Store recipient activity and lookup errors alongside each payment observation.
- Use observed activity for payment checks and paid readiness, refusing unavailable or stale state.
- Extend fixtures and tests for warm reads, round boundaries, reorgs, contract replacement, and separate-recipient startup.
| File | Description |
|---|---|
signer/payment_test.go |
Update observer construction without a configured recipient. |
signer/app.go |
Initialize the signer observer without recipient tracking. |
orchestrator/payment_recipient_test.go |
Test local activity checks and refusal without balance or replay-state changes. |
orchestrator/metrics.go |
Base paid chain readiness on current observed recipient activity. |
orchestrator/metrics_test.go |
Configure a recipient for observer-backed readiness tests. |
orchestrator/app.go |
Initialize activity tracking after selecting the ticket recipient. |
orchestrator/app_test.go |
Verify activity queries target the configured recipient. |
internal/test/chainrpc.go |
Model recipient activation and deactivation rounds. |
eth/payment.go |
Retain activity in snapshots and serve observer-backed checks locally. |
eth/payment_observer.go |
Refresh recipient activity and expose it through observer status. |
eth/payment_observer_test.go |
Cover activity boundaries, snapshot consistency, failures, reorgs, and staleness. |
eth/payment_contracts_test.go |
Extend binding-replacement tests to cover local activity reads. |
eth/contracts_test.go |
Update observer construction in redemption tests. |
Review effort: Balanced
j0sh
force-pushed
the
ja-codex/payment-35-recipient-activity
branch
from
November 6, 2026 23:18
6cd8956 to
df01343
Compare
Comment on lines
+3
to
+4
| func (orch *orchestrator) isActive(addr ethcommon.Address) (bool, error) { | ||
| filter := &common.DBOrchFilter{ |
| @@ -0,0 +1,15 @@ | |||
| package core | |||
|
|
|||
| func (orch *orchestrator) isActive(addr ethcommon.Address) (bool, error) { | |||
j0sh
force-pushed
the
ja-codex/payment-35-recipient-activity
branch
from
November 6, 2026 23:25
df01343 to
54259bb
Compare
Base automatically changed from
ja-codex/payment-32-confirmed-contracts
to
main
November 6, 2026 23:28
Source-Repository: https://github.com/livepeer/go-livepeer Original-Commit: 5bfee8f76a16b61a779c635c68deb379a5612665 Source-Scope: core/orchestrator.go:isActive
The node address might be different than the ticket recipient address since a node can receive tickets on behalf of another address. Source-Repository: https://github.com/livepeer/go-livepeer Original-Commit: 9bfeaee0c2da8cfd57953d9be9acd0d1c8d5a0a4 Source-Scope: core/orchestrator.go:isActive
Source-Repository: https://github.com/livepeer/go-livepeer Original-Commit: 4d6e27449c06913d75150e7c1a710f1e326835d5 Source-Scope: core/orchestrator.go:isActive
Source-Repository: https://github.com/livepeer/go-livepeer Original-Commit: 1bdb33454063e35fe34030a60d347a53434732e7 Source-Scope: core/orchestrator.go:isActive
j0sh
force-pushed
the
ja-codex/payment-35-recipient-activity
branch
from
November 6, 2026 23:28
54259bb to
769fb3c
Compare
j0sh
added a commit
that referenced
this pull request
Nov 6, 2026
Depends on #41. Merge after that PR. Known payers use immutable cached collateral at the shared observation. A bounded hash-linked history proof keeps unchanged payers warm across canonical polling gaps; incomplete history resets entries for pinned rereads. Funding, withdrawal, reserve, round and Controller target changes invalidate the affected entries, including upgrades with unchanged public proxy addresses. Cold reads share work by payer/recipient and have a global four-key limit with no distinct-key queue. Cancellation, eviction, failures and shutdown preserve those bounds. A durable settlement watermark is recorded with liability release and checked inside admission, preventing pre-settlement collateral from being paired with released liability. Retains recipient-specific reserve/withdrawal semantics, replay guards, durable acknowledgement and redemption protections. Shared implementation and tests retain source attribution. Validation: affected and full repository race suites, vet, canonicality/financial/recovery regressions and diff checks passed on the final reviewed series. Closes #33.
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.


Depends on #40. Merge after that PR.
The existing bounded observer refresh reads activity once for the configured ticket recipient at the observation's canonical block. Challenge, receipt, and readiness use that local result; receipt keeps the activity result attached to its payer-funds observation.
Unavailable activity refuses admission before credit or replay state is published. The recipient remains distinct from the node signing key. This uses the shared observer and fixture without another activity map, worker, or event reducer.
Validation: affected package suites and race checks, vet, and diff checks passed, including warm zero-RPC reads, round boundaries, reorg/replacement recovery, and separate-recipient startup. Reused code/tests retain provenance; no documentation changes.
Closes #35.