Skip to content

[Feature] Query data from a fixed amount of blocks before latest #4560

Open
@monitz87

Description

@monitz87

Description

A nice DevX improvement would be to allow querying for data in a way akin to this

query {
  someEntity(block: {
    number: -100
  }) {
    # fields ...
  }
}

This query would fetch data at block latest - 100.

The rationale here is that a very common use case is to fetch data at a fixed amount of blocks prior to the tip to avoid data inconsistencies due to chain reorgs (or, in other words, to ensure data finality). AFAIK, right now the only way to do that is to first query the latest indexed block, and then perform the desired query at latest - n, which is cumbersome and repetitive.

Are you aware of any blockers that must be resolved before implementing this feature? If so, which? Link to any relevant GitHub issues.

No response

Some information to help us out

  • Tick this box if you plan on implementing this feature yourself.
  • I have searched the issue tracker to make sure this issue is not a duplicate.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions