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 all commits
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 4 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,7 @@ tx-builder-*.json
!tx-builder-template.json

# Hardhat Ignition
**/chain-31337/
**/chain-1337/
**/horizon-localhost/
**/horizon-hardhat/
**/subgraph-service-localhost/
**/subgraph-service-hardhat/
!**/ignition/**/artifacts/
**/ignition/deployments/*-localhost/
**/ignition/deployments/*-hardhat/
**/ignition/deployments/*-31337/
**/ignition/deployments/*-1337/
1 change: 1 addition & 0 deletions .markdownlintignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ deployments/hardhat/
**/horizon-hardhat/
**/subgraph-service-localhost/
**/subgraph-service-hardhat/
.changeset/
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@
This repository is a pnpm workspaces monorepo containing the following packages:
This repository is a pnpm workspaces monorepo containing the following packages:

| Package | Latest version | Description |
| --- | --- | --- |
| [contracts](./packages/contracts) | [![npm version](https://badge.fury.io/js/@graphprotocol%2Fcontracts.svg)](https://badge.fury.io/js/@graphprotocol%2Fcontracts) | Contracts enabling the open and permissionless decentralized network known as The Graph protocol. |
| [eslint-graph-config](./packages/eslint-graph-config) | - | Shared linting and formatting rules for TypeScript projects. |
| [horizon](./packages/horizon) | - | Contracts for Graph Horizon, the next iteration of The Graph protocol. |
| [sdk](./packages/sdk) | [![npm version](https://badge.fury.io/js/@graphprotocol%2Fsdk.svg)](https://badge.fury.io/js/@graphprotocol%2Fsdk) | TypeScript based SDK to interact with the protocol contracts |
| [solhint-graph-config](./packages/solhint-graph-config) | - | Shared linting and formatting rules for Solidity projects. |
| [solhint-plugin-graph](./packages/solhint-plugin-graph) | - | Plugin for Solhint with specific Graph linting rules. |
| [subgraph-service](./packages/subgraph-service) | - | Contracts for the Subgraph data service in Graph Horizon. |
| [token-distribution](./packages/token-distribution) | [![npm version](https://badge.fury.io/js/@graphprotocol%2Ftoken-distribution.svg)](https://badge.fury.io/js/@graphprotocol%2Ftoken-distribution) | Contracts managing token locks for network participants |
| Package | Latest version | Description |
| ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------- |
| [contracts](./packages/contracts) | [![npm version](https://badge.fury.io/js/@graphprotocol%2Fcontracts.svg)](https://badge.fury.io/js/@graphprotocol%2Fcontracts) | Contracts enabling the open and permissionless decentralized network known as The Graph protocol. |
| [eslint-graph-config](./packages/eslint-graph-config) | - | Shared linting and formatting rules for TypeScript projects. |
| [horizon](./packages/horizon) | - | Contracts for Graph Horizon, the next iteration of The Graph protocol. |
| [sdk](./packages/sdk) | [![npm version](https://badge.fury.io/js/@graphprotocol%2Fsdk.svg)](https://badge.fury.io/js/@graphprotocol%2Fsdk) | TypeScript based SDK to interact with the protocol contracts |
| [solhint-graph-config](./packages/solhint-graph-config) | - | Shared linting and formatting rules for Solidity projects. |
| [solhint-plugin-graph](./packages/solhint-plugin-graph) | - | Plugin for Solhint with specific Graph linting rules. |
| [subgraph-service](./packages/subgraph-service) | - | Contracts for the Subgraph data service in Graph Horizon. |
| [token-distribution](./packages/token-distribution) | [![npm version](https://badge.fury.io/js/@graphprotocol%2Ftoken-distribution.svg)](https://badge.fury.io/js/@graphprotocol%2Ftoken-distribution) | Contracts managing token locks for network participants |

## Development

Expand Down Expand Up @@ -110,7 +110,7 @@ Packages are published and distributed via NPM. To publish a package, run the fo
# Publish the packages
$ pnpm changeset publish

# Alternatively use
# Alternatively use
$ pnpm publish --recursive
```

Expand Down
2 changes: 1 addition & 1 deletion count-patterns.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# Include patterns (files to count):
packages/issuance/contracts/**/*.sol
packages/contracts/contracts/rewards/RewardsManager*.sol
packages/common/contracts/**/*.sol
packages/interfaces/contracts/**/*.sol

# Exclude patterns (files to ignore):
!*/mocks/*.sol
Expand Down
2 changes: 1 addition & 1 deletion natspec-smells.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

/** @type {import('@defi-wonderland/natspec-smells').Config} */
module.exports = {
include: ['packages/issuance/contracts/**/*.sol', 'packages/common/contracts/**/*.sol'],
include: ['packages/issuance/contracts/**/*.sol', 'packages/interfaces/contracts/**/*.sol'],

root: './',

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"postinstall": "husky",
"clean": "pnpm -r run clean",
"clean:all": "pnpm clean && rm -rf node_modules packages/*/node_modules",
"build": "chmod +x ./scripts/build && ./scripts/build",
"build": "pnpm -r run build",
Copy link
Contributor

Choose a reason for hiding this comment

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

Good for this PR, a discussion point though:

Locally I am trying splitting build to build:dep (build dependencies) and build:self (only build package currently in). Then:

  1. In non-root packages build -> pnpm build:dep && pnpm build:self
  2. In root package build -> pnpm -r run build:self, because this one should not be recursive, just do each in individually once in dependency order.
  3. In other targets like test in (non-root) package at pnpm build && to existing. Bascially I don't want to have to worry about rebuilding, although might be worth making original target test:no-build or something so can do that.
  4. Worth noting might be some tuning in places to make it more efficient where no rebuild in required.

Copy link
Member Author

Choose a reason for hiding this comment

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

Do you think we should keep child packages long term? I don't exactly remember at this point why we added those, I think to break the cyclic dependency? If so, perhaps with interfaces package we can simplify it?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we need child packages, and/or siblings that combine dependencies across contract packages.

They are to break cyclic dependencies, I think interfaces does not by itself fully solve that. It might mean that contract packages no longer rely on toolshed? Or is that still via dynamic loading? However, deployment has cross package needs for compiled contracts. (I think there is an argument for having a single deploy sibling, that spans contract packages.)

The same scenario for tests, similar nuances to deploy, but I think not as strong a case for (just) a single test package spanning contract packages.

If we do not separate them, I think we can appear to get away with it by recompiling dependencies, which the hardhat-dependency-compiler can do, but then you end up with other issues due to that duplication and inconsistency.

I suspect contract compilation should be separate reusable step from what we do with the compilied artifacts (deployment, testing, etc). But I might be missing something; I am new to this package management system.

Copy link
Member Author

Choose a reason for hiding this comment

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

Got it. I'm not too sold on any alternative to be honest, there are things i dislike in both :p. But happy to keep iterating.

"lint": "pnpm lint:ts; pnpm lint:sol; pnpm lint:natspec; pnpm lint:md; pnpm lint:json; pnpm lint:yaml",
"lint:ts": "eslint --fix --cache '**/*.{js,ts,cjs,mjs,jsx,tsx}'; prettier -w --cache --log-level warn '**/*.{js,ts,cjs,mjs,jsx,tsx}'",
"lint:sol": "solhint --fix --noPrompt --noPoster 'packages/*/contracts/**/*.sol'; prettier -w --cache --log-level warn '**/*.sol'",
Expand Down
126 changes: 0 additions & 126 deletions packages/common/README.md

This file was deleted.

141 changes: 0 additions & 141 deletions packages/common/contracts/rewards/IRewardsManager.sol

This file was deleted.

Loading
Loading