graph-network-subgraph icon indicating copy to clipboard operation
graph-network-subgraph copied to clipboard

Epoch entity endBlock overlaps startBlock of next epoch

Open abarmat opened this issue 4 years ago • 0 comments

Issue

Epoch endBlock should be one block before startBlock of next Epoch to avoid overlapping.

Solution

This can be fixed by calculating endBlock = startBlock + epochLength - 1

Current Behaviour

By querying the endpoint https://gateway.testnet.thegraph.com/network you get these results.

Query

query MyQuery {
  epoches(orderBy:"startBlock", orderDirection: "desc") {
    id
    endBlock
    startBlock
  }
}

Result

{
  "data": {
    "epoches": [
      {
        "endBlock": 8366425,
        "id": "719",
        "startBlock": 8366148
      },
      {
        "endBlock": 8366148,
        "id": "718",
        "startBlock": 8365871
      },
}

abarmat avatar Apr 06 '21 17:04 abarmat