Skip to content
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

chore: wip changes to integrate with sdk #872

Merged
merged 21 commits into from
Dec 20, 2023
Merged

chore: wip changes to integrate with sdk #872

merged 21 commits into from
Dec 20, 2023

Conversation

tmigone
Copy link
Contributor

@tmigone tmigone commented Oct 27, 2023

This PR is the integration with https://github.com/graphprotocol/sdk.

It's a gigantic PR to review... so here are the sanity checks I've been using to validate the changes:

  • unit tests pass yarn test
  • e2e tests pass L1_NETWORK=localhost yarn test:e2e
  • hh console --network mainnet and query some values like await g.l2.contracts.GraphToken.totalSupply()

Changes

  • Use @graphprotocol/sdk for unit tests, e2e tests and hardhat tasks.
  • Unit tests now deploy the protocol using a graph config file (graph.hardhat.yml or graph.arbitrum-hardhat.yml) and an address book, and use same code/logic as e2e tests and migrate/deploy commands.
  • cli now "deprecated". No code from cli/ should be used anywhere. Will remove in a followup PR once we finish migrating any useful command.
  • Removed GraphGovernance contract
  • Removed GRE from repo

Signed-off-by: Tomás Migone <tomas@edgeandnode.com>
@tmigone tmigone marked this pull request as draft October 27, 2023 20:55
@socket-security
Copy link

socket-security bot commented Oct 27, 2023

New, updated, and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives Size Publisher
@types/bs58 4.0.4 None +4 7.8 MB types
solidity-coverage 0.7.22 None +218 76.9 MB cgewecke
hardhat-secure-accounts 0.0.6 None +120 97.4 MB tmigone
@graphprotocol/common-ts 1.8.7 None +76 63.8 MB fordn
@types/sinon-chai 3.2.12 None +6 348 kB types
@graphprotocol/common-ts 2.0.9 None +61 18.6 MB fordn
@types/chai-as-promised 7.1.8 None +3 256 kB types
@openzeppelin/hardhat-defender 1.9.0 None +220 171 MB ericglau
eslint-config-prettier 9.1.0 None +26 7.61 MB lydell
eslint-config-prettier 8.10.0 None +52 15.2 MB lydell
hardhat-abi-exporter 2.10.1 None +188 153 MB itsnickbarry
@types/inquirer 8.2.10 None +4 8.47 MB types
hardhat-contract-sizer 2.10.0 None +186 153 MB itsnickbarry
@types/mocha 10.0.6 None +0 95.6 kB types
@types/chai 4.3.11 None +0 76.8 kB types
@types/yargs 16.0.9 None +2 70.3 kB types
eslint-plugin-no-only-tests 3.1.0 None +0 9.54 kB levibuzolic
hardhat 2.14.1 filesystem, environment +207 217 MB fvictorio
@defi-wonderland/smock 2.3.5 None +216 172 MB 0xgorilla
@types/lodash 4.14.202 None +0 862 kB types
@ethersproject/experimental 5.7.0 environment +36 37.5 MB ricmoo
@types/debug 4.1.12 None +2 12.9 kB types
hardhat-tracer 1.3.0 None +184 153 MB zemse
@typescript-eslint/eslint-plugin 6.14.0 None +39 44.5 MB jameshenry
@typescript-eslint/parser 6.14.0 None +34 41.5 MB jameshenry
@types/node 20.10.4 None +2 4.08 MB types
@arbitrum/sdk 3.1.13 environment +36 46.1 MB spsjvc
solhint 3.6.2 environment +28 119 MB diego.bale.arg
hardhat-gas-reporter 1.0.9 None +200 182 MB cgewecke
eslint-plugin-prettier 5.0.1 None +52 16.7 MB jounqin
ethers 5.7.2 environment +22 14.3 MB ricmoo
inquirer 8.2.6 None +15 14.1 MB sboudrias
ethers 5.7.0 environment +14 13.9 MB ricmoo
eslint 8.55.0 None +50 12.1 MB eslintbot
prettier 3.1.1 filesystem, environment +0 8.42 MB prettier-bot
typescript 4.9.5 None +0 66.8 MB typescript-bot
@types/minimist 1.2.2...1.2.5 None +0/-0 6.27 kB types
husky 7.0.4...8.0.3 None +0/-0 6.44 kB typicode
@commitlint/cli 13.2.1...18.4.3 None +56/-41 39.8 MB escapedcat
console-table-printer 2.11.1...2.11.2 None +0/-0 44.3 kB ayonknan
bignumber.js 9.0.2...9.1.2 None +0/-0 351 kB mikemcl
chai 4.3.6...4.3.10 None +12/-4 1.07 MB keithamus
winston 3.7.2...3.11.0 None +20/-6 2.7 MB dabh
prettier 2.6.2...2.8.8 None +0/-0 11.2 MB prettier-bot
typescript 4.7.4...5.3.3 None +0/-0 32 MB typescript-bot
@commitlint/config-conventional 13.2.0...18.4.3 None +1/-2 25.7 kB escapedcat
@openzeppelin/hardhat-upgrades 1.17.0...1.28.0 None +216/-74 170 MB ericglau

