Skip to content

Allow closing allocations when maxBlock is set in manifest #1071

Open
@dwerner

Description

@dwerner

Previously, subgraphs continued scanning even when all the data sources had passed the end block.
This update finds the maximum end block across the data sources and stops the subgraph from scanning once the max_end_block is reached.

The agent won't be able to close allocations for those subgraphs because they aren't at chainhead.

related: graphprotocol/graph-node#5583

Activity

self-assigned this
on Dec 26, 2024
dwerner

dwerner commented on Feb 4, 2025

@dwerner
ContributorAuthor

Reproducing this with local-network:

  1. create a subgraph with endBlock defined (1000 in my case)
  2. deploy and allocate to it
  3. mine blocks past the end block defined
  4. verify that latestBlock in indexerStatus is remaining at 1000 while chainHeadBlock keeps on going
  5. queue up an unallocate and wait for the action to be executed
  6. observe this error below:
{
    "action": 3,
    "component": "AllocationManager",
    "error": {
        "cause": "POI not available for deployment at current epoch start block.\n              currentEpochStartBlock: 1210\n              deploymentStatus: [{\"subgraphDeployment\":{\"kind\":\"deployment-id\",\"value\":\"0x07e7cae9b5004024f70ad7d0f473b5b1867a7698fc871b9816e625a210d751fd\"},\"synced\":true,\"health\":\"healthy\",\"fatalError\":null,\"node\":\"default\",\"chains\":[{\"network\":\"hardhat\",\"latestBlock\":{\"number\":\"1000\",\"hash\":\"6a7425df7ae6b0e3cba250a85b1b370e49c05e1b08910732903731b8479af38c\"},\"chainHeadBlock\":{\"number\":\"1211\",\"hash\":\"d7487e29ab1280039235fc9d0faab92863cd85dc475a6660351fa20f44efa3c6\"},\"earliestBlock\":{\"number\":\"0\",\"hash\":\"0x0\"}}]}]",
        "code": "IE067",
        "explanation": "https://github.com/graphprotocol/indexer/blob/main/docs/errors.md#ie067"
    },
    "formatted_time": "2025-02-04 15:43:15:223",
    "hostname": "c829539864db",
    "level": 50,
    "level_text": "ERROR",
    "msg": "Failed to prepare tx call data",
    "name": "IndexerAgent",
    "pid": 173,
    "protocolNetwork": "eip155:1337",
    "time": 1738712595223
}
added a commit that references this issue on Feb 5, 2025

fix: closes issue #1071 - fetch a poi from the latestBlock if it's be…

dwerner

dwerner commented on Feb 5, 2025

@dwerner
ContributorAuthor

In my fix here #1085

{
    "action": 4,
    "allocation": "0xcD0A322b8177228bEBe503E1e5BEb94d17CcC32F",
    "amountGRT": "0.005",
    "component": "AllocationManager",
    "deployment": {
        "bytes32": "0x07e7cae9b5004024f70ad7d0f473b5b1867a7698fc871b9816e625a210d751fd",
        "ipfsHash": "QmNsWZYpBmqXm4zEZRq5GpaB1BJ2J1hP8LgwW5ySYSrK3i"
    },
    "formatted_time": "2025-02-05 11:36:40:956",
    "hostname": "c829539864db",
    "indexer": "0xf4EF6650E48d099a4972ea5B414daB86e1998Bd3",
    "indexingRewards": {
        "hex": "0x00",
        "type": "BigNumber"
    },
    "level": 30,
    "level_text": "INFO",
    "msg": "Successfully closed allocation",
    "name": "IndexerAgent",
    "pid": 5703,
    "poi": "0xa0385267ee1d724b48dab571b4e8b73e22d8726adc043e5f831fa74b5309dbbe",
    "protocolNetwork": "eip155:1337",
    "time": 1738784200956,
    "transaction": "0x9eb5cc2e69d7a35d14390bbd5f1d229105cc42095dd3230be3b696745761a950"
}

I am now able to resolve the PoI from the block automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

🗃️ Inbox

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @dwerner

      Issue actions

        Allow closing allocations when maxBlock is set in manifest · Issue #1071 · graphprotocol/indexer