From a497f1f13921315630d2d3f189ec0715296020d5 Mon Sep 17 00:00:00 2001 From: Eddort Date: Wed, 22 Jan 2025 14:43:19 +0100 Subject: [PATCH] feat: initial devnet --- docker-compose.devnet.yml | 40 +++++++++++++++++++ src/bls/bls.constants.ts | 8 ++++ .../deposits-registry.constants.ts | 9 +++-- .../signing-keys-registry.constants.ts | 9 +++-- src/messages/messages.constants.ts | 9 +++-- 5 files changed, 66 insertions(+), 9 deletions(-) create mode 100644 docker-compose.devnet.yml diff --git a/docker-compose.devnet.yml b/docker-compose.devnet.yml new file mode 100644 index 00000000..b5a6b731 --- /dev/null +++ b/docker-compose.devnet.yml @@ -0,0 +1,40 @@ +version: '3.7' + +networks: + devnet: + name: ${DOCKER_NETWORK_NAME} + external: true + +services: + rabbit: + build: + context: . + dockerfile: Dockerfile.test.yml + container_name: 'rabbitmq' + ports: + - "15674:15674" + - "15672:15672" + + council_daemon: + build: ./ + networks: + - devnet + ports: + - "127.0.0.1:${PORT}:3000" + environment: + - PORT=3000 + - LOG_LEVEL=${LOG_LEVEL} + - LOG_FORMAT=${LOG_FORMAT} + - RPC_URL=${RPC_URL} + - WALLET_PRIVATE_KEY=${WALLET_PRIVATE_KEY} + - KEYS_API_HOST=${KEYS_API_HOST} + - KEYS_API_PORT=${KEYS_API_PORT} + - PUBSUB_SERVICE=rabbitmq + - RABBITMQ_URL=${RABBITMQ_URL} + - RABBITMQ_LOGIN=${RABBITMQ_LOGIN} + - RABBITMQ_PASSCODE=${RABBITMQ_PASSCODE} + - LOCATOR_DEVNET_ADDRESS=${LOCATOR_DEVNET_ADDRESS} + volumes: + - ./.volumes/cache/:/council/cache/ +# volumes: +# council_cache: diff --git a/src/bls/bls.constants.ts b/src/bls/bls.constants.ts index 2eafdf64..93d86b41 100644 --- a/src/bls/bls.constants.ts +++ b/src/bls/bls.constants.ts @@ -18,10 +18,18 @@ export const DOMAIN_DEPOSIT = Uint8Array.from([3, 0, 0, 0]); export const GENESIS_FORK_VERSION_MAINNET = Version.fromJson('0x00000000'); export const GENESIS_FORK_VERSION_PRATER = Version.fromJson('0x00001020'); export const GENESIS_FORK_VERSION_HOLESKY = Version.fromJson('0x01017000'); +export const GENESIS_FORK_VERSION_DEVNET = Version.fromJson('0x10000038'); +export const GENESIS_FORK_VERSION_DEVNET_PECTRA5 = Version.fromJson('0x10710240'); + export const ZERO_HASH = Buffer.alloc(32, 0); +const LOCAL_DEVNET_CHAIN_ID = 32382; +const PECTRA_5_DEVNET_CHAIN_ID = 7088110746; + export const GENESIS_FORK_VERSION_BY_CHAIN_ID = { [CHAINS.Mainnet]: GENESIS_FORK_VERSION_MAINNET, [CHAINS.Goerli]: GENESIS_FORK_VERSION_PRATER, [CHAINS.Holesky]: GENESIS_FORK_VERSION_HOLESKY, + [LOCAL_DEVNET_CHAIN_ID]: GENESIS_FORK_VERSION_DEVNET, + [PECTRA_5_DEVNET_CHAIN_ID]: GENESIS_FORK_VERSION_DEVNET_PECTRA5, }; diff --git a/src/contracts/deposits-registry/deposits-registry.constants.ts b/src/contracts/deposits-registry/deposits-registry.constants.ts index 417a338f..a49e2d62 100644 --- a/src/contracts/deposits-registry/deposits-registry.constants.ts +++ b/src/contracts/deposits-registry/deposits-registry.constants.ts @@ -1,11 +1,14 @@ import { CHAINS } from '@lido-sdk/constants'; -export const DEPLOYMENT_BLOCK_NETWORK: { - [key in CHAINS]?: number; -} = { +const LOCAL_DEVNET_CHAIN_ID = 32382; +const PECTRA_5_DEVNET_CHAIN_ID = 7088110746; + +export const DEPLOYMENT_BLOCK_NETWORK = { [CHAINS.Mainnet]: 11052984, [CHAINS.Goerli]: 4367322, [CHAINS.Holesky]: 0, + [LOCAL_DEVNET_CHAIN_ID]: 0, + [PECTRA_5_DEVNET_CHAIN_ID]: 0, }; export const DEPOSIT_EVENTS_STEP = 10_000; diff --git a/src/contracts/signing-keys-registry/signing-keys-registry.constants.ts b/src/contracts/signing-keys-registry/signing-keys-registry.constants.ts index dd0829c6..84280596 100644 --- a/src/contracts/signing-keys-registry/signing-keys-registry.constants.ts +++ b/src/contracts/signing-keys-registry/signing-keys-registry.constants.ts @@ -9,11 +9,14 @@ export const SIGNING_KEYS_CACHE_DEFAULT = Object.freeze({ data: [], }); -export const EARLIEST_MODULE_DEPLOYMENT_BLOCK_NETWORK: { - [key in CHAINS]?: number; -} = { +const LOCAL_DEVNET_CHAIN_ID = 32382; +const PECTRA_5_DEVNET_CHAIN_ID = 7088110746; + +export const EARLIEST_MODULE_DEPLOYMENT_BLOCK_NETWORK = { [CHAINS.Mainnet]: 11473216, [CHAINS.Holesky]: 0, + [LOCAL_DEVNET_CHAIN_ID]: 0, + [PECTRA_5_DEVNET_CHAIN_ID]: 0, }; // will make a gap in case of reorganization diff --git a/src/messages/messages.constants.ts b/src/messages/messages.constants.ts index 6efde7af..e5acf24f 100644 --- a/src/messages/messages.constants.ts +++ b/src/messages/messages.constants.ts @@ -1,11 +1,14 @@ import { CHAINS } from '@lido-sdk/constants'; -export const MESSAGE_TOPIC_PREFIX_BY_NETWORK: { - [key in CHAINS]?: string; -} = { +const LOCAL_DEVNET_CHAIN_ID = 32382; +const PECTRA_5_DEVNET_CHAIN_ID = 7088110746; + +export const MESSAGE_TOPIC_PREFIX_BY_NETWORK = { [CHAINS.Mainnet]: 'mainnet', [CHAINS.Goerli]: 'goerli', [CHAINS.Holesky]: 'holesky', + [LOCAL_DEVNET_CHAIN_ID]: 'devnet', + [PECTRA_5_DEVNET_CHAIN_ID]: 'devnet-pectra5', }; export const getMessageTopicPrefix = (chainId: CHAINS): string => {