Skip to content

Cache configured recipient activity in payment observations - #41

Merged
j0sh merged 10 commits into
mainfrom
ja-codex/payment-35-recipient-activity
Nov 6, 2026
Merged

j0sh merged 10 commits into
mainfrom
ja-codex/payment-35-recipient-activity

Conversation

@j0sh

@j0sh j0sh commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

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.

Nico Vergauwen and others added 4 commits January 21, 2020 21:41
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
j0sh force-pushed the ja-codex/payment-35-recipient-activity branch 2 times, most recently from 09046a8 to 8bed256 Compare November 4, 2026 00:21
@j0sh
j0sh added this pull request to stack #60 November 6, 2026 22:50
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
Copilot AI balanced review requested due to automatic review settings November 6, 2026 23:14
@j0sh
j0sh force-pushed the ja-codex/payment-35-recipient-activity branch from 8bed256 to 6cd8956 Compare November 6, 2026 23:14

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 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
j0sh temporarily deployed to docker-publish November 6, 2026 23:16 — with GitHub Actions Inactive
@j0sh
j0sh temporarily deployed to docker-publish November 6, 2026 23:17 — with GitHub Actions Inactive
@j0sh
j0sh temporarily deployed to docker-publish November 6, 2026 23:17 — with GitHub Actions Inactive
@j0sh
j0sh temporarily deployed to docker-publish November 6, 2026 23:17 — with GitHub Actions Inactive
@j0sh
j0sh force-pushed the ja-codex/payment-35-recipient-activity branch from 6cd8956 to df01343 Compare November 6, 2026 23:18
Copilot AI balanced review requested due to automatic review settings November 6, 2026 23:18

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 new core package cannot compile due to undefined types and missing state infrastructure, and its unused helper leaves activity checks outside the shared canonical payment observation.

2 open issues

Review effort: Balanced

Comment thread core/orchestrator.go Outdated
Comment on lines +3 to +4
func (orch *orchestrator) isActive(addr ethcommon.Address) (bool, error) {
filter := &common.DBOrchFilter{
Comment thread core/orchestrator.go Outdated
@@ -0,0 +1,15 @@
package core

func (orch *orchestrator) isActive(addr ethcommon.Address) (bool, error) {
@j0sh
j0sh force-pushed the ja-codex/payment-35-recipient-activity branch from df01343 to 54259bb Compare November 6, 2026 23:25
Copilot AI balanced review requested due to automatic review settings November 6, 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.

🔵 Needs a closer look

The new helper cannot compile because required types and imports are absent, and it is unused by payment paths, leaving the required local activity checks unimplemented.

2 open issues

Review effort: Balanced

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
yondonfu and others added 3 commits November 6, 2026 15:28
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
j0sh force-pushed the ja-codex/payment-35-recipient-activity branch from 54259bb to 769fb3c Compare November 6, 2026 23:28
Copilot AI balanced review requested due to automatic review settings November 6, 2026 23:29

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 are reported for the recipient-activity caching change.

2 open issues

Review effort: Balanced

@j0sh
j0sh temporarily deployed to docker-publish November 6, 2026 23:31 — with GitHub Actions Inactive
@j0sh
j0sh merged commit 9cf4d8f into main Nov 6, 2026
11 checks passed
@j0sh
j0sh deleted the ja-codex/payment-35-recipient-activity branch November 6, 2026 23:32
@j0sh
j0sh temporarily deployed to docker-publish November 6, 2026 23:32 — with GitHub Actions Inactive
@j0sh
j0sh temporarily deployed to docker-publish November 6, 2026 23:32 — with GitHub Actions Inactive
@j0sh
j0sh temporarily deployed to docker-publish November 6, 2026 23:32 — with GitHub Actions Inactive
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

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

Reuse go-livepeer activity tracking for local payment recipient checks

3 participants