Skip to content

Allow specifying the earliest block to consider in a query #1888

@lutter

Description

@lutter

We have block constraints for queries that effectively say 'only consider data as of that or an earlier block', so that a query like
things(block: {number: 1000}) { .. } will only return entities that were created before or at block 1000.

In a similar fashion, it should be possible to specify that only entities that were created or changed after a certain block should be considered for the query, so that it is possible to query things(block: { number: 1000, since: 500 }) which would only consider entities that were created or updated after block 500 but before block 1000.

This is particularly useful for use cases where the client needs to download the entire collection of entities. With this facility, they could download all entities as of a certain block, and then only receive the updates that happened after that block, which will be much faster than continually downloading the entire collection.

Note that for the current block constraint, it is possible to specify either a block number or a block hash; that is not needed for the since restriction, as the since means 'the block with that number that is an ancestor of the block we are querying against' and therefore unambiguous.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions