Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions host-contracts/.env.polygonAmoy
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Polygon Amoy Configuration Example
# Copy this file to .env and fill in your actual values

# Your wallet mnemonic or use DEPLOYER_PRIVATE_KEY below
MNEMONIC="REPLACE_WITH_MNEMONIC"

# Chain IDs
CHAIN_ID="80002" # Polygon Amoy testnet
CHAIN_ID_GATEWAY="54321" # Update this if your gateway is on a different chain

# Deployer account - USE YOUR ACTUAL PRIVATE KEY (without 0x prefix or with it, both work)
DEPLOYER_PRIVATE_KEY="REPLACE_WITH_PRIVATE_KEY"

# RPC URL - Get from Alchemy, Infura, or use public RPC
# Alchemy: https://polygon-amoy.g.alchemy.com/v2/YOUR-API-KEY
# Infura: https://polygon-amoy.infura.io/v3/YOUR-API-KEY
# Public (not recommended for production): https://rpc-amoy.polygon.technology
# RPC_URL="https://rpc-amoy.polygon.technology"
RPC_URL="https://polygon-amoy.g.alchemy.com/v2/REPLACE_WITH_ALCHEMY_API_KEY"

# Hardhat Network
HARDHAT_NETWORK="polygonAmoy"

# Gateway addresses (update these to match your gateway deployment)
DECRYPTION_ADDRESS="0x35760912360E875DA50D40a74305575c23D55783"
INPUT_VERIFICATION_ADDRESS="0x1ceFA8E3F3271358218B52c33929Cf76078004c1"

# KMS Configuration
NUM_KMS_NODES="1"
PUBLIC_DECRYPTION_THRESHOLD="1"
KMS_SIGNER_ADDRESS_0="0xC628FE1bB4202aC1AF3E6D1D7a2C3411A8973C46"

# Coprocessor Configuration
NUM_COPROCESSORS="1"
COPROCESSOR_THRESHOLD="1"
COPROCESSOR_SIGNER_ADDRESS_0="0x6254A198F67ad40290a2E7B48aDB2d19B71f67BD"

# Pausers
NUM_PAUSERS="2"
PAUSER_ADDRESS_0="0xa44366bAA26296c1409AD1e284264212029F02f1"
PAUSER_ADDRESS_1="0xc1d91b49A1B3D1324E93F86778C44a03f1063f1b"
PAUSER_PRIVATE_KEY="0x7ae52cf0d3011ef7fecbe22d9537aeda1a9e42a0596e8def5d49970eb59e7a40"

# Owner
NEW_OWNER_PRIVATE_KEY="0x7ae52cf0d3011ef7fecbe22d9537aeda1a9e42a0596e8def5d49970eb59e7a40"

# Note: Make sure your deployer account has enough MATIC on Polygon Amoy
# Get test MATIC from: https://faucet.polygon.technology/
2 changes: 2 additions & 0 deletions host-contracts/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ const chainIds = {
staging: 12345,
zwsDev: 1337,
mainnet: 1,
polygonAmoy: 80002,
custom: 9999,
};

