Closed michalinacienciala closed 9 months ago
Documenting some decisions and steps of the process:
Deployer account
We decided to deploy the non-dapp-dev contracts on Sepolia using the 0x68ad60CC5e8f3B7cC53beaB321cf0e6036962dBc
account. This is an account that was also used for Goerli deployment. We'll use it to deploy both Keep (v1, v2) and Threshold contracts.
Deploying legacy v1 Keep contracts
As some of the legacy projects are deprecated, we didn't commit the changes needed for Sepolia deployment to the repos. Only did this for keep-core
project.
Here is the list of updates that was done in the deprecated projects to publish the NPM packages:
keep-core
: changes in code as in https://github.com/keep-network/keep-core/pull/3712, then:
nvm use 16
npm ci
CHAIN_API_URL=... CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY=... npx truffle migrate --reset --network sepolia
mkdir -p artifacts
cp -r build/contracts/* artifacts/
then updated the package version in the package.json
to 1.8.1-sepolia.0
and then:
npm publish --access=public --dry-run --tag sepolia
npm publish --access=public --tag sepolia # required running `npm addr` first
keep-ecdsa
: updated truffle
-related dependencies using Node.js v16, added sepolia
config in solidity/truffle.js
and then in the solidity
folder:
nvm use 16
npm ci
npm install --save-exact @keep-network/keep-core@1.8.1-sepolia.0
CHAIN_API_URL=... CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY=... npx truffle migrate --reset --network sepolia
mkdir -p artifacts
cp -r build/contracts/* artifacts/
then updated the package version in the package.json
to 1.9.0-sepolia.0
and then:
npm publish --access=public --dry-run --tag sepolia
npm publish --access=public --tag sepolia
tbtc
: updated truffle
-related dependencies using Node.js v16, added sepolia
config in solidity/truffle-config.js
, modified 2_deploy_contracts.js
to deploy TestnetRelay for Sepolia and then in the solidity
folder:
nvm use 16
npm ci
npm install --save-exact @keep-network/keep-ecdsa@1.9.0-sepolia.0
npx truffle migrate --reset --network sepolia
then updated the package version in the package.json
to 1.1.2-sepolia.0
and then:
npm publish --access=public --dry-run --tag sepolia
npm publish --access=public --tag sepolia
As the main objective of this Issue was fulfilled (we moved the crucial components to Sepolia) and task was becoming hard to manage due to many subtasks, we decided to close this one and create a new one, just for the outstanding/blocked tasks: https://github.com/threshold-network/solidity-contracts/issues/163.
Why?
The Görli testnet currently used by Threshold/Keep for development purposes is planned to become deprecated with the end of year 2023. The testnet that is planned to replace it is called Holešky, however it's not yet available - it's planned it will become widely accessible on Oct 1, 2023 (source). Switching our infrastructure to support new testnet is quite time consuming, so moving directly from Görli to Holešky may be quite risky, especially if there would be some delays in the date of Holešky genesis (not meeting the planned timelines is not a rare occurrence in the Ethereum space). As a solution, we decided to switch first to another testnet that is currently live - Sepolia. This testnet's EOL is planned for 2026, which gives us plenty of time to move to Holešky before Sepolia gets deprecated.
Testnets Lifecycle: Read more in Predictable Ethereum Testnet Lifecycle Proposal.
How?
Deploying contracts to a new testnet and adjusting CI accordingly is a work consisting of many tasks and requiring coordination of several team members. We shouldn't get rid of Görli support until we're sure that everything works on Sepolia smoothly (maybe even until Görli gets deprecated). We may consider adding Holešky support together with Sepolia in some places, for the future use (for example in Hardhat config).
What & who?
keep-common
(https://github.com/keep-network/keep-common/pull/118)@keep-network/keep-core
- https://github.com/keep-network/keep-core/pull/3712@keep-network/keep-ecdsa
- modified locally (repository deprecated)@keep-network/tbtc
- modified locally (repository deprecated)@threshold-network/solidity-contracts
- https://github.com/threshold-network/solidity-contracts/pull/151, https://github.com/threshold-network/solidity-contracts/pull/152, https://github.com/threshold-network/solidity-contracts/pull/154@keep-network/coverage-pools
- https://github.com/keep-network/coverage-pools/pull/235@keep-network/random-beacon
- https://github.com/keep-network/keep-core/pull/3706@keep-network/ecdsa
- https://github.com/keep-network/keep-core/pull/3706@keep-network/tbtc-v2
- https://github.com/keep-network/tbtc-v2/pull/691@keep-network/tbtc-v2.ts
- https://github.com/keep-network/tbtc-v2/pull/691@keep-network/tbtc-v2-arbitrum
(nice to have) - https://github.com/keep-network/tbtc-v2/pull/753@keep-network/tbtc-v2-optimism
(nice to have) - https://github.com/keep-network/tbtc-v2/pull/752@keep-network/tbtc-v2-polygon
(nice to have) - https://github.com/keep-network/tbtc-v2/pull/751@keep-network/tbtc-v2-solana
? (once Solana support lands onmain
) (nice to have)@keep-network/tbtc-v2-base
- https://github.com/keep-network/tbtc-v2/pull/742SepoliaLightRelay.sol
- https://github.com/keep-network/tbtc-v2/pull/6910x68ad60CC5e8f3B7cC53beaB321cf0e6036962dBc
)@keep-network/keep-core@1.8.1-sepolia.0
@keep-network/keep-ecdsa@1.9.0-sepolia.0
@keep-network/tbtc@1.1.2-sepolia.0
@threshold-network/solidity-contracts@1.3.0-sepolia.0
@keep-network/coverage-pools@2.1.0-sepolia.0
@keep-network/coverage-pools@1...
(There were problems with publishing package for v1, we will skip it's deployment and manage without it, at least for now)@keep-network/random-beacon@2.1.0-sepolia.1
@keep-network/ecdsa@2.1.0-sepolia.1
@keep-network/tbtc-v2@1.6.0-sepolia.0
keep-network/tbtc-v2.ts@1.3.0-sepolia.0
(published based on code from19e2dfff
commit, package marked as deprecated)@keep-network/tbtc-v2-arbitrum
(also update.gitignore
andpackage.json
) (nice to have)@keep-network/tbtc-v2-optimism
(also update.gitignore
andpackage.json
) (nice to have)@keep-network/tbtc-v2-polygon
(also update.gitignore
andpackage.json
) (nice to have)@keep-network/tbtc-v2-solana
? (also update.gitignore
andpackage.json
) (once Solana support lands onmain
) (nice to have)@keep-network/tbtc-v2-base
merkle-drop
config - https://github.com/threshold-network/merkle-distribution/pull/93/SimplePreApplication
on Sepoliakeep-network/ci/config/env/sepolia.env
) - https://github.com/keep-network/ci/pull/48keep-network
andthreshold-network
):SEPOLIA_ETH_HOSTNAME_HTTP
SEPOLIA_ETH_HOSTNAME_WS
TESTNET_ETH_CONTRACT_OWNER_PRIVATE_KEY
DAPP_DEV_TESTNET_ETH_CONTRACT_OWNER_PRIVATE_KEY
.yml
files in following projects to use above secrets when deploying on Sepolia:threshold-network/solidity-contracts
keep-network/coverage-pools
(?)keep-network/random-beacon
keep-network/ecdsa
keep-network/tbtc-v2
keep-network/tbtc-v2/monitoring
- https://github.com/keep-network/tbtc-v2/pull/754threshold-network/token-dashboard
- https://github.com/threshold-network/token-dashboard/pull/605keep-network/tbtc-v2-arbitrum
(also update.gitignore
andpackage.json
)keep-network/tbtc-v2-optimism
(also update.gitignore
andpackage.json
)keep-network/tbtc-v2-polygon
(also update.gitignore
andpackage.json
)keep-network/tbtc-v2-solana
? (also update.gitignore
andpackage.json
) (once Solana support lands onmain
)keep-network/tbtc-v2-base
(also update.gitignore
andpackage.json
)dapp-development
branch in following projects to support Sepolia:threshold-network/solidity-contracts
- https://github.com/threshold-network/solidity-contracts/pull/118keep-network/keep-core
- https://github.com/keep-network/keep-core/pull/3118keep-network/tbtc-v2
- https://github.com/keep-network/tbtc-v2/pull/403dapp-development-sepolia
-tagged packages for:@threshold-network/solidity-contracts@1.3.0-dapp-dev-sepolia.0
@keep-network/random-beacon@2.1.0-dapp-dev-sepolia.0
@keep-network/ecdsa@2.1.0-dapp-dev-sepolia.0
@keep-network/tbtc-v2@1.6.0-dapp-dev-sepolia.0
goerli
- https://app.gitbook.com/o/R2meumXNNad4y1B10iL7/s/WosjlL4zUGUMlcMfuSAp/~/changes/268/resources/contract-addresses/sepolia-testnet, https://app.gitbook.com/o/R2meumXNNad4y1B10iL7/s/WosjlL4zUGUMlcMfuSAp/~/changes/326/app-development/tbtc-v2/tbtc-sdk/guides/initialize-sdkGoerliLightRelay
inkeep-core
to mention also SepoliaLightRelay - https://github.com/keep-network/keep-core/pull/3730optimistic-minting
configuration (https://github.com/keep-network/optimistic-minting/pull/101)goerli
-related NPM packages (we can also do a cleanup of other obsolete packages)optimistic-minting
's integration tests for Sepolia contracts