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

Adjust CI to support deployments of contracts on Goerli testnet #231

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

michalinacienciala
Copy link
Contributor

@michalinacienciala michalinacienciala commented Jan 11, 2023

Previously we've been deploying coverage-pools on Ropsten. As this testnet
became deprecated, we're switching to the Goerli testnet. The hardhat config for
that network has already been partially added in a separate commit/PR. Now we
need to adjust CI jobs and add missing pieces in the Hardhat config to make the
deployment work.

As part of this PR:

  • we're adjusting the names of the environment variables and GH secrets used in the workflow
  • we're incorporating execution of the Solidity workflow in the CI flow (to make it work we need Add coverage-pools module to the CI flow ci#35 merged)
  • we're adjusting Hardhat and Tenderly config to support Goerli
  • we're removing obsolete Ropsten configuration
  • we're adding goerli UniswapV2Router artifact
  • we're doing clean up of the way we verify contracts on Etherscan

TODO:

michalinacienciala and others added 7 commits January 11, 2023 11:02
Previously we've been deploying coverage-pools on Ropsten. As this testnet
became deprecated, we're switching to the Goerli testnet. The hardhat config for
that network has already been added in a separate commit/PR. Now we need to
adjust CI jobs to be in line with that config. In this commit we modify the way
we get the contract owner account's private key - we use an environment variable
that can store multiple accounts and we fill its value with the value of a
`GOERLI_ETH_CONTRACT_OWNER_PRIVATE_KEY` GH secret.
We also update value of the `CHAIN_API_URL` variable, as we've changed the name
of the secret that holds the information about the chain API URL.
The Ropsten testnet became deprecated. We switched to using Goerli testnet for
testing. This commit adds some missing piecies of the Goerli-related
configuration and removes the obsolete Ropsten-related config.
We no longer support `ropsten` testnet. The only testnet we do support is
`goerli` . It is expected that this tesnet is used when workflow gets triggered
manually.
The `Solidity` workflow for `coverage-pools` was part of the no longer used v1
of the CI flow. As in the v2 of the system we changed the structure of the
dependencies between modules and added soem new modules, we need to adjust the
position of the `coverage-pools` module in the v2 of the CI flow. In a sepaarate
repository (`@keep-network/ci`) we're configuring the
`github.com/keep-network/coverage-pools` module to execute after
`github.com/threshold-network/solidity-contracts` module. In this PR we switch
the workflow to use the `v2` of the CI flow and change the way how we resolve
latest contracts. When workflow will be executed with the `goerli` `environment`
input (which is the assumed behavior), we'll use the latest `goerli`-tagged
`keep-core` and `tbtc` packages. We'll determine the version of the
`@threshold-network/solidity-contracts` package based on the value passed in the
`upstream_builds` input.
As part of this PR we've also adjusted the Hardhat config to use the artifacts
of the `@threshold-network/solidity-contracts` module.

Tmp
After deploying the `coverage-pools` contracts we want to verify them in the
Etherscan, so that their source code could be easily browsed there.
Historically, in our other modules, we've been using either the
`@nomiclabs/hardhat-etherscan` or `hardhat-deploy` plugin to run the
verification.
Here in the `coverage-pools` module, the config we used was inconsistent and it
contained elements of both plugins' configs.
In this commit we sort the config out - from now on we'll use only the
`@nomiclabs/hardhat-etherscan` plugin to verify `coverage-pools` contracts on
Etherscan. We already have the plugin defined as the project dependency and we
have the deployments scripts configured to perform the verification. We're
adding passing of the `ETHERSCAN_API_KEY` secret as an environment variable
in the deployment step in the CI and removing an obsolete configuration related
to the `hardhat-deploy` plugin.
We're switching from deployments of contacts on Ropsten to deployment on Goerli
(because the Ropsten testnet became deprecated).
@michalinacienciala
Copy link
Contributor Author

@nkuba, after keep-network/ci#35 gets merged, I'll update the v2 tag there and will create a temporary commit here that will allow for the test of the changes included in this PR. If tests will be green, I'll revert that temp commit and mark this PR as ready for review. But you can start the review even now.

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.

2 participants