Skip to content

Commit

Permalink
feat: add holesky network
Browse files Browse the repository at this point in the history
  • Loading branch information
g11tech committed Aug 23, 2023
1 parent 7ee07da commit c744443
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 3 deletions.
13 changes: 13 additions & 0 deletions packages/cli/src/networks/holesky.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export {holeskyChainConfig as chainConfig} from "@lodestar/config/networks";

export const depositContractDeployBlock = 0;
export const genesisFileUrl =
"https://media.githubusercontent.com/media/barnabasbusa/holesky/main/custom_config_data/genesis.ssz";
export const bootnodesFileUrl =
"https://raw.githubusercontent.com/barnabasbusa/holesky/main/custom_config_data/bootstrap_nodes.txt";

export const bootEnrs = [
"enr:-Iq4QJk4WqRkjsX5c2CXtOra6HnxN-BMXnWhmhEQO9Bn9iABTJGdjUOurM7Btj1ouKaFkvTRoju5vz2GPmVON2dffQKGAX53x8JigmlkgnY0gmlwhLKAlv6Jc2VjcDI1NmsxoQK6S-Cii_KmfFdUJL2TANL3ksaKUnNXvTCv1tLwXs0QgIN1ZHCCIyk",
"enr:-KG4QMH842KsJOZAHxI98VJcf8oPr1U8Ylyp2Tb-sNAPniWSCaxIS4F9gc3lGOnROEok7g5qrOm8WgJTl2WXx8MhMmIMhGV0aDKQqX6DZjABcAAKAAAAAAAAAIJpZIJ2NIJpcISygIjpiXNlY3AyNTZrMaECvQMvoDF46BfJgvAbbv1hwpNu9VQBXRIpHS_B8zmkZmmDdGNwgiMog3VkcIIjKA",
"enr:-Ly4QDU8tZeygxz1gEeAD4EKe4H_8gg-IanpTY6h8A1YGPv5BPNvCMD77zjHUk_iF1pfG_8DC6jYWbIOD1k5kF-LaG4Bh2F0dG5ldHOIAAAAAAAAAACEZXRoMpCpfoNmMAFwAAoAAAAAAAAAgmlkgnY0gmlwhJK-DYCJc2VjcDI1NmsxoQN4bUae9DwIcq_56DNztksQYXeddTDKRonI5qI3YhN4SohzeW5jbmV0cwCDdGNwgiMog3VkcIIjKA",
];
6 changes: 5 additions & 1 deletion packages/cli/src/networks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,17 @@ import * as gnosis from "./gnosis.js";
import * as goerli from "./goerli.js";
import * as ropsten from "./ropsten.js";
import * as sepolia from "./sepolia.js";
import * as holesky from "./holesky.js";
import * as chiado from "./chiado.js";

export type NetworkName = "mainnet" | "dev" | "gnosis" | "goerli" | "ropsten" | "sepolia" | "chiado";
export type NetworkName = "mainnet" | "dev" | "gnosis" | "goerli" | "ropsten" | "sepolia" | "holesky" | "chiado";
export const networkNames: NetworkName[] = [
"mainnet",
"gnosis",
"goerli",
"ropsten",
"sepolia",
"holesky",
"chiado",

// Leave always as last network. The order matters for the --help printout
Expand Down Expand Up @@ -63,6 +65,8 @@ export function getNetworkData(network: NetworkName): {
return ropsten;
case "sepolia":
return sepolia;
case "holesky":
return holesky;
case "chiado":
return chiado;
default:
Expand Down
43 changes: 43 additions & 0 deletions packages/config/src/chainConfig/networks/holesky.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/* eslint-disable @typescript-eslint/naming-convention */
import {fromHexString as b} from "@chainsafe/ssz";
import {ChainConfig} from "../types.js";
import {chainConfig as mainnet} from "../presets/mainnet.js";

// Holesky beacon chain config:
// https://github.com/barnabasbusa/holesky/blob/main/custom_config_data/config.yaml

export const holeskyChainConfig: ChainConfig = {
...mainnet,

CONFIG_NAME: "holesky",

// Genesis
// ---------------------------------------------------------------
MIN_GENESIS_ACTIVE_VALIDATOR_COUNT: 16384,
// Sep-15-2023 14:55:00 +UTC
MIN_GENESIS_TIME: 1694786100,
GENESIS_DELAY: 300,
GENESIS_FORK_VERSION: b("0x00017000"),

// Forking
// ---------------------------------------------------------------
// # Altair
ALTAIR_FORK_VERSION: b("0x10017000"),
ALTAIR_FORK_EPOCH: 0,
// # Merge
BELLATRIX_FORK_VERSION: b("0x20017000"),
BELLATRIX_FORK_EPOCH: 0,
TERMINAL_TOTAL_DIFFICULTY: BigInt("0"),
// Capella
CAPELLA_FORK_VERSION: b("0x30017000"),
CAPELLA_FORK_EPOCH: 10,

// # 28,000,000,000 Gwei to ensure quicker ejection
EJECTION_BALANCE: 28000000000,

// Deposit contract
// ---------------------------------------------------------------
DEPOSIT_CHAIN_ID: 17000,
DEPOSIT_NETWORK_ID: 17000,
DEPOSIT_CONTRACT_ADDRESS: b("0x4242424242424242424242424242424242424242"),
};
2 changes: 1 addition & 1 deletion packages/config/src/chainConfig/networks/sepolia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {fromHexString as b} from "@chainsafe/ssz";
import {ChainConfig} from "../types.js";
import {chainConfig as mainnet} from "../presets/mainnet.js";

// Ropsten beacon chain config:
// Sepolia beacon chain config:
// https://github.com/eth-clients/merge-testnets/blob/main/sepolia-beacon-chain/config.yaml

export const sepoliaChainConfig: ChainConfig = {
Expand Down
9 changes: 8 additions & 1 deletion packages/config/src/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {gnosisChainConfig} from "./chainConfig/networks/gnosis.js";
import {goerliChainConfig} from "./chainConfig/networks/goerli.js";
import {ropstenChainConfig} from "./chainConfig/networks/ropsten.js";
import {sepoliaChainConfig} from "./chainConfig/networks/sepolia.js";
import {holeskyChainConfig} from "./chainConfig/networks/holesky.js";
import {chiadoChainConfig} from "./chainConfig/networks/chiado.js";

export {
Expand All @@ -12,16 +13,18 @@ export {
goerliChainConfig,
ropstenChainConfig,
sepoliaChainConfig,
holeskyChainConfig,
chiadoChainConfig,
};

export type NetworkName = "mainnet" | "gnosis" | "goerli" | "ropsten" | "sepolia" | "chiado";
export type NetworkName = "mainnet" | "gnosis" | "goerli" | "ropsten" | "sepolia" | "holesky" | "chiado";
export const networksChainConfig: Record<NetworkName, ChainConfig> = {
mainnet: mainnetChainConfig,
gnosis: gnosisChainConfig,
goerli: goerliChainConfig,
ropsten: ropstenChainConfig,
sepolia: sepoliaChainConfig,
holesky: holeskyChainConfig,
chiado: chiadoChainConfig,
};

Expand Down Expand Up @@ -51,6 +54,10 @@ export const genesisData: Record<NetworkName, GenesisData> = {
genesisTime: 1655733600,
genesisValidatorsRoot: "0xd8ea171f3c94aea21ebc42a1ed61052acf3f9209c00e4efbaaddac09ed9b8078",
},
holesky: {
genesisTime: 1694786400,
genesisValidatorsRoot: "0x9143aa7c615a7f7115e2b6aac319c03529df8242ae705fba9df39b79c59fa8b1",
},
chiado: {
genesisTime: 1665396300,
genesisValidatorsRoot: "0x9d642dac73058fbf39c0ae41ab1e34e4d889043cb199851ded7095bc99eb4c1e",
Expand Down
1 change: 1 addition & 0 deletions packages/prover/src/utils/execution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export function getChainCommon(network: string): Common {
case "goerli":
case "ropsten":
case "sepolia":
case "holesky":
// TODO: Not sure how to detect the fork during runtime
return new Common({chain: network, hardfork: Hardfork.Shanghai});
case "minimal":
Expand Down

0 comments on commit c744443

Please sign in to comment.