diff --git a/packages/subgraph-service/contracts/SubgraphService.sol b/packages/subgraph-service/contracts/SubgraphService.sol index f43669133..b1eecb469 100644 --- a/packages/subgraph-service/contracts/SubgraphService.sol +++ b/packages/subgraph-service/contracts/SubgraphService.sol @@ -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} */ diff --git a/packages/subgraph-service/contracts/interfaces/ISubgraphService.sol b/packages/subgraph-service/contracts/interfaces/ISubgraphService.sol index da04b48ee..7639ed4fb 100644 --- a/packages/subgraph-service/contracts/interfaces/ISubgraphService.sol +++ b/packages/subgraph-service/contracts/interfaces/ISubgraphService.sol @@ -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