graphprotocol / mission-control-indexer

Technical indexer documentation and infrastructure templates for the Mission Control testnet
21 stars 4 forks source link

Indexer-agent allocated 4 times more GRT than in the rules table #107

Closed DevilsTime closed 4 years ago

DevilsTime commented 4 years ago

Somehow the indexer allocates 4 times more GRT than specified in the rules table

Indexer-agent logs - last 100 lines

https://pastebin.com/pyUiiRhU

Rules table

image

PostgreSQL rules

image

Explorer screenshot

image

Grafana screenshot

image


Deploying a new subgraph for testing purposes

QmNVmy3hA6JVqZfMGoQc68GsB9GzGiEVLjhR1pHLY2xwuS - OPYN - 0x02566ef8086a78d0657c0f1347d8079e8327d3d183cf1a8a5176de5d32956941

Explorer screenshot after new deployment

image

Grafana screenshot after new deployment

image

Behavior after new deployment

The indexer-agent allocated twice the amount of GRT than specified in the rules table

Indexer-agent logs for new deployment

https://pastebin.com/PfDKkTHM

PS: I've tried debugging this with @trader-payne but we could neither find the root of the problem, nor a fix for this issue.

trader-payne commented 4 years ago

This happened to me as well, but it's even worse.

Allocated 1 GRT to 12 subgraphs, explorer says I have 24 GRT allocated (it should've been 12 GRT, so doubled allocations - this is also confirmed by the fact that the agent is sending twice as many transactions as it should)

And the cherry on top is that my Explorer page says I have no allocations

I've reported this to Jannis directly because I think it's part of a bigger issue that I'm facing. Will update this page once I have some repro steps or anything that comes helpful.

image

trader-payne commented 4 years ago

Quick update on what I've written above:

From Jannis:

Some of you have reported that, even though you set an allocation amount of N in your rules, 2 * N GRT were allocated towards subgraphs (see https://github.com/graphprotocol/mission-control-indexer/issues/107). 
This is expected, but perhaps confusing. The allocationAmount is applied per allocation and by default, we use parallelAllocations = 2. 
So if you index 11 subgraphs, 22 allocations would be created (using 22 Ethereum transactions), each for allocationAmount GRT.

An alternative would be to use allocationAmount as the total and use allocationAmount / parallelAllocations for each allocation. 
Would that be less confusing? 
Consider that this is only consistent if you never change allocationAmount or parallelAllocations. 
If any of the two change (e.g. both increased by 1), only future/new allocations will use the new values, and existing allocations will use the old until they are closed.

Message link: https://discordapp.com/channels/438038660412342282/737341252835737641/760045365461909514

trader-payne commented 4 years ago

Also, this issue is a duplicate of https://github.com/graphprotocol/mission-control-indexer/issues/67