-
Notifications
You must be signed in to change notification settings - Fork 992
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
Add timestamp
to _meta.block
#3060
Comments
Actually in a call by block hash going to the block cache is always necessary anyways, so this wouldn't add overhead in that case which is the relevant one in the network. |
@azf20 Circling back on this. This was an issue yesterday as we did not receive new blocks from one of the chains. The front-ends do not know much about it unless they have a second source of block info to compare. Do you still think this is not a quick win? |
For Hash constraint: The
For number constraint: It looks like we don't actually query anything, in this case the timestamp either cannot be provided or we'd need to add the call here as well.
Lastly, the issue seems to be figuring the freshness of the last block being served specifically. If this is the case, adding a timestamp doesn't distinguish between the block not being ingested or the block not being produced by the chance (on an outage). Perhaps just having a meta field for |
Thanks for the follow up. Since the whole query including There you can have So having this very simple tool, a consumer can always know how fresh its data is, regardless of the underlying complexities. Stable chains have usually a more or less predictable block times and some dapps are happy with data that is 2-10 blocks old. So they can do a simple math in the frontend like "average block time" * "acceptable number of blocks behind" and then check the freshness and display a warning if it is outdated. The idea is also that the front-end does not need to send a query to the indexer-status endpoint and to the graph-node endpoint to know about data freshness. |
Do you want to request a feature or report a bug?
A feature
What is the current behavior?
If a subgraph consumer wants to know the freshness of their subgraph, they can send a query like:
Now they know until which block that subgraph is indexed, but without another source (JSON RPC endpoint like Infura or Alchemy) of what is the number of the latest block they do not know how fresh the subgraph is.
What is the expected behavior?
It would be much simpler to be also able to query for the timestamp of the block that a subgraph has indexed. Like:
With a timestamp, they can directly calculate the freshness by comparing it to the system time.
The text was updated successfully, but these errors were encountered: