Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
sduchesneau opened this issue Jun 29, 2023 · 0 comments · Fixed by #4768
Assignees
Labels
bug Something isn't working

Comments

@sduchesneau
Copy link
Contributor

sduchesneau commented Jun 29, 2023

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
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants