Skip to content

Commit

Permalink
feat(relay): Introduce additional networks
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimo99 committed Sep 13, 2024
1 parent 818c897 commit 8a4dab5
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 4 deletions.
6 changes: 5 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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=''
Expand All @@ -60,7 +64,7 @@ GNOSIS_HASHI=''
FUJI_HASHI=''
BSC_HASHI=''
LUKSO_HASHI=''
ETHEREUM_MAINNET_RPC=
MAINNET_RPC=
ROPSTEN_RPC=
SEPOLIA_RPC=
GOERLI_RPC=
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 7 additions & 2 deletions beacon-light-client/solidity/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 || '',
Expand Down Expand Up @@ -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],
Expand Down Expand Up @@ -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,
Expand Down
9 changes: 9 additions & 0 deletions process-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions relay/utils/get_current_network_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export enum NetworkConfig {
Mainnet = 'mainnet',
Sepolia = 'sepolia',
Chiado = 'chiado',
Gnosis = 'gnosis',
}

export function isSupportedFollowNetwork(network: string): boolean {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 8a4dab5

Please sign in to comment.