Skip to content

Commit

Permalink
feat: add isStaleAllocation
Browse files Browse the repository at this point in the history
Signed-off-by: Tomás Migone <tomas@edgeandnode.com>
  • Loading branch information
tmigone committed Feb 10, 2025
1 parent 7cd08cb commit 02d3cc7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/subgraph-service/contracts/SubgraphService.sol
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,13 @@ contract SubgraphService is
return _encodeAllocationProof(indexer, allocationId);
}

/**
* @notice See {ISubgraphService.isStaleAllocation}
*/
function isStaleAllocation(address allocationId) external view override returns (bool) {
return _allocations.get(allocationId).isStale(maxPOIStaleness);
}

/**
* @notice See {ISubgraphService.isOverAllocated}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,13 @@ interface ISubgraphService is IDataServiceFees {
*/
function encodeAllocationProof(address indexer, address allocationId) external view returns (bytes32);

/**
* @notice Checks if an allocation is stale
* @param allocationId The id of the allocation
* @return True if the allocation is stale, false otherwise
*/
function isStaleAllocation(address allocationId) external view returns (bool);

/**
* @notice Checks if an indexer is over-allocated
* @param allocationId The id of the allocation
Expand Down

0 comments on commit 02d3cc7

Please sign in to comment.