Skip to content

Commit 18898aa

Browse files
authored
test(test-suite): fix pauser tasks and test host cleanup (#985)
* chore(library-solidity): update relayer-sdk version
1 parent bff99a6 commit 18898aa

File tree

17 files changed

+112
-28
lines changed

17 files changed

+112
-28
lines changed

gateway-contracts/.env.example

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,14 @@ PAUSER_ADDRESS_0="0x6591319B97979Acc59b7191A8B4Ec381375bFc92" # accounts[23] (ad
135135
# Pauser 2
136136
PAUSER_ADDRESS_1="0xb19e21437c47A541842bB84b018d3955462B35De" # accounts[24] (address)
137137

138-
# GatewayConfig contract address
139-
# This address is required during the production deployment, at which point this environment variable
140-
# is dynamically set after contracts are deployed.
141-
# For tests, this address is read directly from the addresses/.env.gateway file, so the value in this file is ignored.
138+
# Gateway contract address
139+
# These addresses are required during the production deployment, at which point these environment
140+
# variables are dynamically set after contracts are deployed.
141+
# For tests, these addresses are read directly from the addresses/.env.gateway file, so the following
142+
# values are ignored
142143
GATEWAY_CONFIG_ADDRESS="0xa50F5243C70c80a8309e3D39d8c9d958cDa83979" # (address)
143144
KMS_GENERATION_ADDRESS="0x87A5b1152AA51728258dbc1AA54B6a83DCd1d3dd" # (address)
145+
PAUSER_SET_ADDRESS="0xc1D733116990ce3D9e54F9eCf48a1cdD441Af4f9" # (address)
144146

145147
# The first pauser's private key
146148
# This is required for local tests and running the pausing task. It must correspond to one of the pauser's private key

gateway-contracts/docker-compose.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,29 @@ services:
6565
volumes:
6666
- addresses-volume:/app/addresses
6767

68+
add-pausers:
69+
container_name: add-pausers
70+
build:
71+
context: .
72+
dockerfile: Dockerfile
73+
env_file:
74+
- ./.env
75+
environment:
76+
- HARDHAT_NETWORK=staging
77+
- CHAIN_ID_GATEWAY=54321
78+
- RPC_URL=http://anvil-node:8546
79+
command:
80+
- npx hardhat task:addGatewayPausers --use-internal-proxy-address true
81+
depends_on:
82+
anvil-node:
83+
condition: service_started
84+
deploy-gateway-contracts:
85+
condition: service_completed_successfully
86+
# Addresses needs to be mounted even though we don't use them in the task because all contracts
87+
# are compiled, and most of them import these addresses.
88+
volumes:
89+
- addresses-volume:/app/addresses
90+
6891
trigger-keygen:
6992
container_name: trigger-keygen
7093
build:

gateway-contracts/docs/getting-started/deployment/env_variables.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,3 +212,11 @@ GATEWAY_CONFIG_ADDRESS="0xC7D45661a345eC5cA0e8521CFEF7e32FDA0Daa68" # (address)
212212
```
213213

214214
This (static) address is needed for adding host chains to the GatewayConfig contract separately. In a proper production setting, this environment variable needs to be dynamically set after deploying the contracts.
215+
216+
- PauserSet address
217+
218+
```bash
219+
PAUSER_SET_ADDRESS="0xc1D733116990ce3D9e54F9eCf48a1cdD441Af4f9" # (address)
220+
```
221+
222+
This (static) address is needed for managing pausers in the PauserSet contract separately. In a proper production setting, this environment variable needs to be dynamically set after deploying the contracts.

host-contracts/.env.example

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@ PAUSER_ADDRESS_0="0xa44366bAA26296c1409AD1e284264212029F02f1" # accounts[2] (add
2929
# Pauser 2
3030
PAUSER_ADDRESS_1="0xc1d91b49A1B3D1324E93F86778C44a03f1063f1b" # accounts[3] (address)
3131

32+
# Host contract address
33+
# These addresses are required during the production deployment, at which point these environment
34+
# variables are dynamically set after contracts are deployed.
35+
# For tests, these addresses are read directly from the addresses/.env.gateway file, so the following
36+
# values are ignored
37+
PAUSER_SET_CONTRACT_ADDRESS="0x44aA028fd264C76BF4A8f8B4d8A5272f6AE25CAc" # (address)
38+
3239
# The first pauser's private key
3340
# This is required for local tests and running the pausing task. It must correspond to one of the pauser's private key
3441
PAUSER_PRIVATE_KEY="0x7ae52cf0d3011ef7fecbe22d9537aeda1a9e42a0596e8def5d49970eb59e7a40" # accounts[2], private key (bytes32)

host-contracts/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ COPY --chown=fhevm:fhevm host-contracts/tasks ./tasks/
4040
COPY --chown=fhevm:fhevm host-contracts/lib ./lib/
4141
COPY --chown=fhevm:fhevm host-contracts/decryptionOracle ./decryptionOracle/
4242

43+
# Create addresses directory for storing proxy contract addresses
44+
RUN mkdir -p ./addresses && chown fhevm:fhevm ./addresses
4345

4446
# Pre-compile proxy contracts
4547
RUN npx hardhat clean && \

host-contracts/docker-compose.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,28 @@ services:
3535
- CHAIN_ID_GATEWAY=54321
3636
command:
3737
- npx hardhat task:deployAllHostContracts
38+
volumes:
39+
- addresses-volume:/app/host-contracts/addresses
40+
41+
fhevm-sc-add-pausers:
42+
container_name: fhevm-sc-add-pausers
43+
build:
44+
context: ../
45+
dockerfile: host-contracts/Dockerfile
46+
env_file:
47+
- ./.env
48+
environment:
49+
- HARDHAT_NETWORK=${HARDHAT_NETWORK:-staging}
50+
- CHAIN_ID_GATEWAY=54321
51+
command:
52+
- npx hardhat task:addHostPausers --use-internal-pauser-set-address true
53+
depends_on:
54+
fhevm-sc-deploy:
55+
condition: service_completed_successfully
56+
# Addresses needs to be mounted even though we don't use them in the task because the PauserSet
57+
# contract is compiled, and it imports these addresses.
58+
volumes:
59+
- addresses-volume:/app/host-contracts/addresses
60+
61+
volumes:
62+
addresses-volume:

test-suite/e2e/contracts/E2ECoprocessorConfigLocal.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ library DefaultCoprocessorConfig {
88
return
99
CoprocessorConfig({
1010
ACLAddress: 0x05fD9B5EFE0a996095f42Ed7e77c390810CF660c,
11-
CoprocessorAddress: 0x12B064FB845C1cc05e9493856a1D637a73e944bE,
12-
DecryptionOracleAddress: 0xAb30999D17FAAB8c95B2eCD500cFeFc8f658f15d,
13-
KMSVerifierAddress: 0xcCAe95fF1d11656358E782570dF0418F59fA40e1
11+
CoprocessorAddress: 0xcCAe95fF1d11656358E782570dF0418F59fA40e1,
12+
DecryptionOracleAddress: 0xD0fA6194Db6cfCDF733c64F1F272AeA66e968D3C,
13+
KMSVerifierAddress: 0xa1880e99d86F081E8D3868A8C4732C8f65dfdB11
1414
});
1515
}
1616
}

test-suite/fhevm/docker-compose/gateway-sc-docker-compose.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ services:
1414
command:
1515
- npx hardhat task:deployAllGatewayContracts
1616
volumes:
17-
- addresses-volume:/app/addresses
17+
- addresses-volume:/app/addresses # workdir in host's Dockerfile is /app
1818

1919
gateway-sc-add-network:
2020
container_name: gateway-sc-add-network
@@ -36,7 +36,7 @@ services:
3636
# Addresses needs to be mounted even though we don't use them in the task because all contracts
3737
# are compiled, and most of them import these addresses.
3838
volumes:
39-
- addresses-volume:/app/addresses
39+
- addresses-volume:/app/addresses # workdir in host's Dockerfile is /app
4040

4141
gateway-sc-add-pausers:
4242
container_name: gateway-sc-add-pausers
@@ -53,8 +53,12 @@ services:
5353
command:
5454
- npx hardhat task:addGatewayPausers
5555
depends_on:
56-
gateway-sc-deploy:
56+
gateway-sc-add-network:
5757
condition: service_completed_successfully
58+
# Addresses needs to be mounted even though we don't use them in the task because the PauserSet
59+
# contract is compiled, and it imports these addresses.
60+
volumes:
61+
- addresses-volume:/app/addresses # workdir in host's Dockerfile is /app
5862

5963
gateway-sc-trigger-keygen:
6064
container_name: gateway-sc-trigger-keygen
@@ -71,12 +75,12 @@ services:
7175
command:
7276
- npx hardhat task:triggerKeygen --params-type 1
7377
depends_on:
74-
gateway-sc-add-network:
78+
gateway-sc-add-pausers:
7579
condition: service_completed_successfully
7680
# Addresses needs to be mounted even though we don't use them in the task because all contracts
7781
# are compiled, and most of them import these addresses.
7882
volumes:
79-
- addresses-volume:/app/addresses
83+
- addresses-volume:/app/addresses # workdir in host's Dockerfile is /app
8084

8185
gateway-sc-trigger-crsgen:
8286
container_name: gateway-sc-trigger-crsgen
@@ -98,7 +102,7 @@ services:
98102
# Addresses needs to be mounted even though we don't use them in the task because all contracts
99103
# are compiled, and most of them import these addresses.
100104
volumes:
101-
- addresses-volume:/app/addresses
105+
- addresses-volume:/app/addresses # workdir in host's Dockerfile is /app
102106

103107
volumes:
104108
addresses-volume:

test-suite/fhevm/docker-compose/host-sc-docker-compose.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ services:
1313
- ../env/staging/.env.host-sc.local
1414
command:
1515
- npx hardhat task:deployAllHostContracts
16+
volumes:
17+
- addresses-volume:/app/host-contracts/addresses # workdir in host's Dockerfile is /app/host-contracts
1618

1719
host-sc-add-pausers:
18-
container_name: host-add-pausers
20+
container_name: host-sc-add-pausers
1921
image: ghcr.io/zama-ai/fhevm/host-contracts:${HOST_VERSION}
2022
build:
2123
context: ../../../host-contracts
@@ -31,3 +33,10 @@ services:
3133
depends_on:
3234
host-sc-deploy:
3335
condition: service_completed_successfully
36+
# Addresses needs to be mounted even though we don't use them in the task because the PauserSet
37+
# contract is compiled, and it imports these addresses.
38+
volumes:
39+
- addresses-volume:/app/host-contracts/addresses # workdir in host's Dockerfile is /app/host-contracts
40+
41+
volumes:
42+
addresses-volume:

test-suite/fhevm/docker-compose/relayer-docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
services:
22
relayer:
33
container_name: fhevm-relayer
4+
platform: linux/amd64
45
image: ghcr.io/zama-ai/console/relayer:${RELAYER_VERSION}
56
env_file:
67
- ../env/staging/.env.relayer.local

0 commit comments

Comments
 (0)