🚮 Removed packages: @arbitrum/sdk@3.1.12, @defi-wonderland/smock@2.0.7, @ethersproject/experimental@5.6.0, @graphprotocol/common-ts@1.8.6, @nomiclabs/hardhat-ethers@2.0.5, @openzeppelin/hardhat-defender@1.8.1, @types/bs58@4.0.1, @types/chai-as-promised@7.1.5, @types/node@15.14.9, @types/yargs@16.0.4, @urql/core@2.4.3, eslint-config-prettier@8.5.0, glob@8.0.3, hardhat@2.10.1, hardhat-abi-exporter@2.8.0, hardhat-contract-sizer@2.5.1, hardhat-gas-reporter@1.0.8, hardhat-tracer@1.0.0-alpha.6, inquirer@8.2.2, solhint@3.3.7, solidity-coverage@0.7.20, yargs@17.4.0

@openzeppelin-code
Copy link

openzeppelin-code bot commented Oct 27, 2023

chore: wip changes to integrate with sdk

Generated at commit: cf8ab4487706881149b076b29bb7fa25b20f0f33

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
1
1
0
18
32
52
Dependencies Critical
High
Medium
Low
Note
Total
0
0
0
0
0
0

For more details view the full report in OpenZeppelin Code Inspector

Signed-off-by: Tomás Migone <tomas@edgeandnode.com>
Signed-off-by: Tomás Migone <tomas@edgeandnode.com>
Signed-off-by: Tomás Migone <tomas@edgeandnode.com>
Signed-off-by: Tomás Migone <tomas@edgeandnode.com>
Signed-off-by: Tomás Migone <tomas@edgeandnode.com>
Signed-off-by: Tomás Migone <tomas@edgeandnode.com>
Signed-off-by: Tomás Migone <tomas@edgeandnode.com>
Signed-off-by: Tomás Migone <tomas@edgeandnode.com>
Signed-off-by: Tomás Migone <tomas@edgeandnode.com>
Copy link

codecov bot commented Nov 9, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (a667f7a) 92.71% compared to head (cf8ab44) 92.69%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #872      +/-   ##
==========================================
- Coverage   92.71%   92.69%   -0.02%     
==========================================
  Files          47       46       -1     
  Lines        2389     2369      -20     
  Branches      435      426       -9     
==========================================
- Hits         2215     2196      -19     
+ Misses        174      173       -1     
Flag Coverage Δ
unittests 92.69% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Tomás Migone <tomas@edgeandnode.com>
Signed-off-by: Tomás Migone <tomas@edgeandnode.com>
@tmigone tmigone marked this pull request as ready for review November 13, 2023 08:11
@tmigone tmigone requested review from pcarranzav and Maikol November 13, 2023 14:04
Signed-off-by: Tomás Migone <tomas@edgeandnode.com>
pcarranzav
pcarranzav previously approved these changes Nov 24, 2023
Copy link
Member

