Skip to content

chore: move all interfaces to dedicated package #1187

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 29 commits into
base: horizon
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
be8d5a1
chore: move all interfaces to dedicated package
tmigone Jun 11, 2025
942c1aa
chore: lint
tmigone Jun 11, 2025
f86ffbb
chore: build interface types
tmigone Jun 11, 2025
63b8c27
fix: import in contracts package
tmigone Jun 11, 2025
32ef00c
chore: move sdk to own repo, update versions
tmigone Jun 12, 2025
f8bb3a5
chore: update toolshed to use interfaces package
tmigone Jun 12, 2025
7f21b0b
chore: break circular dep in toolshed, fix contracts ethers versions
tmigone Jun 12, 2025
be1acc5
chore: lint
tmigone Jun 12, 2025
8aef58d
chore: fully implement interfaces for toolshed
tmigone Jun 13, 2025
0112d1b
chore: import hre statically in horizon and subgraph service
tmigone Jun 13, 2025
9c67f29
chore: remove unused files
tmigone Jun 13, 2025
495e576
chore: lint packages
tmigone Jun 13, 2025
71b90c4
fix: remove dead import
tmigone Jun 13, 2025
0f7080d
feat: create address book if doesnt exist when running deploy task
tmigone Jun 13, 2025
2bfd7e0
fix: add some missing interface details
tmigone Jun 13, 2025
62eb5aa
fix: couple fixes to make integration tests pass
tmigone Jun 13, 2025
5f707a8
chore: update subgraph service to work wiht latest interfaces
tmigone Jun 13, 2025
2c94da4
chore: final changes to use interfaces package
tmigone Jun 17, 2025
5ef5fe9
chore: lint and replace some imports
tmigone Jun 17, 2025
e75ae57
chore: bump package versions and publish
tmigone Jun 18, 2025
039a32e
chore: make interfaces package public
tmigone Jun 18, 2025
f6c2e1c
chore: bump package versions
tmigone Jun 18, 2025
31edeed
fix: ensure dist is published for interfaces package
tmigone Jun 18, 2025
4f23eea
chore: add missing interfaces and fix npm publishing issues
tmigone Jun 18, 2025
fbe38f9
fix: add ICuration to L2Curation interface
tmigone Jun 18, 2025
ed51926
fix: add more stuff missing from interfaces
tmigone Jun 18, 2025
b4fe809
chore: ensure workspace dependencies are not pinned to specific versions
tmigone Jun 19, 2025
a8469af
chore: better gitignore
tmigone Jun 19, 2025
8b7f14c
chore: fix pnpm lock file
tmigone Jun 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .changeset/huge-guests-say.md

This file was deleted.

6 changes: 6 additions & 0 deletions packages/hardhat-graph-protocol/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# hardhat-graph-protocol

## 0.2.5

### Patch Changes

- @graphprotocol/toolshed@0.6.5

