Skip to content

Commit 54af1a7

Browse files
committed
Merge branch 'main' into tmigone/allow-early-closure
2 parents 0a7dca8 + 59154f7 commit 54af1a7

File tree

461 files changed

+50229
-11391
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

461 files changed

+50229
-11391
lines changed

.changeset/config.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "restricted",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}

.gitattributes

-1
This file was deleted.

.github/actions/setup/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ runs:
1717
run: yarn --immutable
1818
- name: Build
1919
shell: bash
20-
run: yarn build
20+
run: yarn build || yarn build

.github/workflows/ci.yml .github/workflows/ci-contracts.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI
1+
name: CI - packages/contracts
22

33
env:
44
CI: true
@@ -23,7 +23,9 @@ jobs:
2323
- name: Set up environment
2424
uses: ./.github/actions/setup
2525
- name: Run tests
26-
run: yarn test:coverage
26+
run: |
27+
pushd packages/contracts
28+
yarn test:coverage
2729
- name: Upload coverage report
2830
uses: codecov/codecov-action@v3
2931
with:

.github/workflows/ci-token-dist.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: CI - packages/token-distribution
2+
3+
env:
4+
CI: true
5+
6+
on:
7+
push:
8+
branches: "*"
9+
paths:
10+
- packages/token-distribution/**
11+
pull_request:
12+
branches: "*"
13+
paths:
14+
- packages/token-distribution/**
15+
workflow_dispatch:
16+
17+
jobs:
18+
test-ci:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
- name: Set up environment
24+
uses: ./.github/actions/setup
25+
- name: Run tests
26+
run: yarn test

.github/workflows/e2e.yml .github/workflows/e2e-contracts.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: E2E
1+
name: E2E - packages/contracts
22

33
env:
44
CI: true
@@ -9,7 +9,7 @@ on:
99
paths:
1010
- packages/contracts/contracts/**
1111
- packages/contracts/config/**
12-
- packages/contracts/e2e/**
12+
- packages/contracts/test/e2e/**
1313
- packages/contracts/tasks/**
1414
- packages/contracts/scripts/**
1515
- packages/contracts/hardhat.config.ts
@@ -18,7 +18,7 @@ on:
1818
paths:
1919
- packages/contracts/contracts/**
2020
- packages/contracts/config/**
21-
- packages/contracts/e2e/**
21+
- packages/contracts/test/e2e/**
2222
- packages/contracts/tasks/**
2323
- packages/contracts/scripts/**
2424
- packages/contracts/hardhat.config.ts
@@ -41,4 +41,5 @@ jobs:
4141
sed -i'' -e 's/^\(.*dev.period.*\)/# \1/' docker-compose.yaml
4242
./test-node.bash --init --batchposters 0 --redundantsequencers 0 --detach
4343
popd
44+
pushd packages/contracts
4445
L1_NETWORK=localnitrol1 L2_NETWORK=localnitrol2 yarn test:e2e

.github/workflows/verifydeployed.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ jobs:
3636
with:
3737
name: contract-artifacts
3838
path: |
39-
build
40-
cache/*.json
39+
packages/contracts/build
40+
packages/contracts/cache/*.json
4141
4242
verify:
4343
name: Verify deployments
@@ -54,7 +54,7 @@ jobs:
5454
name: contract-artifacts
5555

5656
- name: Verify contracts on Defender
57-
run: yarn hardhat --network ${{ inputs.network }} verify-defender ${{ inputs.contracts }}
57+
run: cd packages/contracts && yarn hardhat --network ${{ inputs.network }} verify-defender ${{ inputs.contracts }}
5858
env:
5959
DEFENDER_API_KEY: "${{ secrets.DEFENDER_API_KEY }}"
6060
DEFENDER_API_SECRET: "${{ secrets.DEFENDER_API_SECRET }}"

.gitignore

+9-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ yarn-error.log*
66
node_modules/
77

88
# Yarn
9-
.yarn/*
9+
.yarn/
1010
!.yarn/patches
1111
!.yarn/releases
1212
!.yarn/plugins
@@ -21,6 +21,7 @@ cached/
2121
# Build artifacts
2222
dist/
2323
build/
24+
deployments/hardhat/
2425

2526
# Ignore solc bin output
2627
bin/
@@ -42,4 +43,10 @@ tx-*.log
4243
addresses-fork.json
4344

4445
# Keys
45-
.keystore
46+
.keystore
47+
48+
# Graph client
49+
.graphclient
50+
51+
tx-builder-*.json
52+
!tx-builder-template.json

.yarnrc.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
nodeLinker: node-modules
2+
nmHoistingLimits: workspaces

README.md

+32-8
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ This repository is a Yarn workspaces monorepo containing the following packages:
3737
| Package | Latest version | Description |
3838
| --- | --- | --- |
3939
| [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. |
40+
| [eslint-graph-config](./packages/eslint-graph-config) | [![npm version]()]() | Shared linting and formatting rules for TypeScript projects. |
41+
| [token-distribution](./packages/token-distribution) | - | Contracts managing token locks for network participants |
4042
| [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 |
43+
| [solhint-graph-config](./packages/eslint-graph-config) | [![npm version]()]() | Shared linting and formatting rules for Solidity projects. |
4144

4245

4346
## Development
@@ -65,21 +68,42 @@ $ yarn
6568
$ yarn build
6669
```
6770

68-
### Versioning a package
71+
### Versioning and publishing packages
6972

70-
To version a package, run the following command from the root of the repository:
73+
We use [changesets](https://github.com/changesets/changesets) to manage package versioning, this ensures that all packages are versioned together in a consistent manner and helps with generating changelogs.
74+
75+
#### Step 1: Creating a changeset
76+
77+
A changeset is a file that describes the changes that have been made to the packages in the repository. To create a changeset, run the following command from the root of the repository:
7178

7279
```bash
73-
# Change directory to the package you want to version
74-
$ cd packages/<package-name>
80+
$ yarn changeset
81+
```
82+
83+
Changeset files are stored in the `.changeset` directory until they are packaged into a release. You can commit these files and even merge them into your main branch without publishing a release.
7584

76-
# Bump the version
77-
$ yarn version <major|minor|patch>
85+
#### Step 2: Creating a package release
86+
87+
When you are ready to create a new package release, run the following command to package all changesets, this will also bump package versions and dependencies:
88+
89+
```bash
90+
$ yarn changeset version
91+
```
92+
93+
### Step 3: Tagging the release
94+
95+
__Note__: this step is meant to be run on the main branch.
96+
97+
After creating a package release, you will need to tag the release commit with the version number. To do this, run the following command from the root of the repository:
98+
99+
```bash
100+
$ yarn changeset tag
101+
$ git push --follow-tags
78102
```
79103

80-
__Note on cross referenced packages__: Bumping the version of a package that is cross referenced by another package will automatically bump the dependency version in the other package. For example, if you bump the version of `sdk` from `0.0.1` to `0.0.2`, the required version of `sdk` in the `contracts` package will automatically be bumped to `0.0.2`. Depending on the nature of the change you might need to bump (and publish) a new version of the `contracts` package as well.
104+
#### Step 4: Publishing a package release
81105

82-
### Publishing a package
106+
__Note__: this step is meant to be run on the main branch.
83107

84108
Packages are published and distributed via NPM. To publish a package, run the following command from the root of the repository:
85109

package.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
"packageManager": "[email protected]",
99
"workspaces": [
1010
"packages/contracts",
11-
"packages/sdk"
11+
"packages/eslint-graph-config",
12+
"packages/sdk",
13+
"packages/solhint-graph-config",
14+
"packages/token-distribution"
1215
],
1316
"scripts": {
1417
"postinstall": "husky install",
@@ -19,6 +22,7 @@
1922
"test": "yarn workspaces foreach --all --parallel --verbose --interlaced run test"
2023
},
2124
"devDependencies": {
25+
"@changesets/cli": "^2.27.1",
2226
"@commitlint/cli": "^18.4.3",
2327
"@commitlint/config-conventional": "^18.4.3",
2428
"husky": "^8.0.3"

packages/contracts/.eslintignore

-7
This file was deleted.

packages/contracts/.eslintrc

-19
This file was deleted.

packages/contracts/.prettierignore

-4
This file was deleted.

packages/contracts/.prettierrc.json

-35
This file was deleted.

packages/contracts/CHANGELOG.md

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# @graphprotocol/contracts
2+
3+
## 6.2.1
4+
5+
### Patch Changes
6+
7+
- Round up when calculating curation tax
8+
- Round up when calculating consecutive stake thawing periods
9+
10+
## 6.2.0
11+
12+
### Minor Changes
13+
14+
- Update implementation addresses with GGP 31, 34 and 35
15+
16+
### Patch Changes
17+
18+
- 554af2c: feat(utils): add utility to parse subgraph ids
19+
- Updated dependencies [554af2c]
20+
- Updated dependencies [c5641c5]
21+
- @graphprotocol/sdk@0.5.0
22+
23+
## 6.1.3
24+
25+
### Patch Changes
26+
27+
- Ensure globbing is enabled in prepack
28+
29+
## 6.1.2
30+
31+
### Patch Changes
32+
33+
- Correctly pass ts file list to tsc in prepack
34+
35+
## 6.1.1
36+
37+
### Patch Changes
38+
39+
- Use prepack to correctly prepare outputs for the published package
40+
41+
## 6.1.0
42+
43+
### Minor Changes
44+
45+
- Introduce changesets for versioning
46+
- Add new staging implementations including GGPs 31, 34 and 35
47+
- Add new testnet implementations including GGPs 31, 34 and 35
48+
49+
### Patch Changes
50+
51+
- Fixes for verifyAll and bridge:send-to-l2 hardhat tasks

packages/contracts/TESTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ Scenarios are defined by an optional script and a test file:
9292
- Optional ts script
9393
- The objective of this script is to perform actions on the protocol to advance it's state to the desired one.
9494
- Should follow hardhat script convention.
95-
- Should be named e2e/scenarios/{scenario-name}.ts.
95+
- Should be named test/e2e/scenarios/{scenario-name}.ts.
9696
- They run before the test file.
9797
- Test file
98-
- Should be named e2e/scenarios/{scenario-name}.test.ts.
98+
- Should be named test/e2e/scenarios/{scenario-name}.test.ts.
9999
- Standard chai/mocha/hardhat/ethers test file.

0 commit comments

Comments
 (0)