graph-network-subgraph
graph-network-subgraph copied to clipboard
Epoch entity endBlock overlaps startBlock of next epoch
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
},
}