What happens
When the same public IP is registered on more than one farm, the indexer can end up
dropping that IP completely — it disappears from GraphQL even though the chain still
has it.
Why
PublicIp is stored one row per IP address, with no farm in the key. In
farmUpdated we look the IP up by address alone:
const savedIP = await ctx.store.get(PublicIp, { where: { ip: ip.ip.toString() }, ... })
So the row belongs to whichever farm claimed the IP first. Any farm that claims it
later finds the row already taken and skips it — no row is created for that farm.
Then, when the first farm eventually gives the IP up, the cleanup step at the end of
farmUpdated deletes the row. Nobody recreates it, so the IP is gone for good even
though it is still assigned to the second farm on chain.
Example (devnet)
125.25.25.2/16 was claimed by farm 2586 (block 10132677), then farm 4291
(block 10142664), then farm 2591 (block 10449919). On chain it currently belongs to
farm 2591. In GraphQL it does not exist at all.
How much it affects us
Small, and only in this one situation — it needs the same IP on two farms, which
shouldn't normally happen.
- devnet: 48 IPs sit on more than one farm. 7 chain IPs are missing from GraphQL.
- mainnet: 3 IPs sit on more than one farm (all shared between farms 44 and 3630).
1 chain IP is missing from GraphQL, and those 3 only ever show under farm 44.
Not a regression
This is long-standing behaviour, not something v2.13.0 introduced. The same code is
in v2.12.3. v2.13.0 actually improved things: before the resync devnet was missing 10
IPs, now it is missing 7, and the 32 IPs that had the wrong gateway are all correct
now. No IP is missing today that wasn't missing before.
Filing this so the remaining case isn't forgotten — it does not need to block anything.
Suggested fix
Key PublicIp by farm + IP instead of IP alone, so two farms can hold the same
address, and scope the lookup and the cleanup in farmUpdated to the farm being
updated. This changes entity IDs, so it needs a resync to take effect.
What happens
When the same public IP is registered on more than one farm, the indexer can end up
dropping that IP completely — it disappears from GraphQL even though the chain still
has it.
Why
PublicIpis stored one row per IP address, with no farm in the key. InfarmUpdatedwe look the IP up by address alone:So the row belongs to whichever farm claimed the IP first. Any farm that claims it
later finds the row already taken and skips it — no row is created for that farm.
Then, when the first farm eventually gives the IP up, the cleanup step at the end of
farmUpdateddeletes the row. Nobody recreates it, so the IP is gone for good eventhough it is still assigned to the second farm on chain.
Example (devnet)
125.25.25.2/16was claimed by farm 2586 (block 10132677), then farm 4291(block 10142664), then farm 2591 (block 10449919). On chain it currently belongs to
farm 2591. In GraphQL it does not exist at all.
How much it affects us
Small, and only in this one situation — it needs the same IP on two farms, which
shouldn't normally happen.
1 chain IP is missing from GraphQL, and those 3 only ever show under farm 44.
Not a regression
This is long-standing behaviour, not something v2.13.0 introduced. The same code is
in v2.12.3. v2.13.0 actually improved things: before the resync devnet was missing 10
IPs, now it is missing 7, and the 32 IPs that had the wrong gateway are all correct
now. No IP is missing today that wasn't missing before.
Filing this so the remaining case isn't forgotten — it does not need to block anything.
Suggested fix
Key
PublicIpby farm + IP instead of IP alone, so two farms can hold the sameaddress, and scope the lookup and the cleanup in
farmUpdatedto the farm beingupdated. This changes entity IDs, so it needs a resync to take effect.