Skip to content

Keep abis/*.json in sync with livepeer/protocol deployment artifacts #252

Description

@rickstaa

Problem

abis/*.json are hand-committed with no sync mechanism. There is no script, CI step, or documented
process that pulls them from livepeer/protocol, so they
drift silently from the deployed contracts and only get touched when someone notices something
missing.

abis/BondingManager.json last saw a real update in 6d5228b (2022). Adding reward-caller
indexing required hand-copying a single event fragment out of
deployments/arbitrumMainnet/BondingManagerTarget.json into it. That worked, but it is not a
process — the next person has to know to do the same thing.

This matters because a missing event in the ABI is invisible: graph codegen simply never emits the
event class, so the event cannot be wired up and nothing warns you.

Current drift

Measured on 2026-08-03 against livepeer/protocol deployments/arbitrumMainnet/*.json, comparing
event and function signature sets:

Local ABI Protocol artifact Status
BondingManager BondingManagerTarget drift — missing TreasuryReward(address,address,uint256); missing the Delta functions (setRewardCaller, transcoderToRewardCaller, rewardForTranscoder, checkpointBondingState, treasuryRewardCutRate, …); carries a legacy WithdrawFees(address) overload that no longer exists upstream
PollCreator PollCreator drift — local-only token(), which reverts on the deployed contract (0x8bb50806D60c492c0004DAD5D9627DAA2d9732E6) and is not called by any mapping
Controller Controller in sync
LivepeerGovernor LivepeerGovernorTarget in sync
Minter Minter in sync
RoundsManager RoundsManagerTarget in sync
ServiceRegistry ServiceRegistryTarget in sync
TicketBroker TicketBrokerTarget in sync

Better than feared — only two files are actually stale, and the missing TreasuryReward is the one
real indexing gap.

Not covered by livepeer/protocol/deployments/arbitrumMainnet, so they need a different source or
an explicit opt-out:

  • L2Migrator — lives in livepeer/arbitrum-lpt-bridge
  • LivepeerToken — no artifact in that deployments dir
  • Poll — deployed per-poll by PollCreator, so there is no static deployment artifact
  • UniswapV3Pool — third-party, correctly pinned by hand

Proposal

  1. Add a sync script (e.g. yarn sync:abis) that pulls .abi from the protocol repo's
    deployments/arbitrumMainnet/*.json for each mapped contract, writing prettier-formatted output
    to abis/. Contracts with no upstream artifact get an explicit allowlist entry documenting why.
  2. Add a CI drift check that fails, or at least warns, when a committed ABI diverges from upstream —
    that is what turns this from a one-off cleanup into something that stays fixed.
  3. As part of (1), resync BondingManager and PollCreator. Verified safe: no function any
    mapping calls is lost
    , so no .bind() call breaks. The only removals are the unwired legacy
    WithdrawFees(address) overload and the nonexistent PollCreator.token().

Note that resyncing BondingManager adds the TreasuryReward event to the ABI but does not
index it — wiring a handler for treasury rewards is separate work and deserves its own issue.

Context

Split out of the reward-caller indexing work, which deliberately kept the ABI change narrow (one
event, copied verbatim from the canonical artifact and diffed to confirm it matched byte-for-byte)
rather than mixing a full resync into a feature PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions