Skip to content

feat: add LIP-118 reward caller support - #4011

Open
rickstaa wants to merge 1 commit into
masterfrom
feat/reward-caller
Open

feat: add LIP-118 reward caller support#4011
rickstaa wants to merge 1 commit into
masterfrom
feat/reward-caller

Conversation

@rickstaa

@rickstaa rickstaa commented Aug 5, 2026

Copy link
Copy Markdown
Member

What

Client support for LIP-118: an orchestrator authorizes a separate low-privilege account to call reward() on its behalf so the stake-holding account can stay offline. Contracts shipped in livepeer/protocol#648 (live on Arbitrum One); subgraph and explorer already support it.

Usage

  1. On a node holding the orchestrator key, run "Set reward caller" in livepeer_cli (needs -enableCliTxRoutes), or set it from the explorer.
  2. Restart the node with the caller account's keystore and -ethOrchAddr <orchestrator>. No new flag: the node reads transcoderToRewardCaller(orchestrator) and takes the delegated path when it matches its own account.

Changes

  • eth: SetRewardCaller / GetRewardCaller / RewardForTranscoder; Reward and RewardForTranscoder share the pool-hint computation, always keyed on the orchestrator. RewardService targets the orchestrator and re-checks authorization each round (CheckRewardCaller), so a revoked caller gets a clear error instead of a revert.
  • starter: fails at startup when -reward is set on an account that is neither the orchestrator nor its reward caller (auto mode warns and stays off); service URI is read under -ethOrchAddr; -ethOrchAddr is validated.
  • server: /setRewardCaller, /rewardCaller; /reward and /orchestratorInfo are orchestrator-aware. /activateOrchestrator, /setOrchestratorConfig, /setRewardCaller are rejected on a non-orchestrator account, because ServiceRegistry.setServiceURI and setRewardCaller have no caller check and would silently write to the wrong key.
  • livepeer_cli: "Set reward caller" action (shows current, offers unset).

Verification

Bindings verified against the deployed Arbitrum One BondingManager (selectors dispatch; existing on-chain reward-caller pair reads back correctly); regenerating from the unmodified ABI reproduces the committed file byte-for-byte. Unit tests cover own/authorized/unauthorized/revoked/lookup-error paths, set/unset, and the account guard. Not covered: end-to-end devnet run of set → restart → reward → revoke.

Copilot AI review requested due to automatic review settings August 5, 2026 11:48
@github-actions github-actions Bot added the go Pull requests that update Go code label Aug 5, 2026

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.

Pull request overview

Adds go-livepeer client, server, and CLI support for LIP-118 “reward caller” delegation, enabling an orchestrator to authorize a separate low-privilege wallet to call reward() on its behalf (keeping the stake-holding wallet cold).

Changes:

  • Extend contract bindings + eth client APIs to set/get a reward caller and call reward on behalf of a transcoder.
  • Make reward execution and CLI endpoints orchestrator-aware when running on a delegated (reward caller) wallet, including startup authorization checks and correct service URI lookup.
  • Add server + eth unit tests covering authorized/unauthorized/revoked and delegated-wallet behaviors, plus CLI wizard action to set/unset the reward caller.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
server/webserver.go Wires new CLI HTTP endpoints for reward caller management and routes /reward through server instance.
server/handlers.go Adds delegated-wallet detection/guard, reward-caller endpoints, and orchestrator-aware /reward + /orchestratorInfo.
server/handlers_test.go Adds coverage for delegated wallet behavior and reward caller set/unset; updates reward handler test wiring.
eth/stubclient.go Extends mock/stub eth clients for reward caller and delegated reward calls.
eth/rewardservice.go Makes reward service operate on an orchestrator address (delegated path) with per-round authorization re-check.
eth/rewardservice_test.go Adds tests for delegated reward caller paths, revocation, and lookup errors.
eth/contracts/bondingManager.go Regenerates/adds ABI bindings for LIP-118 methods and events.
eth/client.go Adds SetRewardCaller/GetRewardCaller/RewardForTranscoder and refactors reward hint computation to be transcoder-keyed.
cmd/livepeer/starter/starter.go Adds reward authorization check at startup (reward-gated) and service URI lookup keyed on orchestrator address when delegated.
cmd/livepeer/starter/starter_test.go Updates tests for updated getServiceURI() signature.
cmd/livepeer_cli/wizard_transcoder.go Adds interactive “Set reward caller” flow (set/unset) to the transcoder wizard.
cmd/livepeer_cli/livepeer_cli.go Exposes the new wizard action in CLI options.
CHANGELOG_PENDING.md Adds changelog entry for LIP-118 reward caller support.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread eth/rewardservice.go Outdated
Comment thread cmd/livepeer/starter/starter.go Outdated
Comment thread cmd/livepeer_cli/wizard_transcoder.go
@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 27.21713% with 238 lines in your changes missing coverage. Please review.
✅ Project coverage is 35.49507%. Comparing base (176aa41) to head (7b75cde).

