Skip to content

Retain confirmed payment contract bindings - #40

Merged
j0sh merged 30 commits into
mainfrom
ja-codex/payment-32-confirmed-contracts
Nov 6, 2026
Merged

j0sh merged 30 commits into
mainfrom
ja-codex/payment-32-confirmed-contracts

Conversation

@j0sh

@j0sh j0sh commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Depends on #39. Merge after that PR.

Payment observations confirm and retain RoundsManager, TicketBroker, and BondingManager addresses at their canonical block. Warm payment reads reuse those addresses without another Controller lookup. Dependent values are read only after address confirmation; transaction, redemption, and finalized settlement resolution remain independent.

Uses the shared observer and counting fixture, with coverage for replacements within a round, simultaneous round/address changes, invalid registry results, and reorgs. Reused code retains its source attribution.

Validation: affected payment suites, go test -race ./..., go vet ./..., and diff checks passed.

Closes #32.

yondonfu and others added 14 commits January 4, 2018 16:08
Source-Repository: https://github.com/livepeer/go-livepeer
Original-Commit: 5b9e5d615412f5dd4cbf09aa4f4675fa1403dfb2
Source-Scope: eth/client.go:setContracts
Source-Repository: https://github.com/livepeer/go-livepeer
Original-Commit: d8c313f2a4b5c865b3003cfde7f2ed5bbabdfd5b
Source-Scope: eth/client.go:setContracts
Source-Repository: https://github.com/livepeer/go-livepeer
Original-Commit: 0206872169a5cd748f61ca23d0507d7bac62546a
Source-Scope: eth/client.go:setContracts
Source-Repository: https://github.com/livepeer/go-livepeer
Original-Commit: 94d8edca933350d9587e76ef5a83066dccfcfd05
Source-Scope: eth/client.go:setContracts
- Introduces LivepeerETHTicketBroker
- Code cleanup: Remove job related code

Source-Repository: https://github.com/livepeer/go-livepeer
Original-Commit: 26435c28edf62e40dbd6cfea97cdb750ff51abb5
Source-Scope: eth/client.go:setContracts
Source-Repository: https://github.com/livepeer/go-livepeer
Original-Commit: ffcefd6341d14696e2718c1a42875428cd2cc953
Source-Scope: eth/client.go:setContracts
Source-Repository: https://github.com/livepeer/go-livepeer
Original-Commit: ebdaed880f96e07b72288090e54f1141e8b404ab
Source-Scope: eth/client.go:setContracts
Source-Repository: https://github.com/livepeer/go-livepeer
Original-Commit: 35d719cf8634152d381e03fe95e80fa8ce51a6e6
Source-Scope: eth/client.go:setContracts
Source-Repository: https://github.com/livepeer/go-livepeer
Original-Commit: 8efdade723c1ab3a7d25e8345c7e8fdade013083
Source-Scope: eth/client.go:setContracts
Source-Repository: https://github.com/livepeer/go-livepeer
Original-Commit: 9803e912541cde2433e1f90fb4818491f9f4584b
Source-Scope: eth/client.go:setContracts
Source-Repository: https://github.com/livepeer/go-livepeer
Original-Commit: 3209dd946bb0376308044055b6caf262fd25cf61
Source-Scope: eth/client.go:setContracts
* feat(ai): enable AI orchestrator discovery

This commit incorporates the AIServiceRegistry contract address,
superseding the conventional ServiceRegistry contract address. This
strategic alteration streamlines the discovery process of AI Orchestrators
within the AI Subnet, thereby bolstering network accessibility and interaction.
While this approach serves as a swift workaround to enable the feature without
extensive code modification, it's important to note that it may disrupt the
existing transcoding discovery mechanism. We have to fix this if we want to
merge the two networks in the future.

* docs(ai): improve discovery documentation

This commit ensures that people are aware that they have to interact
with the `AIServiceRegistry` using their main Orch wallet.

* fix: fix 'AIServiceRegistry' devnet and testnet issue

This commit ensure that the hardcoded `AIServiceRegistry` contract
doesn't break the go-livepeer binary on local devnets or testnets.

