Skip to content

Commit 0bd0a37

Browse files
Support deployment on Sepolia
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.
1 parent c83fc9a commit 0bd0a37

File tree

5 files changed

+107
-16
lines changed

5 files changed

+107
-16
lines changed

.github/workflows/contracts-ecdsa.yml

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ on:
2727
workflow_dispatch:
2828
inputs:
2929
environment:
30-
description: "Environment (network) for workflow execution, e.g. `goerli`"
30+
description: "Environment (network) for workflow execution, e.g. `sepolia`"
3131
required: false
3232
upstream_builds:
3333
description: "Upstream builds"
@@ -252,9 +252,24 @@ 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 }}
257-
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
255+
# Use fake ternary expressions to decide which credentials to use,
256+
# depending on chosen environment. Note: if `GOERLI...` credentials
257+
# are empty, the expressions will be evaluated to the `SEPOLIA...`
258+
# ones.
259+
CHAIN_API_URL: |
260+
${{ inputs.github.event.inputs.environment == 'goerli' \
261+
&& secrets.GOERLI_ETH_HOSTNAME_HTTP \
262+
|| secrets.SEPOLIA_ETH_HOSTNAME_HTTP }}
263+
# TODO: Shouldn't we use `ACCOUNTS_PRIVATE_KEYS` here instead of the
264+
# two below envs?
265+
CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY: |
266+
${{ inputs.github.event.inputs.environment == 'goerli' \
267+
&& secrets.GOERLI_ETH_CONTRACT_OWNER_PRIVATE_KEY \
268+
|| secrets.SEPOLIA_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
269+
KEEP_CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY: |
270+
${{ inputs.github.event.inputs.environment == 'goerli' \
271+
&& secrets.GOERLI_KEEP_ETH_CONTRACT_OWNER_PRIVATE_KEY \
272+
|| secrets.SEPOLIA_KEEP_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
258273
run: yarn deploy --network ${{ github.event.inputs.environment }}
259274

260275
- name: Bump up package version
@@ -340,9 +355,24 @@ jobs:
340355
341356
- name: Deploy contracts
342357
env:
343-
CHAIN_API_URL: ${{ secrets.GOERLI_ETH_HOSTNAME_HTTP }}
344-
ACCOUNTS_PRIVATE_KEYS: ${{ secrets.DAPP_DEV_GOERLI_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
345-
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
358+
# Use fake ternary expressions to decide which credentials to use,
359+
# depending on chosen environment. Note: if `GOERLI...` credentials
360+
# are empty, the expressions will be evaluated to the `SEPOLIA...`
361+
# ones.
362+
CHAIN_API_URL: |
363+
${{ inputs.github.event.inputs.environment == 'goerli' \
364+
&& secrets.GOERLI_ETH_HOSTNAME_HTTP \
365+
|| secrets.SEPOLIA_ETH_HOSTNAME_HTTP }}
366+
# TODO: Shouldn't we use `ACCOUNTS_PRIVATE_KEYS` here instead of the
367+
# two below envs?
368+
CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY: |
369+
${{ inputs.github.event.inputs.environment == 'goerli' \
370+
&& secrets.DAPP_DEV_GOERLI_ETH_CONTRACT_OWNER_PRIVATE_KEY \
371+
|| secrets.DAPP_DEV_SEPOLIA_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
372+
KEEP_CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY: |
373+
${{ inputs.github.event.inputs.environment == 'goerli' \
374+
&& secrets.GOERLI_KEEP_ETH_CONTRACT_OWNER_PRIVATE_KEY \
375+
|| secrets.SEPOLIA_KEEP_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
346376
run: yarn deploy --network ${{ github.event.inputs.environment }}
347377

348378
- name: Bump up package version

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

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ on:
2727
workflow_dispatch:
2828
inputs:
2929
environment:
30-
description: "Environment (network) for workflow execution, e.g. `goerli`"
30+
description: "Environment (network) for workflow execution, e.g. `sepolia`"
3131
required: false
3232
upstream_builds:
3333
description: "Upstream builds"
@@ -248,9 +248,24 @@ 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 }}
253-
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
251+
# Use fake ternary expressions to decide which credentials to use,
252+
# depending on chosen environment. Note: if `GOERLI...` credentials
253+
# are empty, the expressions will be evaluated to the `SEPOLIA...`
254+
# ones.
255+
CHAIN_API_URL: |
256+
${{ inputs.github.event.inputs.environment == 'goerli' \
257+
&& secrets.GOERLI_ETH_HOSTNAME_HTTP \
258+
|| secrets.SEPOLIA_ETH_HOSTNAME_HTTP }}
259+
# TODO: Shouldn't we use `ACCOUNTS_PRIVATE_KEYS` here instead of the
260+
# two below envs?
261+
CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY: |
262+
${{ inputs.github.event.inputs.environment == 'goerli' \
263+
&& secrets.GOERLI_ETH_CONTRACT_OWNER_PRIVATE_KEY \
264+
|| secrets.SEPOLIA_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
265+
KEEP_CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY: |
266+
${{ inputs.github.event.inputs.environment == 'goerli' \
267+
&& secrets.GOERLI_KEEP_ETH_CONTRACT_OWNER_PRIVATE_KEY \
268+
|| secrets.SEPOLIA_KEEP_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
254269
run: yarn deploy --network ${{ github.event.inputs.environment }}
255270

256271
- name: Bump up package version
@@ -334,9 +349,24 @@ jobs:
334349
335350
- name: Deploy contracts
336351
env:
337-
CHAIN_API_URL: ${{ secrets.GOERLI_ETH_HOSTNAME_HTTP }}
338-
ACCOUNTS_PRIVATE_KEYS: ${{ secrets.DAPP_DEV_GOERLI_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
339-
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
352+
# Use fake ternary expressions to decide which credentials to use,
353+
# depending on chosen environment. Note: if `GOERLI...` credentials
354+
# are empty, the expressions will be evaluated to the `SEPOLIA...`
355+
# ones.
356+
CHAIN_API_URL: |
357+
${{ inputs.github.event.inputs.environment == 'goerli' \
358+
&& secrets.GOERLI_ETH_HOSTNAME_HTTP \
359+
|| secrets.SEPOLIA_ETH_HOSTNAME_HTTP }}
360+
# TODO: Shouldn't we use `ACCOUNTS_PRIVATE_KEYS` here instead of the
361+
# two below envs?
362+
CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY: |
363+
${{ inputs.github.event.inputs.environment == 'goerli' \
364+
&& secrets.DAPP_DEV_GOERLI_ETH_CONTRACT_OWNER_PRIVATE_KEY \
365+
|| secrets.DAPP_DEV_SEPOLIA_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
366+
KEEP_CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY: |
367+
${{ inputs.github.event.inputs.environment == 'goerli' \
368+
&& secrets.GOERLI_KEEP_ETH_CONTRACT_OWNER_PRIVATE_KEY \
369+
|| secrets.SEPOLIA_KEEP_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
340370
run: yarn deploy --network ${{ github.event.inputs.environment }}
341371

342372
- name: Bump up package version

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/hardhat.config.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,14 @@ const config: HardhatUserConfig = {
109109
: undefined,
110110
tags: ["etherscan", "tenderly"],
111111
},
112+
sepolia: {
113+
url: process.env.CHAIN_API_URL || "",
114+
chainId: 11155111,
115+
accounts: process.env.ACCOUNTS_PRIVATE_KEYS
116+
? process.env.ACCOUNTS_PRIVATE_KEYS.split(",")
117+
: undefined,
118+
tags: ["etherscan", "tenderly"],
119+
},
112120
mainnet: {
113121
url: process.env.CHAIN_API_URL || "",
114122
chainId: 1,
@@ -131,16 +139,19 @@ const config: HardhatUserConfig = {
131139
deployer: {
132140
default: 1,
133141
goerli: 0,
142+
sepolia: 0,
134143
mainnet: 0, // "0x123694886DBf5Ac94DDA07135349534536D14cAf"
135144
},
136145
governance: {
137146
default: 2,
138147
goerli: 0,
148+
sepolia: 0,
139149
mainnet: "0x9f6e831c8f8939dc0c830c6e492e7cef4f9c2f5f", // Threshold Council
140150
},
141151
chaosnetOwner: {
142152
default: 3,
143153
goerli: 0,
154+
sepolia: 0,
144155
mainnet: "0x9f6e831c8f8939dc0c830c6e492e7cef4f9c2f5f", // Threshold Council
145156
},
146157
},
@@ -166,6 +177,7 @@ const config: HardhatUserConfig = {
166177
"node_modules/@threshold-network/solidity-contracts/deployments/development",
167178
],
168179
goerli: ["node_modules/@threshold-network/solidity-contracts/artifacts"],
180+
sepolia: ["node_modules/@threshold-network/solidity-contracts/artifacts"],
169181
mainnet: ["./external/mainnet"],
170182
},
171183
},

0 commit comments

Comments
 (0)