Skip to content

Commit 94ed595

Browse files
Support deployment on Sepolia (#3706)
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](https://github.com/eth-clients/holesky), however it's not yet available - it's planned it will become widely accessible on Oct 1, 2023 ([source](https://everstake.one/blog/new-ethereum-testnet-holesky-all-you-need-to-know-now)). 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. Refs: threshold-network/solidity-contracts#150 keep-network/ci#48 threshold-network/solidity-contracts#151 threshold-network/tbtc-v2#691 threshold-network/token-dashboard#605 - [ ] Update `TESTNET_ETH_CONTRACT_OWNER_PRIVATE_KEY` so that it is prefixed with `0x`
2 parents 968ac3e + ece4f94 commit 94ed595

11 files changed

+103
-14
lines changed

.github/workflows/contracts-ecdsa.yml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ on:
2727
workflow_dispatch:
2828
inputs:
2929
environment:
30-
description: "Environment (network) for workflow execution, e.g. `goerli`"
31-
required: false
30+
description: "Environment (network) for workflow execution, e.g. `sepolia`"
31+
required: true
3232
upstream_builds:
3333
description: "Upstream builds"
3434
required: false
@@ -252,8 +252,15 @@ jobs:
252252

253253
- name: Deploy contracts
254254
env:
255-
CHAIN_API_URL: ${{ secrets.GOERLI_ETH_HOSTNAME_HTTP }}
256-
ACCOUNTS_PRIVATE_KEYS: ${{ secrets.GOERLI_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
255+
# Using fake ternary expression to decide which credentials to use,
256+
# depending on chosen environment. Note: if `GOERLI_ETH_HOSTNAME_HTTP`
257+
# is empty, the expression will be evaluated to
258+
# `SEPOLIA_ETH_HOSTNAME_HTTP`'s value.
259+
CHAIN_API_URL: |
260+
${{ inputs.github.event.inputs.environment == 'goerli'
261+
&& secrets.GOERLI_ETH_HOSTNAME_HTTP
262+
|| secrets.SEPOLIA_ETH_HOSTNAME_HTTP }}
263+
ACCOUNTS_PRIVATE_KEYS: ${{ secrets.TESTNET_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
257264
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
258265
run: yarn deploy --network ${{ github.event.inputs.environment }}
259266

@@ -340,8 +347,15 @@ jobs:
340347
341348
- name: Deploy contracts
342349
env:
343-
CHAIN_API_URL: ${{ secrets.GOERLI_ETH_HOSTNAME_HTTP }}
344-
ACCOUNTS_PRIVATE_KEYS: ${{ secrets.DAPP_DEV_GOERLI_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
350+
# Using fake ternary expression to decide which credentials to use,
351+
# depending on chosen environment. Note: if `GOERLI_ETH_HOSTNAME_HTTP`
352+
# is empty, the expression will be evaluated to
353+
# `SEPOLIA_ETH_HOSTNAME_HTTP`'s value.
354+
CHAIN_API_URL: |
355+
${{ inputs.github.event.inputs.environment == 'goerli'
356+
&& secrets.GOERLI_ETH_HOSTNAME_HTTP
357+
|| secrets.SEPOLIA_ETH_HOSTNAME_HTTP }}
358+
ACCOUNTS_PRIVATE_KEYS: ${{ secrets.DAPP_DEV_TESTNET_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
345359
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
346360
run: yarn deploy --network ${{ github.event.inputs.environment }}
347361

.github/workflows/contracts-random-beacon.yml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ on:
2727
workflow_dispatch:
2828
inputs:
2929
environment:
30-
description: "Environment (network) for workflow execution, e.g. `goerli`"
31-
required: false
30+
description: "Environment (network) for workflow execution, e.g. `sepolia`"
31+
required: true
3232
upstream_builds:
3333
description: "Upstream builds"
3434
required: false
@@ -248,8 +248,15 @@ jobs:
248248

249249
- name: Deploy contracts
250250
env:
251-
CHAIN_API_URL: ${{ secrets.GOERLI_ETH_HOSTNAME_HTTP }}
252-
ACCOUNTS_PRIVATE_KEYS: ${{ secrets.GOERLI_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
251+
# Using fake ternary expression to decide which credentials to use,
252+
# depending on chosen environment. Note: if `GOERLI_ETH_HOSTNAME_HTTP`
253+
# is empty, the expression will be evaluated to
254+
# `SEPOLIA_ETH_HOSTNAME_HTTP`'s value.
255+
CHAIN_API_URL: |
256+
${{ inputs.github.event.inputs.environment == 'goerli'
257+
&& secrets.GOERLI_ETH_HOSTNAME_HTTP
258+
|| secrets.SEPOLIA_ETH_HOSTNAME_HTTP }}
259+
ACCOUNTS_PRIVATE_KEYS: ${{ secrets.TESTNET_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
253260
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
254261
run: yarn deploy --network ${{ github.event.inputs.environment }}
255262

@@ -334,8 +341,15 @@ jobs:
334341
335342
- name: Deploy contracts
336343
env:
337-
CHAIN_API_URL: ${{ secrets.GOERLI_ETH_HOSTNAME_HTTP }}
338-
ACCOUNTS_PRIVATE_KEYS: ${{ secrets.DAPP_DEV_GOERLI_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
344+
# Using fake ternary expression to decide which credentials to use,
345+
# depending on chosen environment. Note: if `GOERLI_ETH_HOSTNAME_HTTP`
346+
# is empty, the expression will be evaluated to
347+
# `SEPOLIA_ETH_HOSTNAME_HTTP`'s value.
348+
CHAIN_API_URL: |
349+
${{ inputs.github.event.inputs.environment == 'goerli'
350+
&& secrets.GOERLI_ETH_HOSTNAME_HTTP
351+
|| secrets.SEPOLIA_ETH_HOSTNAME_HTTP }}
352+
ACCOUNTS_PRIVATE_KEYS: ${{ secrets.DAPP_DEV_TESTNET_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
339353
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
340354
run: yarn deploy --network ${{ github.event.inputs.environment }}
341355

solidity/ecdsa/deploy/09_deploy_wallet_registry_governance.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
77

88
const WalletRegistry = await deployments.get("WalletRegistry")
99

10-
// 60 seconds for Goerli. 1 week otherwise.
11-
const GOVERNANCE_DELAY = hre.network.name === "goerli" ? 60 : 604800
10+
// 60 seconds for Goerli/Sepolia. 1 week otherwise.
11+
const GOVERNANCE_DELAY =
12+
hre.network.name === "goerli" || hre.network.name === "sepolia"
13+
? 60
14+
: 604800
1215

1316
const WalletRegistryGovernance = await deployments.deploy(
1417
"WalletRegistryGovernance",

solidity/ecdsa/hardhat.config.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,14 @@ const config: HardhatUserConfig = {
121121
: undefined,
122122
tags: ["etherscan", "tenderly", "useRandomBeaconChaosnet"],
123123
},
124+
sepolia: {
125+
url: process.env.CHAIN_API_URL || "",
126+
chainId: 11155111,
127+
accounts: process.env.ACCOUNTS_PRIVATE_KEYS
128+
? process.env.ACCOUNTS_PRIVATE_KEYS.split(",")
129+
: undefined,
130+
tags: ["etherscan", "tenderly", "useRandomBeaconChaosnet"],
131+
},
124132
mainnet: {
125133
url: process.env.CHAIN_API_URL || "",
126134
chainId: 1,
@@ -143,21 +151,25 @@ const config: HardhatUserConfig = {
143151
deployer: {
144152
default: 1, // take the second account
145153
goerli: 0,
154+
sepolia: 0,
146155
mainnet: 0, // "0x123694886DBf5Ac94DDA07135349534536D14cAf"
147156
},
148157
governance: {
149158
default: 2,
150159
goerli: 0,
160+
sepolia: 0,
151161
mainnet: "0x9f6e831c8f8939dc0c830c6e492e7cef4f9c2f5f", // Threshold Council
152162
},
153163
chaosnetOwner: {
154164
default: 3,
155165
goerli: 0,
166+
sepolia: 0,
156167
mainnet: "0x9f6e831c8f8939dc0c830c6e492e7cef4f9c2f5f", // Threshold Council
157168
},
158169
esdm: {
159170
default: 4,
160171
goerli: 0,
172+
sepolia: 0,
161173
mainnet: "0x9f6e831c8f8939dc0c830c6e492e7cef4f9c2f5f", // Threshold Council
162174
},
163175
},
@@ -192,6 +204,10 @@ const config: HardhatUserConfig = {
192204
"node_modules/@threshold-network/solidity-contracts/artifacts",
193205
"node_modules/@keep-network/random-beacon/artifacts",
194206
],
207+
sepolia: [
208+
"node_modules/@threshold-network/solidity-contracts/artifacts",
209+
"node_modules/@keep-network/random-beacon/artifacts",
210+
],
195211
mainnet: ["./external/mainnet"],
196212
},
197213
},

solidity/random-beacon/deploy/01_deploy_reimbursement_pool.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
1616
})
1717

1818
if (hre.network.tags.etherscan) {
19+
await hre.ethers.provider.waitForTransaction(
20+
ReimbursementPool.transactionHash,
21+
2,
22+
300000
23+
)
1924
await helpers.etherscan.verify(ReimbursementPool)
2025
}
2126

solidity/random-beacon/deploy/02_deploy_beacon_sortition_pool.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
2727
)
2828

2929
if (hre.network.tags.etherscan) {
30+
await hre.ethers.provider.waitForTransaction(
31+
BeaconSortitionPool.transactionHash,
32+
2,
33+
300000
34+
)
3035
await helpers.etherscan.verify(BeaconSortitionPool)
3136
}
3237

solidity/random-beacon/deploy/03_deploy_beacon_dkg_validator.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
1515
})
1616

1717
if (hre.network.tags.etherscan) {
18+
await hre.ethers.provider.waitForTransaction(
19+
BeaconDkgValidator.transactionHash,
20+
2,
21+
300000
22+
)
1823
await helpers.etherscan.verify(BeaconDkgValidator)
1924
}
2025

solidity/random-beacon/deploy/04_deploy_random_beacon.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
5959
)
6060

6161
if (hre.network.tags.etherscan) {
62+
await hre.ethers.provider.waitForTransaction(
63+
RandomBeacon.transactionHash,
64+
2,
65+
300000
66+
)
6267
await helpers.etherscan.verify(BLS)
6368
await helpers.etherscan.verify(BeaconAuthorization)
6469
await helpers.etherscan.verify(BeaconDkg)

solidity/random-beacon/deploy/07_deploy_random_beacon_governance.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
2020
)
2121

2222
if (hre.network.tags.etherscan) {
23+
await hre.ethers.provider.waitForTransaction(
24+
RandomBeaconGovernance.transactionHash,
25+
2,
26+
300000
27+
)
2328
await helpers.etherscan.verify(RandomBeaconGovernance)
2429
}
2530

solidity/random-beacon/deploy/09_deploy_random_beacon_chaosnet.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
1919
)
2020

2121
if (hre.network.tags.etherscan) {
22+
await hre.ethers.provider.waitForTransaction(
23+
RandomBeaconChaosnet.transactionHash,
24+
2,
25+
300000
26+
)
2227
await helpers.etherscan.verify(RandomBeaconChaosnet)
2328
}
2429

0 commit comments

Comments
 (0)