Source-Repository: https://github.com/livepeer/go-livepeer
Original-Commit: e9258f301ca923d2acca9bdc8cd6d3263f4a2dbc
Source-Scope: eth/client.go:setContracts
…ubnet (#3186)

Source-Repository: https://github.com/livepeer/go-livepeer
Original-Commit: f3fd9121ad95e1e8b89a75721ae536d60a3d1b84
Source-Scope: eth/client.go:setContracts
This commit adds functionality to the `go-livepeer` CLI, allowing orchestrators to vote on active treasury proposals directly. Additionally, it provides an option to include a reason for their vote, enhancing transparency and accountability in the decision-making process.

Co-authored-by: Victor Elias <victor@livepeer.org>

Source-Repository: https://github.com/livepeer/go-livepeer
Original-Commit: 89d9ebc7fff0004aab11bbb733035327da7b2e1b
Source-Scope: eth/client.go:setContracts
@j0sh
j0sh force-pushed the ja-codex/payment-32-confirmed-contracts branch from 749a706 to 686d1a8 Compare November 4, 2026 00:03
@j0sh
j0sh force-pushed the ja-codex/payment-32-confirmed-contracts branch from 686d1a8 to 570314c Compare November 4, 2026 00:21
@j0sh
j0sh added this pull request to stack #60 November 6, 2026 22:50
Confirm all payment registry addresses at each observer candidate's canonical
block before reading its round state. Reuse the immutable tuple for payer and
activity reads while keeping direct settlement and transaction resolution.

Adapted-from: livepeer/go-livepeer eth/client.go at 597f882cb9f4d42ad8430b0f592afd5929af4a6b
Original-Commit: 829cd9047c46aef03ff5bf07b3e34be810694b74 (Nico Vergauwen)
Original-Commit: 3209dd946bb0376308044055b6caf262fd25cf61 (Rafal Leszko)
Adapted-from: BlueClawNetwork/livepeer-node eth/chainview.go at 2d95d40 (Mike Zupper)
Adapted-from: BlueClawNetwork/livepeer-node eth/chainview_test.go at 7e3a51e (Mike Zupper)

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: ea4881e
@j0sh
j0sh force-pushed the ja-codex/payment-32-confirmed-contracts branch from 570314c to 6d32bb5 Compare November 6, 2026 23:14
Copilot AI balanced review requested due to automatic review settings 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 are reported for the change to reuse confirmed payment contract addresses and avoid repeated Controller lookups.

No open issues 🎉

What changed in this PR

This PR extends the shared payment observer to retain contract addresses confirmed at each observation’s canonical block, eliminating repeated Controller lookups on warm payment reads while keeping redemption and finalized settlement resolution independent.

Changes:

  • Confirm all three payment contract addresses before reading dependent values and retain them in observer snapshots.
  • Extend the counting RPC fixture with block-specific contract addresses and address-specific results.
  • Add coverage for registry replacements, invalid results, reorgs, warm lookup counts, and independent settlement paths.
File Description
internal/​test/​chainrpc.go Support registry changes, address-specific responses, and finalized reads in the fixture.
eth/​payment.go Retain confirmed addresses in snapshots and reuse them for payment reads.
eth/​payment_contracts.go Add registry confirmation and scoped address reuse, with source attribution.
eth/​payment_contracts_test.go Test registry changes, failures, lookup counts, and finalized-read independence.
eth/​contracts_test.go Verify redemption resolves the live broker independently of the observer.

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-32-confirmed-contracts branch from 6d32bb5 to b265c72 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 helper breaks compilation because required types, methods, and imports are missing, and its retained bindings are unused by payment reads, leaving repeated Controller lookups unresolved.

2 open issues

Review effort: Balanced

Comment thread eth/client.go Outdated
Comment on lines +3 to +4
func (c *client) setContracts(opts *bind.TransactOpts) error {
c.setTransactOpts(*opts)
Comment thread eth/client.go Outdated
glog.Errorf("Error creating TicketBroker binding: %v", err)
return err
}
c.ticketBroker = broker
Base automatically changed from ja-codex/payment-31-shared-observer to main November 6, 2026 23:24
yondonfu and others added 14 commits November 6, 2026 15:24
Source-Repository: https://github.com/livepeer/go-livepeer
Original-Commit: 5b9e5d615412f5dd4cbf09aa4f4675fa1403dfb2
Source-Scope: eth/client.go:setContracts
Source-Repository: https://github.com/livepeer/go-livepeer
Original-Commit: d8c313f2a4b5c865b3003cfde7f2ed5bbabdfd5b
Source-Scope: eth/client.go:setContracts
Source-Repository: https://github.com/livepeer/go-livepeer
Original-Commit: 0206872169a5cd748f61ca23d0507d7bac62546a
Source-Scope: eth/client.go:setContracts
Source-Repository: https://github.com/livepeer/go-livepeer
Original-Commit: 94d8edca933350d9587e76ef5a83066dccfcfd05
Source-Scope: eth/client.go:setContracts
- Introduces LivepeerETHTicketBroker
- Code cleanup: Remove job related code

Source-Repository: https://github.com/livepeer/go-livepeer
Original-Commit: 26435c28edf62e40dbd6cfea97cdb750ff51abb5
Source-Scope: eth/client.go:setContracts
Source-Repository: https://github.com/livepeer/go-livepeer
Original-Commit: ffcefd6341d14696e2718c1a42875428cd2cc953
Source-Scope: eth/client.go:setContracts
Source-Repository: https://github.com/livepeer/go-livepeer
Original-Commit: ebdaed880f96e07b72288090e54f1141e8b404ab
Source-Scope: eth/client.go:setContracts
Source-Repository: https://github.com/livepeer/go-livepeer
Original-Commit: 35d719cf8634152d381e03fe95e80fa8ce51a6e6
Source-Scope: eth/client.go:setContracts
Source-Repository: https://github.com/livepeer/go-livepeer
Original-Commit: 8efdade723c1ab3a7d25e8345c7e8fdade013083
Source-Scope: eth/client.go:setContracts
Source-Repository: https://github.com/livepeer/go-livepeer
Original-Commit: 9803e912541cde2433e1f90fb4818491f9f4584b
Source-Scope: eth/client.go:setContracts
Source-Repository: https://github.com/livepeer/go-livepeer
Original-Commit: 3209dd946bb0376308044055b6caf262fd25cf61
Source-Scope: eth/client.go:setContracts
* feat(ai): enable AI orchestrator discovery

This commit incorporates the AIServiceRegistry contract address,
superseding the conventional ServiceRegistry contract address. This
strategic alteration streamlines the discovery process of AI Orchestrators
within the AI Subnet, thereby bolstering network accessibility and interaction.
While this approach serves as a swift workaround to enable the feature without
extensive code modification, it's important to note that it may disrupt the
existing transcoding discovery mechanism. We have to fix this if we want to
merge the two networks in the future.

* docs(ai): improve discovery documentation

This commit ensures that people are aware that they have to interact
with the `AIServiceRegistry` using their main Orch wallet.

* fix: fix 'AIServiceRegistry' devnet and testnet issue

This commit ensure that the hardcoded `AIServiceRegistry` contract
doesn't break the go-livepeer binary on local devnets or testnets.

Source-Repository: https://github.com/livepeer/go-livepeer
Original-Commit: e9258f301ca923d2acca9bdc8cd6d3263f4a2dbc
Source-Scope: eth/client.go:setContracts
…ubnet (#3186)

Source-Repository: https://github.com/livepeer/go-livepeer
Original-Commit: f3fd9121ad95e1e8b89a75721ae536d60a3d1b84
Source-Scope: eth/client.go:setContracts
This commit adds functionality to the `go-livepeer` CLI, allowing orchestrators to vote on active treasury proposals directly. Additionally, it provides an option to include a reason for their vote, enhancing transparency and accountability in the decision-making process.

Co-authored-by: Victor Elias <victor@livepeer.org>

Source-Repository: https://github.com/livepeer/go-livepeer
Original-Commit: 89d9ebc7fff0004aab11bbb733035327da7b2e1b
Source-Scope: eth/client.go:setContracts
@j0sh
j0sh force-pushed the ja-codex/payment-32-confirmed-contracts branch from b265c72 to e1a867c 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.

🟢 Approval recommended

No active review issues remain for the changes to reuse payment contract addresses confirmed at canonical blocks.

2 open issues

Review effort: Balanced

@j0sh
j0sh temporarily deployed to docker-publish November 6, 2026 23:28 — with GitHub Actions Inactive
@j0sh
j0sh merged commit 9510d4a into main Nov 6, 2026
11 checks passed
@j0sh
j0sh deleted the ja-codex/payment-32-confirmed-contracts branch November 6, 2026 23:28
@j0sh
j0sh temporarily deployed to docker-publish November 6, 2026 23:28 — with GitHub Actions Inactive
@j0sh
j0sh temporarily deployed to docker-publish November 6, 2026 23:28 — with GitHub Actions Inactive
@j0sh
j0sh temporarily deployed to docker-publish November 6, 2026 23:29 — with GitHub Actions Inactive
j0sh added a commit that referenced this pull request Nov 6, 2026
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.

This branch was previously deployed

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

Retain payment contract bindings with canonical registry-change handling

5 participants