Expand Down Expand Up @@ -113,6 +114,7 @@ const config: HardhatUserConfig = {
sepolia: getChainConfig('sepolia'),
localHostChain: getChainConfig('localHostChain'),
mainnet: getChainConfig('mainnet'),
polygonAmoy: getChainConfig('polygonAmoy'),
custom: getChainConfig('custom'),
},
paths: {
Expand Down
6 changes: 3 additions & 3 deletions test-suite/e2e/contracts/E2ECoprocessorConfigLocal.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ library DefaultCoprocessorConfig {
function getConfig() internal pure returns (CoprocessorConfig memory) {
return
CoprocessorConfig({
ACLAddress: 0x05fD9B5EFE0a996095f42Ed7e77c390810CF660c,
CoprocessorAddress: 0xcCAe95fF1d11656358E782570dF0418F59fA40e1,
KMSVerifierAddress: 0xa1880e99d86F081E8D3868A8C4732C8f65dfdB11
ACLAddress: REPLACE_WITH_DEPLOYED_ACL_ADDRESS,
CoprocessorAddress: REPLACE_WITH_DEPLOYED_FHEVMEXECUTOR_ADDRESS,
KMSVerifierAddress: REPLACE_WITH_DEPLOYED_KMSVERIFIER_ADDRESS
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion test-suite/e2e/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const chainIds = {
localNative: 8009,
devnetNative: 9000,
localCoprocessor: 12345,
staging: 12345,
staging: 80002, // polygonAmoy
zwsDev: 1337,
sepolia: 11155111,
mainnet: 1,
Expand Down
16 changes: 8 additions & 8 deletions test-suite/fhevm/docker-compose/coprocessor-docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:
cache_to:
- type=gha,mode=max
env_file:
- ../env/staging/.env.coprocessor.local
- ../env/staging/.env.coprocessor
environment:
- KEY_ID=${FHE_KEY_ID}
command:
Expand All @@ -30,7 +30,7 @@ services:
cache_to:
- type=gha,mode=max
env_file:
- ../env/staging/.env.coprocessor.local
- ../env/staging/.env.coprocessor
command:
- host_listener
- --database-url=${DATABASE_URL}
Expand All @@ -54,7 +54,7 @@ services:
cache_to:
- type=gha,mode=max
env_file:
- ../env/staging/.env.coprocessor.local
- ../env/staging/.env.coprocessor
command:
- host_listener_poller
- --database-url=${DATABASE_URL}
Expand Down Expand Up @@ -82,7 +82,7 @@ services:
timeout: 5s
retries: 3
env_file:
- ../env/staging/.env.coprocessor.local
- ../env/staging/.env.coprocessor
command:
- gw_listener
- --database-url=${DATABASE_URL}
Expand All @@ -108,7 +108,7 @@ services:
cache_to:
- type=gha,mode=max
env_file:
- ../env/staging/.env.coprocessor.local
- ../env/staging/.env.coprocessor
command:
- tfhe_worker
- --run-bg-worker
Expand All @@ -134,7 +134,7 @@ services:
cache_to:
- type=gha,mode=max
env_file:
- ../env/staging/.env.coprocessor.local
- ../env/staging/.env.coprocessor
command:
- zkproof_worker
- --database-url=${DATABASE_URL}
Expand All @@ -158,7 +158,7 @@ services:
cache_to:
- type=gha,mode=max
env_file:
- ../env/staging/.env.coprocessor.local
- ../env/staging/.env.coprocessor
command:
- sns_worker
- --database-url=${DATABASE_URL}
Expand Down Expand Up @@ -195,7 +195,7 @@ services:
cache_to:
- type=gha,mode=max
env_file:
- ../env/staging/.env.coprocessor.local
- ../env/staging/.env.coprocessor
command:
- transaction_sender
- --database-url=${DATABASE_URL}
Expand Down
2 changes: 1 addition & 1 deletion test-suite/fhevm/docker-compose/core-docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
container_name: kms-core
image: ghcr.io/zama-ai/kms/core-service:${CORE_VERSION}
env_file:
- ../env/staging/.env.core.local
- ../env/staging/.env.core
entrypoint:
- /bin/sh
- -c
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
image: postgres:15.7
restart: always
env_file:
- ../env/staging/.env.database.local
- ../env/staging/.env.database
ports:
- '5432:5432'
healthcheck:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:
cache_to:
- type=gha,mode=max
env_file:
- ../env/staging/.env.gateway-mocked-payment.local
- ../env/staging/.env.gateway-mocked-payment
command:
- npx hardhat task:deployMockedZamaOFT

Expand All @@ -26,7 +26,7 @@ services:
cache_to:
- type=gha,mode=max
env_file:
- ../env/staging/.env.gateway-mocked-payment.local
- ../env/staging/.env.gateway-mocked-payment
command:
- npx hardhat task:setTxSenderMockedPayment
depends_on:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ services:
container_name: gateway-node
image: ghcr.io/foundry-rs/foundry:v1.3.5
env_file:
- ../env/staging/.env.gateway-node.local
- ../env/staging/.env.gateway-node
entrypoint:
- anvil
- --block-time
Expand Down
10 changes: 5 additions & 5 deletions test-suite/fhevm/docker-compose/gateway-sc-docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:
cache_to:
- type=gha,mode=max
env_file:
- ../env/staging/.env.gateway-sc.local
- ../env/staging/.env.gateway-sc
command:
- npx hardhat task:deployAllGatewayContracts
volumes:
Expand All @@ -27,7 +27,7 @@ services:
cache_to:
- type=gha,mode=max
env_file:
- ../env/staging/.env.gateway-sc.local
- ../env/staging/.env.gateway-sc
command:
- npx hardhat task:addHostChainsToGatewayConfig
depends_on:
Expand All @@ -49,7 +49,7 @@ services:
cache_to:
- type=gha,mode=max
env_file:
- ../env/staging/.env.gateway-sc.local
- ../env/staging/.env.gateway-sc
command:
- npx hardhat task:addGatewayPausers
depends_on:
Expand All @@ -71,7 +71,7 @@ services:
cache_to:
- type=gha,mode=max
env_file:
- ../env/staging/.env.gateway-sc.local
- ../env/staging/.env.gateway-sc
# Using test parameters (--params-type 1) is currently not possible at it can make the random
# tests fail with a high probability (1/2 chance), so we instead use default parameters (--params-type 0).
# See https://github.com/zama-ai/fhevm-internal/issues/685
Expand All @@ -96,7 +96,7 @@ services:
cache_to:
- type=gha,mode=max
env_file:
- ../env/staging/.env.gateway-sc.local
- ../env/staging/.env.gateway-sc
# Using test parameters (--params-type 1) is currently not possible for keygen (see above), and
# CRS parameters must be of the same type as the keygen parameters.
# See https://github.com/zama-ai/fhevm-internal/issues/685
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
context: ../../..
dockerfile: kms-connector/connector-db/Dockerfile
env_file:
- ../env/staging/.env.kms-connector.local
- ../env/staging/.env.kms-connector

kms-connector-gw-listener:
container_name: kms-connector-gw-listener
Expand All @@ -19,7 +19,7 @@ services:
cache_to:
- type=gha,mode=max
env_file:
- ../env/staging/.env.kms-connector.local
- ../env/staging/.env.kms-connector
depends_on:
kms-connector-db-migration:
condition: service_completed_successfully
Expand All @@ -35,7 +35,7 @@ services:
cache_to:
- type=gha,mode=max
env_file:
- ../env/staging/.env.kms-connector.local
- ../env/staging/.env.kms-connector
depends_on:
kms-connector-db-migration:
condition: service_completed_successfully
Expand All @@ -51,7 +51,7 @@ services:
cache_to:
- type=gha,mode=max
env_file:
- ../env/staging/.env.kms-connector.local
- ../env/staging/.env.kms-connector
depends_on:
kms-connector-db-migration:
condition: service_completed_successfully
Expand Down
4 changes: 2 additions & 2 deletions test-suite/fhevm/docker-compose/minio-docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ services:
container_name: fhevm-minio
image: quay.io/minio/minio
env_file:
- ../env/staging/.env.minio.local
- ../env/staging/.env.minio
ports:
- "9000:9000"
- "9001:9001"
Expand All @@ -19,7 +19,7 @@ services:
container_name: fhevm-minio-setup
image: quay.io/minio/mc
env_file:
- ../env/staging/.env.minio.local
- ../env/staging/.env.minio
entrypoint:
- /bin/sh
- -c
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
platform: linux/amd64
image: ghcr.io/zama-ai/console/relayer:${RELAYER_VERSION}
env_file:
- ../env/staging/.env.relayer.local
- ../env/staging/.env.relayer
command:
- /bin/server
- --config-file=/app/config/local.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ services:

test-suite-e2e-debug:
container_name: fhevm-test-suite-e2e-debug
image: ghcr.io/zama-ai/fhevm/test-suite/e2e:${TEST_SUITE_VERSION}
# image: ghcr.io/zama-ai/fhevm/test-suite/e2e:${TEST_SUITE_VERSION}
image: local-e2e-test
build:
context: ../../.. # root directory of the repository
dockerfile: test-suite/e2e/Dockerfile
Expand All @@ -11,6 +12,6 @@ services:
cache_to:
- type=gha,mode=max
env_file:
- ../env/staging/.env.test-suite.local
- ../env/staging/.env.test-suite
command:
- tail -f /dev/null
14 changes: 7 additions & 7 deletions test-suite/fhevm/env/staging/.env.coprocessor
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ POSTGRES_PASSWORD=postgres
DATABASE_URL="postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/coprocessor"

# =============================================================================
# API & AUTHENTICATION - SENSITIVE
# API & AUTHENTICATION - SENSITIVE
# =============================================================================
# IMPORTANT: For testing only - move to secure storage in production
TENANT_API_KEY=a1503fb6-d79b-4e9e-826d-44cf262f3e05
Expand All @@ -34,12 +34,12 @@ FHE_KEY_ID=421c8116661b2150a46badd3956564ad8d4981718d30fa66a36342bee1b13dbf
# HOST NETWORK CONFIGURATION
# =============================================================================
# host_listener uses RPC_WS_URL (ws/wss), poller uses RPC_HTTP_URL (http/https)
RPC_HTTP_URL=http://host-node:8545
RPC_WS_URL=ws://host-node:8545
CHAIN_ID=12345
ACL_CONTRACT_ADDRESS=0x05fD9B5EFE0a996095f42Ed7e77c390810CF660c
INPUT_VERIFIER_ADDRESS=0x857Ca72A957920Fa0FB138602995839866Bd4005
FHEVM_EXECUTOR_CONTRACT_ADDRESS=0xcCAe95fF1d11656358E782570dF0418F59fA40e1
RPC_HTTP_URL=https://rpc-amoy.polygon.technology
RPC_WS_URL=wss://polygon-amoy.g.alchemy.com/v2/REPLACE_WITH_ALCHEMY_API_KEY
CHAIN_ID=80002
ACL_CONTRACT_ADDRESS=REPLACE_WITH_DEPLOYED_ACL_ADDRESS
INPUT_VERIFIER_ADDRESS=REPLACE_WITH_DEPLOYED_INPUT_VERIFIER_ADDRESS
FHEVM_EXECUTOR_CONTRACT_ADDRESS=REPLACE_WITH_DEPLOYED_FHEVMEXECUTOR_ADDRESS

# =============================================================================
# GATEWAY NETWORK CONFIGURATION - SENSITIVE
Expand Down
6 changes: 3 additions & 3 deletions test-suite/fhevm/env/staging/.env.gateway-sc
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ CUSTODIAN_ENCRYPTION_KEY_0="0xea8b8b710d770493a41b588808ea8e09d986561f73d5232277
NUM_HOST_CHAINS=1

# Host chain 1
HOST_CHAIN_CHAIN_ID_0=12345
HOST_CHAIN_FHEVM_EXECUTOR_ADDRESS_0=0xcCAe95fF1d11656358E782570dF0418F59fA40e1
HOST_CHAIN_ACL_ADDRESS_0=0x05fD9B5EFE0a996095f42Ed7e77c390810CF660c
HOST_CHAIN_CHAIN_ID_0=80002
HOST_CHAIN_FHEVM_EXECUTOR_ADDRESS_0=REPLACE_WITH_DEPLOYED_FHEVMEXECUTOR_ADDRESS
HOST_CHAIN_ACL_ADDRESS_0=REPLACE_WITH_DEPLOYED_ACL_ADDRESS
HOST_CHAIN_NAME_0=
HOST_CHAIN_WEBSITE_0=

Expand Down
Loading
Loading