-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add support for deployment on Goerli testnet #114
Conversation
cdae414
to
fc3834d
Compare
Görli became a recommended test network after Ropsten's deprecation notice (https://blog.ethereum.org/2022/06/21/testnet-deprecation/). We're modifying GitHub Actions workflow for deploying contracts to support the deployment on Görli. We're also leaving the possibility of deployment on Ropsten (this will be removed once we have the Görli deployment battle-tested and Ropsten gets shut down). We also change the way we handle `keep-core` dependency - in V2 of our system we'll no longer planning to publish ne `keep-core` packages - hence we hardcode used version of the package for given testnet. NOTE: We're temporarily using some testing configuration in the workflow, which needs to be removed before merge to `main`.
fc3834d
to
439981e
Compare
As the Ropsten testnet becomes deprecated in the near future, we are switching to deployment on Goerli. If deployment on Ropsten will be needed in the interm period, we will do it manually, not via GH Actions.
3a9f8c3
to
65184cf
Compare
Workflow verified: https://github.com/threshold-network/solidity-contracts/runs/7322557630?check_suite_focus=true. Everything except triggering next CI build works as expected. There's a problem with |
Change is only temporary, it should be reverted before merge to `main`.
f9d055b
to
da8a58f
Compare
We are removing the temporary configuration used for workflow testing. We are also bumping the version of used custom GH actions from `v1` to `v2`, as `v2` uses the new order of modules executions.
New value of |
.github/workflows/contracts.yaml
Outdated
run: | | ||
yarn upgrade \ | ||
@keep-network/keep-core@${{ steps.upstream-builds-query.outputs.keep-core-contracts-version }} | ||
run: yarn upgrade @keep-network/[email protected] |
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.
Could we get a package that is tagged with the environment name?
run: yarn upgrade @keep-network/keep-core@1.8.1-goerli.0 | |
run: yarn upgrade @keep-network/keep-core@${{ github.event.inputs.environment }} |
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.
Yes, we can. Resolving keep-core
dependency using goerli
tag did not work for me in another project, but here apparently it works fine. Changed in c9f33ca.
We tag the latest `@keep-network/keep-core` package containing contracts migrated on some environment with tag that is a name of that environment. We can use that tag instead of the explicit version when resolving contracts of dependant projects.
.github/workflows/contracts.yaml
Outdated
@@ -99,7 +99,7 @@ jobs: | |||
|
|||
contracts-deployment-testnet: | |||
needs: [contracts-build-and-test] | |||
if: github.event_name == 'workflow_dispatch' | |||
if: github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'goerli' |
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.
Do we need to add && github.event.inputs.environment == 'goerli'
?
It's a manual workflow dispatch step, so maybe we could skip 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.
We could. Generally, right now we only support goerli
and we expect that the workflow is dispatched with this environment
. I introduced github.event.inputs.environment == 'goerli'
condition to not run the deploy job if workflow gets accidentally run on different environment. But even without this condition we don't risk publishing of a package with some invalid contracts - deploy will fail either due to unsupported environment
or due to incorrect account being used.
Actually, returning error instead of cleanly exiting the workflow may be a better idea in case wrong environment
is provided - I will remove this environment
check...
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.
Right now we only support `goerli` network and we expect that the workflow (when triggered manually) is always dispatched with this `environment`. Previously we introduced `github.event.inputs.environment == 'goerli'` condition to not run the deploy job if workflow gets accidentally run on a different environment. But even without this condition we don't risk publishing of a package with some invalid contracts - deploy will fail either due to unsupported `environment` or due to incorrect account being used. Actually, returning error instead of cleanly exiting the workflow may be a better idea in case wrong `environment` is provided - this will alarm the scheduler that something went wrong with the deployment.
Görli became a recommended test network after Ropsten's deprecation
notice (https://blog.ethereum.org/2022/06/21/testnet-deprecation/).
We're modifying GitHub Actions workflow for deploying contracts to
support the deployment on Görli. We're also leaving the possibility of
deployment on Ropsten (this will be removed once we have the Görli
deployment battle-tested and Ropsten gets shut down).
We also change the way we handle
keep-core
dependency - in V2 of oursystem we'll no longer planning to publish new
keep-core
packages -hence we hardcode used version of the package for given testnet.
TODO:
GOERLI_ETH_HOSTNAME_HTTP
,GOERLI_ETH_CONTRACT_OWNER_PRIVATE_KEY
,GOERLI_KEEP_ETH_CONTRACT_OWNER_PRIVATE_KEY
,TENDERLY_TOKEN
GitHub secrets (@nkuba - could you do that? It would be also good to make similar ROPSTEN/GOERLI distinction in the secrets in thekeep-network
org)CI_GITHUB_TOKEN
GitHub secret (@nkuba)keep-core/ci
is readyRefs:
keep-network/keep-core#3012
keep-network/keep-core#3081
keep-network/tbtc-v2#382