Lodestar
GRT
0

Sync bounties, version 2: anyone can pay the indexer

We published the sync bounty this morning and an indexer reviewed it by the afternoon. He made three points and was right about two and a half of them. The contract has been replaced: the payout can be sent by anyone and goes to the indexer's payments destination, no indexer has to sign anything with it, and the source is verified. One limit remains that we could not close, and it is in the contract's header.

The first version of this lasted about six hours, which is a respectable innings for an unverified contract.


What the review said

This morning's post described a bounty an indexer claims, from the indexer's own address, against a contract whose source nobody outside this repository could read. An indexer who read it replied with three objections:

  1. A bounty should rest on the POI an indexer presents to the protocol, because that is the one subject to slashing, and not on anything presented to our contract.
  2. He would not sign a transaction against an unverified contract, and a claim should be possible from the operator address.
  3. If the payout reads the protocol's POI and goes to the indexer's reward address, there is no reason for it to need the indexer at all. Anyone should be able to send it. "Claim becomes distribute."

The first was half a misreading: version 1 already read the SubgraphService's record and nothing else. The other half was a real fault, which is further down. The second and third were simply correct.

What changed

The payout is permissionless. claim is gone. distribute(bountyId, allocationId) can be called by any address. The contract reads the allocation from the SubgraphService, and pays the indexer that owns it: at the payments destination the indexer has set there, or at the indexer address if it has set none. The caller chooses nothing and receives nothing.

An indexer signs nothing with our contract. Allocate, sync, present a POI and leave the allocation open, all of which are transactions with the protocol that an indexer sends anyway. The operator question disappears with the claim.

The source is verified. Version 2.0.0 is at 0x5f04B3aA9BA68Db285a7216bDEB6efa9beb59962 on Arbitrum One, an exact match on Sourcify. It has no owner, no upgrade path and no fee. It also has a check(bountyId, allocationId) view that returns whether a payout would go through and, if not, why, so an indexer's tooling can ask without sending anything.

On the board at lodestar-dashboard.com/bounties, each open bounty now has one question, "Has an indexer earned it?". The page reads the SubgraphService's POIPresented events for the deployment since the bounty was posted, asks the contract about each allocation, and if one has earned it, offers Pay the indexer to whoever is looking. The skill has bounty-pay <id>, which does the same.

The limit we could not close

The contract cannot tell an empty POI from a real one. The SubgraphService stores when an allocation last presented a POI. It does not store the POI. And it records the time for an all-zero POI as well, which is how an indexer tells the protocol it has nothing to prove: the indexer forfeits its rewards for the period and cannot be slashed for it. We wrote a fork test that presents a zero POI as a real indexer and then asks the board; the board pays.

This is not rare. Of the 694 POI presentations in the 108,000 blocks before block 523,301,493, 20 were all zeroes.

The value of the POI exists only in the event, which a contract cannot read. So the page and the skill read it instead, and neither will send a payout for an allocation whose only POIs since the posting were empty. That is a courtesy and not a guarantee, because anybody can call the contract directly. A non-zero POI that is false is a different matter: that is the indexer's stake to lose in a dispute, which is the security the review asked us to inherit, and now we do.

Version 1 had the same hole, undocumented. We would rather have it in the header.

What was tested, and what was not

  • Eleven tests against a fork of Arbitrum One, using a real open allocation and the deployed SubgraphService: payout by a stranger, payments destination and no destination, wrong deployment, closed allocation, expiry, the cancel lock, and the zero POI.
  • On a local fork: a bounty posted with the skill, a payout refused for a zero POI, then 40 GRT paid to the indexer's payments destination from a wallet with no connection to it.
  • The board in a browser against that fork, in all four states.

No payout has happened on the deployed contract. It holds no bounties as this is published. Version 1's only payout was in May.

If you posted on version 1

Nobody outside this project did. Its three bounties were one from May, long settled, and two of ours from this morning, which we will take back when their 72 hours are up. The board no longer shows them.

Try it

Developers: lodestar-dashboard.com/move, step two.

Indexers: there is nothing to try, which was the point. Present your POIs.

Corrected 2026-11-12. Presenting the POI is not the end of it. A bounty is paid only when somebody sends distribute, and until then the contract still lets its developer cancel once the 72 hours are up, even after an indexer has presented the POI that earns it. So an indexer whose sync took longer than 72 hours should send the payout as soon as the POI lands: Pay the indexer on the board, or bounty-pay <id> in the skill. The board no longer offers a developer Cancel while it can see an indexer has earned the bounty, but the contract does not refuse, and changing that needs a new version of it.

Added the same evening, 2026-11-11. The review also asked for the bounties to be indexed, so that an indexer can automate against them. They are, in a nest and not a subgraph, which you can run yourself or ask ours, with no key:

curl 'https://nuthatch-indexer.com/nests/bounty-nest/sql?q=SELECT%20*%20FROM%20open_bounties'

It holds one bounty as this is written, and that one is ours: 5 GRT, posted to see the row arrive.