Skip to content

[Bug] Status PublicProofsOfIndexing returns "Null value resolved for non-null field proofOfIndexing" if block not in cache #4730

Closed

Description

@sduchesneau

Bug report

#Description

While looking at the PublicProofsOfIndexing endpoint for substreams-based subgraph, we found that the endpoint will return the following error "Null value resolved for non-null field proofOfIndexing" if the block is not in the cache.

How to reproduce:

  1. Deploy a substreams-based subgraph on a new graph-node instance+DB
  2. Query your status-endpoint for an "old" block that has been indexed
http post <status-endpoint> query='query PublicProofsOfIndexing {
        publicProofsOfIndexing(
            requests: [{deployment: "'$HASH'", blockNumber: '$BLOCKNUM'}]
        ) {
            deployment
            proofOfIndexing
            block {
                hash
                number
            }
        }
    }'

Workarounds

  1. only query POIs for block_number very close to head (the subgraph must have reached this block...)
  2. insert manually the block number, hash and timestamp in the database for the blocks that you want to query, like this:
    insert into chain1.blocks (number,hash,parent_hash,data) values (12369753, decode('892ecc03181a92b32897a55b9d551f0682793b8bc124e616b99c650774242dc5', 'hex'),decode('81c1334a1471b8a461a95dbdf153d956614d7f95f099e9b5fcb8680480e3ca36', 'hex'),'{"block": {"data": null, "timestamp": "1620161788"}}')

Proposed solution

Lazy loading the missing block from RPC or firehose during the POI query if it is found to be null.

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions