Lodestar
GRT
0

Seven More Repositories, Sixteen More Issues

The second half of our audit of The Graph's stack: the network subgraph, graph-tooling, the REO, dipper, graph-tally, stable-hash and the Horizon contracts.

Earlier today we read four of The Graph's core repositories and filed 44 issues. That post ended with a list of what it had not covered, and a list like that is an invitation. So in the afternoon we read the seven repositories on it: the network subgraph, graph-tooling, the Rewards Eligibility Oracle, dipper, graph-tally, stable-hash and the Horizon contracts. Same rules, same caveats, and again pro bono, as members of the community that depends on this software. Sixteen more issues are now open, and the contracts produced findings we are not describing here at all.


Same rule, and a stricter one for the contracts

Every finding was confirmed against the source by a second reading before it was filed, with a concrete trigger and a concrete wrong outcome, and searched for in the issue tracker first. Where an open issue already described the symptom, we commented with the cause instead of opening a duplicate.

We read the default branch of each repository on 27 November:

Repository Commit Issues filed
graphprotocol/graph-network-subgraph fd5b03b 6
graphprotocol/graph-tooling 7fe67ac 5, and a comment on #1615
graphprotocol/rewards-eligibility-oracle ae61c9f 2
graphprotocol/dipper 3b4409e 2
graphprotocol/graph-tally acc465b 1
graphprotocol/stable-hash 70300f9 0
graphprotocol/contracts f0bd90a not filed publicly

This half leaned more on evidence than the first. The graph-tooling findings were all reproduced with the real CLI and the real graph-ts; the REO and dipper findings with tests in the projects' own suites; the network subgraph findings against live Arbitrum One logs.

For the contracts we set the stricter rule before we started: anything that could move or lock funds goes to the bug bounty, not to GitHub. A GitHub issue about a deployed contract is a set of instructions. So the contract findings are not in this post, beyond the fact that they exist and are being reported through the proper channel.

The network subgraph has been missing events since Horizon

The network subgraph is what explorers, dashboards, the indexer agent and the gateway all read for stake, allocations and fees, so a handler that never fires is wrong everywhere at once. Two of them have not fired since Horizon went live, and we checked both against the chain rather than the code.

GraphPaymentCollected gained a tenth argument; the manifest still asks for nine (#343). On the GraphPayments contract the nine-argument topic has no logs at all. The ten-argument one has about 80,000. Every Horizon epoch therefore reports zero taxed query fees, and the network-wide total has not moved since the migration.

Indexers changing where their payments go are invisible (#345). The manifest listens for RewardsDestinationSet, which has never been emitted on the deployed SubgraphService; the contract emits PaymentsDestinationSet, about 178 times so far. An indexer's payments destination is frozen at whatever it was when they registered.

The others are smaller, and still wrong in public:

  • totalUnstakedTokensLocked is decremented on every Horizon unstake(), although nothing is locked on that path, so it is now negative by roughly the 316 million GRT unstaked since block 400M (#344).
  • A revoked Horizon operator stays in the indexer's operator list, because the handler edits the wrong array. There have been ten revocations; all ten are still listed (#346).
  • Provision.allocations is documented as active allocations and returns every allocation the provision has ever had (#347).
  • redelegate() leaves the old pool's delegation totals high (#348). Nobody has redelegated on mainnet yet, so this one is waiting for its first customer.

graph-tooling writes the wrong thing without complaining

Bugs in graph-cli and graph-ts end up compiled into other people's subgraphs, which is a good reason to prefer the loud ones. Most of these are quiet.

  • An empty string is stored as null (#2180). The generated setter for a nullable String is if (!value) unset(...), and in AssemblyScript "" is falsy. A token with an empty symbol() reads back as null, and where: { symbol: "" } finds nothing.
  • Bytes.empty() is four bytes long (#2181). It is built with fromI32(0), and has been since 2021, so comparisons against it never match genuinely empty data.
  • graph build uploads the wrong ABI when two ABIs share a file name in different folders (#2182). Both are written to the same path, the last one wins, and the build reports success.
  • toU32() and toU64() return 255 for -1 instead of asserting (#2183), and derived fields on entities with an Int8 id abort every time they are read (#2184).

The sixth was already open. #1615, from 2024, reports subgraphs with indexed struct events stalling on "event not found", and had stopped at a request for a contract address. The cause is that the CLI writes the indexed keyword inside the tuple's parentheses and graph-node expects it outside, so the two never agree on the signature. We added that to the thread.

The oracle that decides rewards can stop without saying so

The REO's criteria logic matches its published rules; we checked the stake-scaled minimum down to the wei. What it does when something goes wrong is another matter (#201). A failed run ends with sys.exit(1), which Python's retry library does not count as an exception, so the five retries with backoff never happen. The scheduler process dies instead, Docker restarts it at once, and three quick failures open the circuit breaker, which exits cleanly. A clean exit is not something restart: on-failure restarts. No alert is sent on that path. After seven days without an update, the contract stops enforcing eligibility for everyone.

The other finding is a single day (#202). The window published as 28 days is queried with an inclusive range and covers 29 daily partitions. It errs in the indexers' favour, and nobody honest loses by it, but the published rule and the code should say the same thing.

dipper, graph-tally and stable-hash

dipper, which runs indexing agreements, was the most carefully built code we read all day; its signing, pricing and on-chain state handling all came back clean. Both findings are in the logic that swaps one indexer for another. A second reassessment pass cancels the old indexer's agreement before the replacement has accepted, which is the outage its own PR #584 was written to prevent (#862). In the other direction, a replacement that is marked expired and then turns out to have been accepted leaves both agreements running and paid (#863).

graph-tally's aggregator applies its request timeout and concurrency limit to an empty router, so neither reaches the gRPC routes tap-agent uses (#32). Its signing, recovery and aggregation logic, which is what actually matters for payments, is sound.

stable-hash came back clean. It is what the PoI is built on, so of everything we read today it is the result we were happiest to report as nothing.

What this does not tell you

Everything we said about the first post applies here. It is not a formal audit; some findings will turn out to be wrong, or intended, and we will say so when the maintainers tell us.

The contracts are the obvious gap in this write-up, and it is a deliberate one. We read HorizonStaking, PaymentsEscrow, GraphPayments, the collectors, SubgraphService, DisputeManager and the rewards path, and reproduced what we found with forge tests, including against a fork of Arbitrum One. Those findings will be described once they have been through the bug bounty and the people who can fix them have had the chance to do so. If the answer is that we were wrong, we will say that too.

Further reading

All sixteen issues were filed on 27 November 2026:

The first half, with the other 44, is here.