From 98f9bed54321e7fb05da687db4202ffd7167b226 Mon Sep 17 00:00:00 2001 From: Dimo99 Date: Fri, 13 Sep 2024 18:59:48 -0400 Subject: [PATCH] feat(relay): Introduce additional networks --- .env.example | 6 +++++- .github/workflows/ci.yml | 2 +- beacon-light-client/solidity/hardhat.config.ts | 9 +++++++-- process-compose.yaml | 9 +++++++++ relay/utils/get_current_network_config.ts | 6 ++++++ 5 files changed, 28 insertions(+), 4 deletions(-) diff --git a/.env.example b/.env.example index 73b5a13ad..385ea2ff9 100644 --- a/.env.example +++ b/.env.example @@ -17,6 +17,7 @@ BEACON_REST_API_PRATTER= BEACON_REST_API_MAINNET= BEACON_REST_API_SEPOLIA= BEACON_REST_API_CHIADO= +BEACON_REST_API_GNOSIS= REDIS_HOST=localhost REDIS_PORT=6379 PROVER_SERVER_HOST=http://127.0.0.1 @@ -45,6 +46,9 @@ LC_MALAGA= LC_LUKSO= FOLLOW_NETWORK_LUKSO=sepolia GOERLI_HASHI=0x4169ea397fe83F55e732E11390807b3722374f78 +MAINNET_HASHI= +FOLLOW_NETWORK_MAINNET= +FOLLOW_NETWORK_GNOSIS= OPTIMISTIC_HASHI='' BASE_HASHI='' ARBITRUM_HASHI='' @@ -60,7 +64,7 @@ GNOSIS_HASHI='' FUJI_HASHI='' BSC_HASHI='' LUKSO_HASHI='' -ETHEREUM_MAINNET_RPC= +MAINNET_RPC= ROPSTEN_RPC= SEPOLIA_RPC= GOERLI_RPC= diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a2410b48a..a952de828 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ env: INFURA_API_KEY: '${{ secrets.INFURA_API_KEY }}' USER_PRIVATE_KEY: '${{ secrets.USER_PRIVATE_KEY }}' ETHERSCAN_API_KEY: '${{ secrets.ETHERSCAN_API_KEY }}' - ETHEREUM_MAINNET_RPC: https://rpc.mevblocker.io + MAINNET_RPC: https://rpc.mevblocker.io jobs: Linter: runs-on: self-hosted diff --git a/beacon-light-client/solidity/hardhat.config.ts b/beacon-light-client/solidity/hardhat.config.ts index 9ad11fc9c..7d2e03c61 100644 --- a/beacon-light-client/solidity/hardhat.config.ts +++ b/beacon-light-client/solidity/hardhat.config.ts @@ -44,7 +44,7 @@ const conf = { '0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80', INFURA_API_KEY: getSecretEnvString('INFURA_API_KEY_FILE'), ETHERSCAN_API_KEY: getSecretEnvString('ETHERSCAN_API_KEY_FILE'), - ETHEREUM_MAINNET_RPC: process.env.ETHEREUM_MAINNET_RPC || '', + MAINNET_RPC: process.env.MAINNET_RPC || '', ROPSTEN_RPC: process.env.ROPSTEN_RPC || '', SEPOLIA_RPC: process.env.SEPOLIA_RPC || '', GOERLI_RPC: process.env.GOERLI_RPC || '', @@ -113,10 +113,14 @@ export default { }, hardhat: { forking: { - url: conf.ETHEREUM_MAINNET_RPC, + url: conf.MAINNET_RPC, blockNumber: 19931139, }, }, + mainnet: { + url: conf.MAINNET_RPC, + accounts: [conf.USER_PRIVATE_KEY], + }, ropsten: { url: conf.ROPSTEN_RPC, accounts: [conf.USER_PRIVATE_KEY], @@ -196,6 +200,7 @@ export default { baseGoerli: conf.BASE_ETHERSCAN_API_KEY, sepolia: conf.ETHERSCAN_API_KEY, goerli: conf.ETHERSCAN_API_KEY, + mainnet: conf.ETHERSCAN_API_KEY, avalancheFujiTestnet: conf.AVALANCHE_FUJI_ETHERSCAN_API_KEY, ftmTestnet: conf.FTM_ETHERSCAN_API_KEY, celo: conf.CELO_ETHERSCAN_API_KEY, diff --git a/process-compose.yaml b/process-compose.yaml index 9637d3b42..c3d7f48de 100644 --- a/process-compose.yaml +++ b/process-compose.yaml @@ -153,6 +153,15 @@ processes: proverserver: condition: process_healthy + mainnet: + description: Start generating proofs for the contract on ${LC_MAINNET} and update it with them + log_location: ./logs/mainnet.log + command: yarn hardhat start-publishing --light-client ${LC_MAINNET} --network mainnet --follow-network ${FOLLOW_NETWORK_MAINNET} --slots-jump ${SLOTS_JUMP} --hashi ${MAINNET_HASHI} --prometheus-port 3015 + working_dir: ./beacon-light-client/solidity + depends_on: + proverserver: + condition: process_healthy + general_logs: description: general_logs log_location: ./logs/general_logs.log diff --git a/relay/utils/get_current_network_config.ts b/relay/utils/get_current_network_config.ts index fab00eaea..11656a948 100644 --- a/relay/utils/get_current_network_config.ts +++ b/relay/utils/get_current_network_config.ts @@ -24,6 +24,7 @@ export enum NetworkConfig { Mainnet = 'mainnet', Sepolia = 'sepolia', Chiado = 'chiado', + Gnosis = 'gnosis', } export function isSupportedFollowNetwork(network: string): boolean { @@ -56,6 +57,11 @@ export async function getNetworkConfig( process.env.BEACON_REST_API_CHIADO || 'default_chiado_rest_api_url'; break; } + case 'gnosis': { + config.BEACON_REST_API[0] = + process.env.BEACON_REST_API_GNOSIS || 'default_gnosis_rest_api_url'; + break; + } default: { throw new Error('Network not supported'); break;