Files with missing lines Patch % Lines
eth/contracts/bondingManager.go 0.00000% 106 Missing ⚠️
cmd/livepeer_cli/wizard_transcoder.go 0.00000% 40 Missing ⚠️
cmd/livepeer/starter/starter.go 2.50000% 39 Missing ⚠️
server/handlers.go 72.22222% 16 Missing and 4 partials ⚠️
eth/stubclient.go 27.27273% 16 Missing ⚠️
eth/client.go 0.00000% 11 Missing ⚠️
eth/rewardservice.go 81.81818% 5 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@                 Coverage Diff                 @@
##              master       #4011         +/-   ##
===================================================
- Coverage   35.53708%   35.49507%   -0.04201%     
===================================================
  Files            174         174                 
  Lines          45226       45519        +293     
===================================================
+ Hits           16072       16157         +85     
- Misses         27880       28081        +201     
- Partials        1274        1281          +7     
Files with missing lines Coverage Δ
cmd/livepeer_cli/livepeer_cli.go 0.00000% <ø> (ø)
server/webserver.go 85.57692% <100.00000%> (+0.28280%) ⬆️
eth/rewardservice.go 81.57895% <81.81818%> (+7.03350%) ⬆️
eth/client.go 4.58404% <0.00000%> (-0.07917%) ⬇️
eth/stubclient.go 15.68627% <27.27273%> (+1.15636%) ⬆️
server/handlers.go 57.33906% <72.22222%> (+0.82128%) ⬆️
cmd/livepeer/starter/starter.go 22.55685% <2.50000%> (-0.36632%) ⬇️
cmd/livepeer_cli/wizard_transcoder.go 0.00000% <0.00000%> (ø)
eth/contracts/bondingManager.go 0.00000% <0.00000%> (ø)

... and 6 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 176aa41...7b75cde. Read the comment docs.

Files with missing lines Coverage Δ
cmd/livepeer_cli/livepeer_cli.go 0.00000% <ø> (ø)
server/webserver.go 85.57692% <100.00000%> (+0.28280%) ⬆️
eth/rewardservice.go 81.57895% <81.81818%> (+7.03350%) ⬆️
eth/client.go 4.58404% <0.00000%> (-0.07917%) ⬇️
eth/stubclient.go 15.68627% <27.27273%> (+1.15636%) ⬆️
server/handlers.go 57.33906% <72.22222%> (+0.82128%) ⬆️
cmd/livepeer/starter/starter.go 22.55685% <2.50000%> (-0.36632%) ⬇️
cmd/livepeer_cli/wizard_transcoder.go 0.00000% <0.00000%> (ø)
eth/contracts/bondingManager.go 0.00000% <0.00000%> (ø)

... and 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rickstaa
rickstaa force-pushed the feat/reward-caller branch from 098a259 to 1944abc Compare August 25, 2026 14:44
Let an orchestrator authorize a separate low-privilege account to call
reward on its behalf so the stake-holding account can stay offline.
The node takes the delegated path when -ethOrchAddr names an
orchestrator whose on-chain reward caller is the node's account.

Adds SetRewardCaller/GetRewardCaller/RewardForTranscoder to the eth
client, a per-round authorization check in the reward service, a
startup check that fails early on an explicit -reward, /setRewardCaller
and /rewardCaller CLI routes, a "Set reward caller" wizard action, and
a guard so orchestrator config transactions are rejected on a
non-orchestrator account (setServiceURI has no on-chain caller check).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016PAXw8P4oJNp4sjFB4jk1Y
@rickstaa
rickstaa force-pushed the feat/reward-caller branch from 7b75cde to f519ff6 Compare August 26, 2026 23:13
@rickstaa
rickstaa marked this pull request as ready for review August 26, 2026 23:15
@rickstaa rickstaa changed the title eth,server,cmd: Add LIP-118 reward caller support feat: add LIP-118 reward caller support Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go Pull requests that update Go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants