-
Notifications
You must be signed in to change notification settings - Fork 143
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
Rework graph config files #572
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #572 +/- ##
==========================================
- Coverage 90.58% 90.49% -0.09%
==========================================
Files 37 35 -2
Lines 1795 1747 -48
Branches 293 290 -3
==========================================
- Hits 1626 1581 -45
+ Misses 169 166 -3
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
- add hardhat task to update config files with on chain data - support using one config file per network Signed-off-by: Tomás Migone <tomas@edgeandnode.com>
1f82435
to
123ccd6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very clever to fetch config from on-chain data, it's a nice addition to the existing commands. I've just left a few notes.
"deploy-hardhat": "yarn deploy -- --network hardhat --force", | ||
"deploy-rinkeby": "yarn deploy -- --force --network rinkeby", | ||
"deploy-ganache-manual": "yarn deploy -- --force --network ganache", | ||
"deploy-hardhat": "yarn deploy -- --force --network hardhat", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if --graph-config is not passed? is it storing it in any place by default or just not storing it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will fallback to the CLI's default defined here: https://github.com/graphprotocol/contracts/blob/tmigone/update-config-task/cli/defaults.ts#L8. It currently points to mainnet config file
// initParams: [], | ||
// } | ||
|
||
const curation: Contract = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could import the ABIs JSON from the build/abi
folder to avoid copying them over.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abarmat I thought about using ABIs but how would you filter out all the stuff that's not related to init params? You'd still need to hardcode a list right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tmigone I get it, you are using the list to know what to scan, all good!
Signed-off-by: Tomás Migone <tomas@edgeandnode.com>
@tmigone is this ready to merge? |
@abarmat the second commit is pending review. Not sure why Pushing a new commit didn’t invalidate the original approval |
Oh, I see |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥇
Motivation
The contracts repo has a configuration file (
graph.config.yml
) that defines deployment configuration parameters for the protocol. This file only contains mainnet configuration and it's not up to date.We want to ensure this file matches what we have in mainnet and also we want to support multiple config files for different networks.
Changes
This PR introduces a few changes that make config files management a bit easier:
graph.<networkName>.yml
update-config
) that reads the on chain values of the parameters and updates the config file. The task will run for the specified network (using hardhat's--network
) and update the config file you specify via--graph-config
option.For example:
The task will update all
init
parameters that are not being read from the address book with the only exception beingGraphToken > initialSupply
.Pending
general
addressesgeneral
section (arbitrator
,governor
andauthority
).