feat: add LIP-118 reward caller support - #4011
Conversation
There was a problem hiding this comment.
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 +
ethclient 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.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ 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
... and 6 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
098a259 to
1944abc
Compare
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
7b75cde to
f519ff6
Compare
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
livepeer_cli(needs-enableCliTxRoutes), or set it from the explorer.-ethOrchAddr <orchestrator>. No new flag: the node readstranscoderToRewardCaller(orchestrator)and takes the delegated path when it matches its own account.Changes
eth:SetRewardCaller/GetRewardCaller/RewardForTranscoder;RewardandRewardForTranscodershare the pool-hint computation, always keyed on the orchestrator.RewardServicetargets 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-rewardis 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;-ethOrchAddris validated.server:/setRewardCaller,/rewardCaller;/rewardand/orchestratorInfoare orchestrator-aware./activateOrchestrator,/setOrchestratorConfig,/setRewardCallerare rejected on a non-orchestrator account, becauseServiceRegistry.setServiceURIandsetRewardCallerhave 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.