@pcarranzav pcarranzav left a comment

Choose a reason for hiding this comment

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

Great work on this massive lift 💪
A few small comments but LGTM.

(I'm a bit scared of the merge conflicts we'll have on the tests for some open PRs, but I guess there'll never be an ideal time, better to merge this now and fix those as they appear)

package.json Outdated Show resolved Hide resolved
test/lib/fixtures.ts Outdated Show resolved Hide resolved
test/governance/governed.test.ts Outdated Show resolved Hide resolved
test/staking/allocation.test.ts Show resolved Hide resolved
test/staking/rebate.test.ts Show resolved Hide resolved
Signed-off-by: Tomás Migone <tomas@edgeandnode.com>
Maikol
Maikol previously approved these changes Nov 28, 2023
Copy link
Member

@Maikol Maikol left a comment

Choose a reason for hiding this comment

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

Nice work 🚀

pcarranzav
pcarranzav previously approved these changes Dec 8, 2023
Copy link
Member

@pcarranzav pcarranzav left a comment

Choose a reason for hiding this comment

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

LGTM (sorry for the merge conflicts, I can re-approve when you fix them)

hardhat.config.ts Outdated Show resolved Hide resolved
tasks/deployment/deploy.ts Outdated Show resolved Hide resolved
Signed-off-by: Tomás Migone <tomas@edgeandnode.com>
@tmigone tmigone requested review from pcarranzav and Maikol December 11, 2023 20:02
Maikol
Maikol previously approved these changes Dec 11, 2023
…ge (#888)

* chore: convert repo into a yarn workspaces monorepo

Signed-off-by: Tomás Migone <tomas@edgeandnode.com>

* chore: add sdk

Signed-off-by: Tomás Migone <tomas@edgeandnode.com>

* chore: fix cross reference dependencies and add readme

Signed-off-by: Tomás Migone <tomas@edgeandnode.com>

* ci: fix setup action

Signed-off-by: Tomás Migone <tomas@edgeandnode.com>

* ci: use yarn v4

Signed-off-by: Tomás Migone <tomas@edgeandnode.com>

* ci: add missing property to setup action

Signed-off-by: Tomás Migone <tomas@edgeandnode.com>

* ci: add more missing properties

Signed-off-by: Tomás Migone <tomas@edgeandnode.com>

* ci: refactor corepack enable

Signed-off-by: Tomás Migone <tomas@edgeandnode.com>

* ci: run for all branches and prs

Signed-off-by: Tomás Migone <tomas@edgeandnode.com>

* ci: fix coverage file path

Signed-off-by: Tomás Migone <tomas@edgeandnode.com>

* ci: add workflow dispatch trigger

Signed-off-by: Tomás Migone <tomas@edgeandnode.com>

* chore: trigger ci

Signed-off-by: Tomás Migone <tomas@edgeandnode.com>

* chore: update README

Signed-off-by: Tomás Migone <tomas@edgeandnode.com>

* test: fix failing tests

Signed-off-by: Tomás Migone <tomas@edgeandnode.com>

* chore: minor nits

Signed-off-by: Tomás Migone <tomas@edgeandnode.com>

* chore: fixup prettier config

Signed-off-by: Tomás Migone <tomas@edgeandnode.com>

* chore: roll back prettier-plugin-solidity to old version to avoid reformatting

Signed-off-by: Tomás Migone <tomas@edgeandnode.com>

* chore: bump packages versions and add publish ci action

Signed-off-by: Tomás Migone <tomas@edgeandnode.com>

* docs: update readme with versioning and publishing instructions

Signed-off-by: Tomás Migone <tomas@edgeandnode.com>

---------

Signed-off-by: Tomás Migone <tomas@edgeandnode.com>
Signed-off-by: Tomás Migone <tomas@edgeandnode.com>
@tmigone tmigone merged commit cf09399 into main Dec 20, 2023
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test: evaluate setting test node to automine by default
3 participants