Skip to content

❄️ Graph Horizon and Subgraph Service ❄️ #944

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 580 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 124 commits
Commits
Show all changes
580 commits
Select commit Hold shift + click to select a range
d02f410
fix: separate delegation and delegationWithBeneficiary thaw requests …
Maikol Nov 29, 2024
167055a
fix: round down tokens thawing when slashing (TRST-H04)
Maikol Dec 2, 2024
4d75947
fix: dispute manager refactor (TRST-M07 / TRST-M08)
tmigone Nov 29, 2024
def8026
fix: ignore thawing tokens on provision token check (TRST-L13)
tmigone Dec 3, 2024
2e10813
fix: clarify data service initialization modes (TRST-L01)
tmigone Dec 3, 2024
2bf4456
fix: verify state transition for tap collector thawing signers (TRST-…
tmigone Dec 3, 2024
abe3321
fix: add legacy slasher for transition period (TRST-H06)
Maikol Dec 3, 2024
63ee9ed
fix: verify state transition for pause guardian (TRST-R03)
tmigone Dec 3, 2024
194b603
fix: add storage gap to upgradeable contract (TRST-R04)
tmigone Dec 4, 2024
29ed2e6
fix: allow setting pause guardian when paused (TRST-R05)
tmigone Dec 4, 2024
c8ede7a
fix: clarify initialization needs for data service extensions (TRST-R06)
tmigone Dec 4, 2024
f254897
fix: add missing legacy withdraw delegated (TRST-H07)
Maikol Dec 4, 2024
91cda56
fix: added minimum delegation for provisions (TRST-M03)
Maikol Dec 4, 2024
07ef418
fix: operator check in closeAllocation (TRST-M12)
Maikol Dec 4, 2024
26e4dc7
fix: getThawedTokens calculation (TRST-L03)
Maikol Dec 4, 2024
c9f8a2f
fix: documentation on unstake (TRST-M11)
Maikol Dec 4, 2024
9271b99
fix: remove unused value from event (TRST-R01)
Maikol Dec 4, 2024
151e63a
fix: round thawing shares up (TRST-R07)
Maikol Dec 5, 2024
4d62209
fix: remove redundant non-zero check (TRST-R09)
Maikol Dec 5, 2024
6e5a295
fix: check shares are not zero when creating a thaw request (TRST-R14)
Maikol Dec 5, 2024
d9c6190
fix: move legacyWithdrawDelegated to withdrawDelegated (TRST-H07)
Maikol Dec 6, 2024
161f8a2
fix: added comment for stack too deep solution
Maikol Dec 6, 2024
43bc72b
fix: added comment to explain minimum delegation (TRST-M03)
Maikol Dec 6, 2024
c59c186
fix: new event for minimum delegation not met (TRST-M03)
Maikol Dec 6, 2024
d1c5cc7
fix: add a new mapping instead of splitting thaw requests (TRST-H02)
Maikol Dec 6, 2024
0a31b58
fix: ensure subgraph service is set before using it (TRST-R10)
tmigone Dec 9, 2024
85de5bd
fix: documentation error (TRST-R09)
tmigone Dec 9, 2024
6ec9710
docs: add missing return value documentation (TRST-R)
tmigone Dec 9, 2024
6e00d17
docs: fix documentation errors (TRST-R09)
tmigone Dec 9, 2024
a065804
fix: refactor payments cut distribution (TRST-L12)
tmigone Dec 10, 2024
25d22e4
fix: added new function for accept dispute in conflict that includes …
Maikol Dec 13, 2024
dc79bd4
fix: add payer to EIP712 rav type hash (TRST-M15)
Maikol Dec 13, 2024
4ba215c
fix: accept dispute documentation
Maikol Dec 16, 2024
d6d376c
fix: legacy slashing underflow (TRST-H08)
Maikol Dec 12, 2024
7d90ad2
fix: underflow in getIdleStake (TRST-L14)
Maikol Dec 12, 2024
57aea44
fix: added thaw request type to thaw request fulfilled event (TRST-R15)
Maikol Dec 12, 2024
bbd23f5
fix: add minimum tokens amount for undelegate with beneficiary (TRST-…
Maikol Dec 13, 2024
399b7a9
fix: natspec for new undelegate error
Maikol Dec 13, 2024
032e4a4
Merge pull request #1073 from graphprotocol/mde/trust-staking-fixes
tmigone Dec 17, 2024
0542ab7
Merge branch 'horizon' into tmigone/trust-fixes-payments
tmigone Dec 17, 2024
1109537
Merge pull request #1072 from graphprotocol/tmigone/trust-fixes-payments
tmigone Dec 17, 2024
4a25bab
Merge branch 'horizon' into tmigone/trust-fixes-data-service
tmigone Dec 17, 2024
8e1144c
Merge pull request #1076 from graphprotocol/tmigone/trust-fixes-data-…
tmigone Dec 17, 2024
ac8a071
Merge branch 'horizon' into tmigone/trust-fixes-subgraph-service
tmigone Dec 17, 2024
2fbe0e1
Merge pull request #1074 from graphprotocol/tmigone/trust-fixes-subgr…
tmigone Dec 17, 2024
8aa05c4
Merge branch 'horizon' into tmigone/trust-fixes-dispute-manager
tmigone Dec 17, 2024
a228e0e
Merge pull request #1075 from graphprotocol/tmigone/trust-fixes-dispu…
tmigone Dec 17, 2024
2b03618
Merge branch 'horizon' into mde/horizon-and-subgrah-service-deploy-fix
tmigone Dec 17, 2024
0f2100d
Merge pull request #1062 from graphprotocol/mde/horizon-and-subgrah-s…
tmigone Dec 17, 2024
b1c1f8e
Merge branch 'horizon' into tmigone/update-hsa
tmigone Dec 17, 2024
27afeb8
Merge pull request #1070 from graphprotocol/tmigone/update-hsa
tmigone Dec 17, 2024
cd24658
Merge branch 'horizon' into tmigone/ignition-v0.15.7
tmigone Dec 17, 2024
170572f
Merge pull request #1069 from graphprotocol/tmigone/ignition-v0.15.7
tmigone Dec 17, 2024
58c518c
Merge branch 'horizon' into horizon-gre
tmigone Dec 17, 2024
468ed2c
Merge pull request #1071 from graphprotocol/horizon-gre
tmigone Dec 17, 2024
1038cf4
fix: use min delegation for SubgraphService tests (#1080)
Maikol Dec 17, 2024
a800d09
fix: cleanup IPaymentCollector + TAPCollector docs
matiasedgeandnode Jan 8, 2025
e1d173d
chore: added script to migrate protocol contracts to Horizon
Maikol Jan 9, 2025
1d097de
Merge pull request #1083 from graphprotocol/ma/horizon-ipayment-colle…
matiasedgeandnode Jan 13, 2025
51d0f7f
fix: add whenNotPaused to closeStaleAllocation (#1081)
Maikol Jan 15, 2025
ca2ef4f
chore: add over delegated test for SubgraphService (#1082)
Maikol Jan 15, 2025
9556549
fix: cleanup IPaymentCollector + TAPCollector docs
matiasedgeandnode Jan 8, 2025
4266a81
chore: update ignition to v0.15.9
tmigone Jan 14, 2025
c615fb0
chore: temp dirty fix for contract size
tmigone Jan 14, 2025
297b08d
feat: add script to patch ignition verification command
tmigone Jan 16, 2025
c21e43f
fix: merge fixes
tmigone Jan 22, 2025
6494bf8
chore: revert contract comments to reduce size
tmigone Jan 22, 2025
bfb85ca
chore: refactor ignition deployment modules
tmigone Jan 23, 2025
406c1fd
fix: merge HorizonStaking and HorizonStakingExtension abis
Maikol Jan 23, 2025
65b6d26
feat: add migrate ignition modules
tmigone Jan 24, 2025
3260bd2
fix: remove rpc
tmigone Jan 24, 2025
5e16b7e
feat: add more improvements to ignition deployment system
tmigone Jan 24, 2025
ea7fb75
Merge pull request #1091 from graphprotocol/mde/merge-horizon-staking…
tmigone Jan 27, 2025
83a3ec6
Merge branch 'horizon' into mde/horizon-migrate-scripts
tmigone Jan 27, 2025
17692b7
Merge pull request #1084 from graphprotocol/mde/horizon-migrate-scripts
tmigone Jan 27, 2025
353902e
Merge branch 'horizon' into tmigone/ignition-v0.15.9
tmigone Jan 27, 2025
519c5d8
Merge pull request #1087 from graphprotocol/tmigone/ignition-v0.15.9
tmigone Jan 27, 2025
835519f
Merge branch 'horizon' into tmigone/ignition-refactor
tmigone Jan 27, 2025
c3c94ca
Merge pull request #1093 from graphprotocol/tmigone/ignition-refactor
tmigone Jan 27, 2025
e8e2e9f
feat: create a base hardhat config
tmigone Jan 27, 2025
e7b02ae
feat: ensure ignition deploy script handles contract ownership
tmigone Jan 27, 2025
07aa0a2
chore: move ownership calls for payments contract to their modules
tmigone Jan 28, 2025
ea21739
fix: transfer payments contracts ownership to governor in migrate script
tmigone Jan 28, 2025
4799228
Merge pull request #1094 from graphprotocol/tmigone/tooling-improvements
tmigone Jan 28, 2025
5711907
feat: breakout ignition migration script by runner
tmigone Jan 28, 2025
a12bb20
fix: ensure governor account is not loaded in any non-governor module
tmigone Jan 28, 2025
7db331d
chore: reduce contract sizes to fit 24kb HorizonStaking and SubgraphS…
Maikol Jan 28, 2025
8c29d86
fix: further decouple governor modules from deployer modules
tmigone Jan 28, 2025
768bc83
chore: add contract address to signer proof message
Maikol Jan 28, 2025
fbdb3f1
feat: create migration scripts for subgraph service
tmigone Jan 28, 2025
5e58c8e
chore: changes to horizon events
Maikol Jan 28, 2025
7e10b2e
fix: add Horizon prefix to stake events
Maikol Jan 29, 2025
e2ea28c
fix: Horizon migration script fixes (#1100)
Maikol Feb 6, 2025
c75a0a4
Merge pull request #1095 from graphprotocol/tmigone/horizon-deploymen…
tmigone Feb 6, 2025
ccfaedc
fix: make legacy allos internal, bump optimizer runs to 100
tmigone Feb 6, 2025
859debf
fix: set optimizer runs on foundry config
tmigone Feb 6, 2025
11a993b
Merge pull request #1096 from graphprotocol/mde/reduce-contract-sizes
tmigone Feb 6, 2025
a4cb2d4
Merge pull request #1099 from graphprotocol/mde/horizon-event-changes
tmigone Feb 6, 2025
dfc6c97
Merge pull request #1098 from graphprotocol/mde/add-contract-address-…
tmigone Feb 6, 2025
6d64b7e
fix: rework base config file
tmigone Feb 6, 2025
88498d1
test: fix test using previously public variable
tmigone Feb 6, 2025
2872fd3
chore: fix linting issues
tmigone Feb 7, 2025
83dae89
ci: build all required packages for subgraph service ci
tmigone Feb 7, 2025
6e8335d
Merge pull request #1101 from graphprotocol/tmigone/horizon-fix-ci
tmigone Feb 7, 2025
33557eb
Merge branch 'main' into horizon
tmigone Feb 7, 2025
8f922a1
chore: remove e2e scenarios tests from contracts package
tmigone Feb 7, 2025
09a6fa8
chore: add paymentId to TAPCollector tokens tracking
Maikol Jan 28, 2025
fe025c3
fix: rename to collectorId and use collectorId on subgraph service
Maikol Feb 7, 2025
2af2e68
chore: rename collectorId to collectionId
tmigone Feb 10, 2025
3dc3140
Merge pull request #1097 from graphprotocol/mde/add-unique-id-to-coll…
tmigone Feb 10, 2025
6d1afc0
feat: extract cancel thaw escrow to its own function
tmigone Dec 11, 2024
74645a2
feat: add collector address to the RAV
tmigone Dec 11, 2024
744bc85
test: improve coverage for GraphPayments
tmigone Dec 13, 2024
eaec959
chore: some minor improvements to GraphPayments and tests
tmigone Dec 13, 2024
9b79fdb
fix: couple minor improvments to PaymentsEscrow and some new tests
tmigone Dec 13, 2024
90978a9
chore: revert adding collector address to RAV
tmigone Feb 6, 2025
20396ba
chore: revert adding collector address to RAV in SubgraphService
tmigone Feb 6, 2025
51976ec
Merge pull request #1078 from graphprotocol/tmigone/post-trust-change…
tmigone Feb 10, 2025
01db6e5
feat: dont issue rewards to allos less than one epoch old
tmigone Feb 10, 2025
7cd08cb
chore: ensure contract size is below 24kB
tmigone Feb 10, 2025
f6923b9
test: fix rewards manager tests
tmigone Feb 10, 2025
d0060b1
Merge pull request #1103 from graphprotocol/tmigone/allo-min-duration
tmigone Feb 11, 2025
dd2e735
chore: rename TAPCollector to GraphTallyCollector
tmigone Feb 11, 2025
94d541a
chore: rename TAPCollector in hardhat-graph-protocol package
tmigone Feb 11, 2025
010277e
Merge pull request #1106 from graphprotocol/tmigone/graph-tally
tmigone Feb 11, 2025
57c5acc
fix: ignition modules to output correct name of contracts
tmigone Feb 11, 2025
c5ca097
fix(horizon): add explicit check of provision existance before accept…
tmigone Feb 12, 2025
375c78f
chore: add request type to thaw request events
tmigone Feb 12, 2025
25376af
chore: modify build script to allow building only horizon packages
tmigone Feb 12, 2025
e9b72a7
test: add test for delegation on a non existing provision
tmigone Feb 13, 2025
0e9f9d3
Merge pull request #1107 from graphprotocol/tmigone/gre-alias
tmigone Feb 13, 2025
1b55b04
fix: Add 'test' to lint:sol (prettier)
matiasedgeandnode Feb 17, 2025
870a073
fix: SubgraphService run lint:sol
matiasedgeandnode Feb 17, 2025
3cccb4b
fix: Horizon add 'test' to lint:sol (prettier)
matiasedgeandnode Feb 17, 2025
3ad5707
fix: Horizon run lint:sol
matiasedgeandnode Feb 17, 2025
0df54e3
Merge pull request #1112 from graphprotocol/ma/horizon-fix-prettier
tmigone Feb 18, 2025
504d85b
feat: refactor deployment tooling, use task instead of script
tmigone Feb 14, 2025
1b9914d
feat: refactor deplyoment tooling for subgraph service
tmigone Feb 14, 2025
f2b120a
chore: update readme
tmigone Feb 14, 2025
6db8d05
fix: couple fixes for migration scripts
tmigone Feb 17, 2025
4260ce6
chore: update README.md
tmigone Feb 17, 2025
f978dbb
chore: remove not used deps
tmigone Feb 17, 2025
176d5b1
fix: dont import tasks on initial build run
tmigone Feb 18, 2025
fac2515
fix: remove dead export
tmigone Feb 18, 2025
9647fa8
chore: skip building token-distribution if api key not set
tmigone Feb 18, 2025
2e57fe7
fix: exit code 0 for token dist script
tmigone Feb 18, 2025
9287fa0
chore: add localnostNoSecureAccounts network to base hardhat config
tmigone Feb 18, 2025
44dd7ea
chore: update hardhat-secure-accounts to latest
tmigone Feb 18, 2025
333f98e
feat: allow overriding localhost rpc
tmigone Feb 18, 2025
e5aa136
chore: make localhost chain id a configurable variable
tmigone Feb 18, 2025
cbeb2e5
fix: ignition script bug
tmigone Feb 18, 2025
7bceb49
Merge pull request #1111 from graphprotocol/tmigone/horizon-deploymen…
tmigone Feb 18, 2025
5e09533
Merge pull request #1108 from graphprotocol/tmigone/horizon-subgraph-…
tmigone Feb 18, 2025
1f065e4
chore: refactor config files naming
tmigone Feb 19, 2025
1869d06
feat: allow overriding localhost accounts
tmigone Feb 19, 2025
9dc80f9
refactor: add Authorizable
matiasedgeandnode Feb 13, 2025
314c6da
Merge pull request #1110 from graphprotocol/ma/horizon-authorizable
matiasedgeandnode Feb 21, 2025
292dc69
fix: only allow subgraph service as verifier during transition period
tmigone Feb 21, 2025
662bf93
chore: fix comments
tmigone Feb 21, 2025
6460b84
chore: invert require checks for gas efficiency
tmigone Feb 21, 2025
c90a4ec
Merge pull request #1114 from graphprotocol/tmigone/fix-escape-hatch
tmigone Feb 21, 2025
cc74032
chore: fix test config to support forge v1
tmigone Feb 21, 2025
7df009f
Merge pull request #1115 from graphprotocol/tmigone/fix-escape-hatch
tmigone Feb 21, 2025
0b7730a
fix: a few fixes
tmigone Feb 24, 2025
26d5caa
Merge pull request #1118 from graphprotocol/tmigone/horizon-last-minu…
tmigone Feb 25, 2025
7187543
chore: change some events for easier indexing
tmigone Feb 25, 2025
830f7e8
fix: ensure subgraph service contracts are owned by governor
tmigone Feb 25, 2025
7bac074
Merge pull request #1119 from graphprotocol/tmigone/more-subgraph-cha…
tmigone Feb 25, 2025
401657e
chore: upload audit reports
tmigone Feb 27, 2025
5a4a550
fix: avoid boolean literals as conditionals
tmigone Feb 27, 2025
28c5bda
chore: natspec and other documentation changes
tmigone Feb 27, 2025
6435f64
chore: natspec documentation changes on subgraph service contracts
tmigone Feb 27, 2025
adf520e
chore: dont run natspec smells on lint
tmigone Feb 27, 2025
56e044a
chore: use calldata instead of memory
tmigone Feb 27, 2025
2e8d285
chore: remove duplicated imports
tmigone Feb 27, 2025
fc83f8f
chore: no todo comments
tmigone Feb 27, 2025
72066de
chore: dont use named returns
tmigone Feb 28, 2025
4f60b0c
chore: add security contact to the contracts
tmigone Feb 28, 2025
77ab0c7
chore: better getter name in dispute manager
tmigone Feb 28, 2025
5557c5e
chore: remove named returns
tmigone Feb 28, 2025
99f215c
chore: use custom errors
tmigone Feb 28, 2025
9e8004e
chore: clarify casting safety
tmigone Feb 28, 2025
36efdac
chore: remove unused modifier
tmigone Feb 28, 2025
da95d8b
Merge pull request #1123 from graphprotocol/tmigone/horizon-pre-audit…
tmigone Mar 3, 2025
2ed8546
fix: add collection id to rav typehash (OZ CR-01)
tmigone Mar 7, 2025
698259d
fix: prevent indexer lockout in subgraph service (OZ CR-02)
tmigone Mar 7, 2025
9d92442
fix: limit allowed thawing period range in the subgraph service (OZ M…
tmigone Mar 21, 2025
c4c3675
fix: save last parameter staged timestamp on provisions (OZ M-01)
tmigone Mar 21, 2025
2918ebe
chore: document importance of maxThawingPeriod variable
tmigone Apr 23, 2025
a43232a
chore: clarify thawing period overflow case
tmigone May 2, 2025
c58197a
fix: ensure invalid thaw requests are ignored by getThawedTokens (OZ …
tmigone Mar 21, 2025
5e27d62
fix: document possible temporary thaw requests blockage when thawing …
tmigone Mar 21, 2025
0a7719f
fix: prevent provision validity grief attack (OZ M-03)
tmigone Mar 25, 2025
c807a94
fix: remove redundant code (OZ N-01)
tmigone Mar 25, 2025
40c9a28
fix: only check conditions for param that is changing when changing p…
tmigone Mar 26, 2025
37faf78
fix: use solidity division instead of fixed point scaling (OZ L-04)
tmigone Mar 27, 2025
5adebe8
fix: rename misleading custom error name (OZ CR-03)
tmigone Mar 7, 2025
5744c86
fix: add extra parameters to contract events (OZ CR-04)
juanmardefago Feb 26, 2025
c8a7944
chore: typo
tmigone May 2, 2025
fc25c39
fix: prevent legacy slash from breaking provision accounting (OZ H-01)
tmigone Apr 23, 2025
927af0d
chore: rename function for clarity (OZ H-01)
tmigone Apr 30, 2025
8e07001
fix: ensure legacy slash unlocks correct amount
tmigone May 16, 2025
8c941cd
fix: default value for delegation ratio (OZ L-06)
tmigone Apr 24, 2025
6216621
fix: use encodeCall instead of unsafe alternatives (OZ L-10)
tmigone Apr 24, 2025
3761755
fix: ensure getRewards and takeRewards return 0 for closed allos (OZ …
tmigone Apr 29, 2025
40706ca
chore: document reentrancy risk vector
tmigone May 2, 2025
a01004e
fix: allow partial RAV collection in subgraph service (OZ L-13)
tmigone Apr 29, 2025
c7656f8
fix: ensure dispute cancellation is not affected by dispute period ch…
tmigone Apr 29, 2025
fec7173
fix: add cancellableAt to indexing disputes as well
tmigone May 2, 2025
3453c00
fix: remove unnecessary restriction (OZ N-02)
tmigone Apr 29, 2025
1012087
chore: remove unused code (OZ N-03)
tmigone Apr 29, 2025
14948be
chore: missing docstrings (OZ N-08)
tmigone Apr 29, 2025
c183fcd
chore: rename shadowed variables (OZ N-09)
tmigone Apr 29, 2025
f288348
chore: update incorrect comments (OZ N-10)
tmigone Apr 29, 2025
de935f0
chore: rename misleading vars (OZ N-11)
tmigone Apr 29, 2025
6fb20d7
chore: gas optimizations (OZ N-12)
tmigone Apr 29, 2025
46010c8
fix: prevent slashing DoS (OZ M-02)
tmigone Apr 30, 2025
7d517bf
fix: ensure delegations are always slashable (OZ H-02)
tmigone Apr 30, 2025
9ce4d11
chore: tests
tmigone May 2, 2025
792302a
chore: fix some copy in dispute manager comments
tmigone Mar 28, 2025
4a3cf2c
feat: require poi metadata when collecting rewards
tmigone Mar 28, 2025
c0e83cf
fix: allow payments to be routed to a provided address
tmigone May 8, 2025
b5fc680
fix: update contracts to allow compilation from horizon package
tmigone May 20, 2025
5787df8
fix: multiple tooling changes
tmigone May 20, 2025
d5bc312
chore: fix pnpm lock file
tmigone May 20, 2025
7d70566
Merge pull request #1116 from graphprotocol/tmigone/horizon-post-oz-a…
tmigone May 20, 2025
dadb233
chore: add latest audit
tmigone May 20, 2025
ad600bb
Merge pull request #1122 from graphprotocol/tmigone/horizon-audit-rep…
tmigone May 20, 2025
1edfe12
ci: update node version to 22
tmigone May 20, 2025
ffa75d1
fix: change hardhat toolshed to export ts
tmigone May 20, 2025
b8a0c14
feat: make transaction logging optional
tmigone May 21, 2025
7715ce2
fix: ensure transaction logging wrapping is disabled with boolean flag
tmigone May 22, 2025
d52644a
fix: ensure toolshed core components dont import hardhat runtime
tmigone May 22, 2025
eeee812
fix: auto balance set in local network
tmigone May 22, 2025
bbdef06
chore: bump version
tmigone May 22, 2025
ea14f20
fix: target undefined error
tmigone May 22, 2025
0247adb
chore: linting and other minor issues
tmigone May 23, 2025
ca4daad
chore: add proper ignition config files for local network
tmigone May 23, 2025
4368221
fix: protocol activity script small fixes
tmigone May 23, 2025
18b34c0
chore: improve activity script
tmigone May 23, 2025
e1663dd
feat: add GNS to deployments
tmigone May 27, 2025
9d6d356
chore: add encode stop service data function
Maikol May 30, 2025
fa4c2f5
chore: bump patch version
Maikol May 30, 2025
a7c9646
chore: publish new toolshed version
tmigone Jun 2, 2025
8f21cdb
fix: type issue with GNS on toolshed
tmigone Jun 2, 2025
f8809ac
ci: fix lockfile
tmigone Jun 2, 2025
3adce5a
fix: proper fix for type issues with GNS and SubgraphNFT
tmigone Jun 2, 2025
d07e8d9
ci: fix package lock
tmigone Jun 2, 2025
7870182
lint: fix linting script
matiasedgeandnode Jun 3, 2025
609bc3d
Merge pull request #1180 from graphprotocol/ma/horizon-lint
matiasedgeandnode Jun 3, 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
2 changes: 2 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ runs:
using: composite

steps:
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
- name: Enable corepack for modern yarn
shell: bash
run: corepack enable
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up environment
uses: ./.github/actions/setup
2 changes: 2 additions & 0 deletions .github/workflows/ci-contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up environment
uses: ./.github/actions/setup
- name: Run tests
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/ci-horizon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: CI - packages/horizon

env:
CI: true

on:
push:
branches: "*"
paths:
- packages/horizon/**
pull_request:
branches: "*"
paths:
- packages/horizon/**
workflow_dispatch:

jobs:
test-ci:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up environment
uses: ./.github/actions/setup
- name: Run tests
run: |
pushd packages/horizon
yarn test
30 changes: 30 additions & 0 deletions .github/workflows/ci-subgraph-service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: CI - packages/subgraph-service

env:
CI: true

on:
push:
branches: "*"
paths:
- packages/subgraph-service/**
pull_request:
branches: "*"
paths:
- packages/subgraph-service/**
workflow_dispatch:

jobs:
test-ci:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up environment
uses: ./.github/actions/setup
- name: Run tests
run: |
pushd packages/subgraph-service
yarn test
6 changes: 5 additions & 1 deletion .github/workflows/ci-token-dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up environment
uses: ./.github/actions/setup
- name: Run tests
run: yarn test
run: |
pushd packages/token-distribution
yarn test
2 changes: 2 additions & 0 deletions .github/workflows/e2e-contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up environment
uses: ./.github/actions/setup
- name: Run e2e tests
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up environment
uses: ./.github/actions/setup
- name: Publish 🚀
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/verifydeployed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up environment
uses: ./.github/actions/setup

Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ cached/
# Build artifacts
dist/
build/
typechain/
typechain-types/
deployments/hardhat/

# Ignore solc bin output
Expand All @@ -45,8 +47,10 @@ addresses-fork.json
# Keys
.keystore

# Forge artifacts
cache_forge
# Graph client
.graphclient

tx-builder-*.json
!tx-builder-template.json
!tx-builder-template.json
9 changes: 9 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[submodule "packages/subgraph-service/lib/forge-std"]
path = packages/subgraph-service/lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "packages/horizon/lib/forge-std"]
path = packages/horizon/lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "packages/horizon/lib/openzeppelin-foundry-upgrades"]
path = packages/horizon/lib/openzeppelin-foundry-upgrades
url = https://github.com/OpenZeppelin/openzeppelin-foundry-upgrades
12 changes: 11 additions & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,17 @@ pushd packages/contracts
npx --no-install lint-staged
popd

# subgraph service
pushd packages/subgraph-service
npx --no-install lint-staged
popd

# data-edge
pushd packages/data-edge
npx --no-install lint-staged
popd
popd

# graph horizon
pushd packages/horizon
npx --no-install lint-staged
popd
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,12 @@ This repository is a Yarn workspaces monorepo containing the following packages:
| --- | --- | --- |
| [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) | [![npm version]()]() | Shared linting and formatting rules for TypeScript projects. |
| [token-distribution](./packages/token-distribution) | - | Contracts managing token locks for network participants |
| [horizon](./packages/horizon) | [![npm version]()]() | 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/eslint-graph-config) | [![npm version]()]() | Shared linting and formatting rules for Solidity projects. |
| [solhint-graph-config](./packages/solhint-graph-config) | [![npm version]()]() | Shared linting and formatting rules for Solidity projects. |
| [solhint-plugin-graph](./packages/solhint-plugin-graph) | [![npm version]()]() | Plugin for Solhint with specific Graph linting rules. |
| [subgraph-service](./packages/subgraph-service) | [![npm version]()]() | Contracts for the Subgraph data service in Graph Horizon. |
| [token-distribution](./packages/token-distribution) | - | Contracts managing token locks for network participants |


## Development
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@
"packages/contracts",
"packages/data-edge",
"packages/eslint-graph-config",
"packages/horizon",
"packages/sdk",
"packages/solhint-graph-config",
"packages/solhint-plugin-graph",
"packages/subgraph-service",
"packages/token-distribution"
],
"scripts": {
Expand Down
14 changes: 0 additions & 14 deletions packages/contracts/.solhint.json

This file was deleted.

8 changes: 0 additions & 8 deletions packages/contracts/.solhintignore

This file was deleted.

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

## 7.0.0

### Major Changes

- 9686ce1: Add Horizon staking interface

## 6.2.1

### Patch Changes
Expand Down
5 changes: 5 additions & 0 deletions packages/contracts/contracts/arbitrum/Arbitrum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Arbitrum contracts

These contracts have been copied from the [Arbitrum repo](https://github.com/OffchainLabs/arbitrum).

They are also available as part of the npm packages [arb-bridge-eth](https://www.npmjs.com/package/arb-bridge-eth) and [arb-bridge-peripherals](https://www.npmjs.com/package/arb-bridge-peripherals). The reason for copying them rather than installing those packages is the contracts only support Solidity `^0.6.11`, so we had to change the version to `^0.7.6` for it to be compatible with our other contracts.
24 changes: 12 additions & 12 deletions packages/contracts/contracts/arbitrum/ITokenGateway.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*
*/

pragma solidity ^0.7.6;
pragma solidity ^0.7.6 || 0.8.26;

interface ITokenGateway {
/// @notice event deprecated in favor of DepositInitiated and WithdrawalInitiated
Expand All @@ -47,20 +47,20 @@ interface ITokenGateway {
// );

function outboundTransfer(
address _token,
address _to,
uint256 _amount,
uint256 _maxGas,
uint256 _gasPriceBid,
bytes calldata _data
address oken,
address t,
uint256 amunt,
uint256 maxas,
uint256 gasPiceBid,
bytes calldata data
) external payable returns (bytes memory);

function finalizeInboundTransfer(
address _token,
address _from,
address _to,
uint256 _amount,
bytes calldata _data
address token,
address from,
address to,
uint256 amount,
bytes calldata data
) external payable;

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/contracts/curation/ICuration.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity ^0.7.6;
pragma solidity ^0.7.6 || 0.8.26;

/**
* @title Curation Interface
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/contracts/epochs/IEpochManager.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity ^0.7.6;
pragma solidity ^0.7.6 || 0.8.26;

interface IEpochManager {
// -- Configuration --
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/contracts/gateway/ICallhookReceiver.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* be allowlisted by the governor, but also implement this interface that contains
* the function that will actually be called by the L2GraphTokenGateway.
*/
pragma solidity ^0.7.6;
pragma solidity ^0.7.6 || 0.8.26;

interface ICallhookReceiver {
/**
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/contracts/governance/Controller.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity ^0.7.6;
pragma solidity ^0.7.6 || 0.8.26;

import { IController } from "./IController.sol";
import { IManaged } from "./IManaged.sol";
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/contracts/governance/Governed.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity ^0.7.6;
pragma solidity ^0.7.6 || 0.8.26;

/**
* @title Graph Governance contract
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/contracts/governance/IController.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity >=0.6.12 <0.8.0;
pragma solidity ^0.7.6 || 0.8.26;

interface IController {
function getGovernor() external view returns (address);
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/contracts/governance/IManaged.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity ^0.7.6;
pragma solidity ^0.7.6 || 0.8.26;

import { IController } from "./IController.sol";

Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/contracts/governance/Pausable.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity ^0.7.6;
pragma solidity ^0.7.6 || 0.8.26;

abstract contract Pausable {
/**
Expand Down
20 changes: 2 additions & 18 deletions packages/contracts/contracts/l2/staking/IL2Staking.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ pragma abicoder v2;

import { IStaking } from "../../staking/IStaking.sol";
import { IL2StakingBase } from "./IL2StakingBase.sol";
import { IL2StakingTypes } from "./IL2StakingTypes.sol";

/**
* @title Interface for the L2 Staking contract
Expand All @@ -15,21 +16,4 @@ import { IL2StakingBase } from "./IL2StakingBase.sol";
* the custom setup of the Staking contract where part of the functionality is implemented
* in a separate contract (StakingExtension) to which calls are delegated through the fallback function.
*/
interface IL2Staking is IStaking, IL2StakingBase {
/// @dev Message codes for the L1 -> L2 bridge callhook
enum L1MessageCodes {
RECEIVE_INDEXER_STAKE_CODE,
RECEIVE_DELEGATION_CODE
}

/// @dev Encoded message struct when receiving indexer stake through the bridge
struct ReceiveIndexerStakeData {
address indexer;
}

/// @dev Encoded message struct when receiving delegation through the bridge
struct ReceiveDelegationData {
address indexer;
address delegator;
}
}
interface IL2Staking is IStaking, IL2StakingBase, IL2StakingTypes {}
2 changes: 1 addition & 1 deletion packages/contracts/contracts/l2/staking/IL2StakingBase.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity ^0.7.6;
pragma solidity ^0.7.6 || 0.8.26;

import { ICallhookReceiver } from "../../gateway/ICallhookReceiver.sol";

Expand Down
Loading
Loading