## 0.2.4

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/hardhat-graph-protocol/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hardhat-graph-protocol",
"version": "0.2.4",
"version": "0.2.5",
"publishConfig": {
"access": "public"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/horizon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"hardhat": "^2.22.18",
"hardhat-contract-sizer": "^2.10.0",
"hardhat-gas-reporter": "^1.0.8",
"hardhat-graph-protocol": "workspace:^0.2.4",
"hardhat-graph-protocol": "workspace:^0.2.5",
"hardhat-secure-accounts": "^1.0.5",
"lint-staged": "^15.2.2",
"prettier": "^3.2.5",
Expand Down
7 changes: 7 additions & 0 deletions packages/interfaces/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @graphprotocol/interfaces

## 0.2.5

### Patch Changes

- fbe38f9: Add ICuration to L2Curation interface
- Add missing events to SubgraphService and RewardsManager interfaces

## 0.2.4

### Patch Changes
Expand Down
26 changes: 26 additions & 0 deletions packages/interfaces/contracts/toolshed/IRewardsManagerToolshed.sol
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General observation, sorry if painful to implement. :) Would a suffix like Type be better than Toolshed? (Make it about the purpose rather than where introduced?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes to all. It would be better and slightly painful, but worth it I believe. I'll add it to my to-do list, but need to knock off some higher prio items first.

Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,31 @@ pragma solidity ^0.7.6 || 0.8.27;
import { IRewardsManager } from "../contracts/rewards/IRewardsManager.sol";

interface IRewardsManagerToolshed is IRewardsManager {
/**
* @dev Emitted when rewards are assigned to an indexer.
*/
event RewardsAssigned(address indexed indexer, address indexed allocationID, uint256 amount);

/**
* @dev Emitted when rewards are assigned to an indexer.
* @dev We use the Horizon prefix to change the event signature which makes network subgraph development much easier
*/
event HorizonRewardsAssigned(address indexed indexer, address indexed allocationID, uint256 amount);

/**
* @dev Emitted when rewards are denied to an indexer.
*/
event RewardsDenied(address indexed indexer, address indexed allocationID);

/**
* @dev Emitted when a subgraph is denied for claiming rewards.
*/
event RewardsDenylistUpdated(bytes32 indexed subgraphDeploymentID, uint256 sinceBlock);

/**
* @dev Emitted when the subgraph service is set
*/
event SubgraphServiceSet(address indexed oldSubgraphService, address indexed newSubgraphService);

function subgraphService() external view returns (address);
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ import { IProvisionManager } from "./internal/IProvisionManager.sol";
import { IProvisionTracker } from "./internal/IProvisionTracker.sol";
import { IDataServicePausable } from "../data-service/IDataServicePausable.sol";
import { IMulticall } from "../contracts/base/IMulticall.sol";
import { IAllocationManager } from "./internal/IAllocationManager.sol";

interface ISubgraphServiceToolshed is
ISubgraphService,
IAllocationManager,
IOwnable,
IPausable,
IDataServicePausable,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.27;

interface IAllocationManager {
// Events
event AllocationCreated(
address indexed indexer,
address indexed allocationId,
bytes32 indexed subgraphDeploymentId,
uint256 tokens,
uint256 currentEpoch
);

event IndexingRewardsCollected(
address indexed indexer,
address indexed allocationId,
bytes32 indexed subgraphDeploymentId,
uint256 tokensRewards,
uint256 tokensIndexerRewards,
uint256 tokensDelegationRewards,
bytes32 poi,
bytes poiMetadata,
uint256 currentEpoch
);

event AllocationResized(
address indexed indexer,
address indexed allocationId,
bytes32 indexed subgraphDeploymentId,
uint256 newTokens,
uint256 oldTokens
);

event AllocationClosed(
address indexed indexer,
address indexed allocationId,
bytes32 indexed subgraphDeploymentId,
uint256 tokens,
bool forceClosed
);

event LegacyAllocationMigrated(
address indexed indexer,
address indexed allocationId,
bytes32 indexed subgraphDeploymentId
);

event MaxPOIStalenessSet(uint256 maxPOIStaleness);

// Errors
error AllocationManagerInvalidAllocationProof(address signer, address allocationId);
error AllocationManagerInvalidZeroAllocationId();
error AllocationManagerAllocationClosed(address allocationId);
error AllocationManagerAllocationSameSize(address allocationId, uint256 tokens);
}
2 changes: 1 addition & 1 deletion packages/interfaces/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@graphprotocol/interfaces",
"version": "0.2.4",
"version": "0.2.5",
"publishConfig": {
"access": "public"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/subgraph-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"hardhat": "^2.22.18",
"hardhat-contract-sizer": "^2.10.0",
"hardhat-gas-reporter": "^1.0.8",
"hardhat-graph-protocol": "workspace:^0.2.4",
"hardhat-graph-protocol": "workspace:^0.2.5",
"hardhat-secure-accounts": "^1.0.5",
"json5": "^2.2.3",
"lint-staged": "^15.2.2",
Expand Down
8 changes: 8 additions & 0 deletions packages/toolshed/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @graphprotocol/toolshed

## 0.6.5

### Patch Changes

- Updated dependencies [fbe38f9]
- Updated dependencies
- @graphprotocol/interfaces@0.2.5

## 0.6.4

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/toolshed/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@graphprotocol/toolshed",
"version": "0.6.4",
"version": "0.6.5",
"publishConfig": {
"access": "public"
},
Expand Down
Loading