From 2c66f7895b879e50df070ed0e4830d43a9abaa2f Mon Sep 17 00:00:00 2001 From: Shane Bammel Date: Mon, 30 Jan 2023 19:23:01 -0600 Subject: [PATCH] Add PulseChain network flag --- common/eth2_config/src/lib.rs | 21 ++++++ .../pulsechain_testnet/boot_enr.yaml | 2 + .../pulsechain_testnet/config.yaml | 75 +++++++++++++++++++ .../pulsechain_testnet/deploy_block.txt | 1 + common/lighthouse_version/src/lib.rs | 7 +- 5 files changed, 103 insertions(+), 3 deletions(-) create mode 100644 common/eth2_network_config/built_in_network_configs/pulsechain_testnet/boot_enr.yaml create mode 100644 common/eth2_network_config/built_in_network_configs/pulsechain_testnet/config.yaml create mode 100644 common/eth2_network_config/built_in_network_configs/pulsechain_testnet/deploy_block.txt diff --git a/common/eth2_config/src/lib.rs b/common/eth2_config/src/lib.rs index bf707c4d1..2d474e6df 100644 --- a/common/eth2_config/src/lib.rs +++ b/common/eth2_config/src/lib.rs @@ -284,6 +284,17 @@ define_hardcoded_nets!( // Describes how the genesis state can be obtained. GenesisStateSource::IncludedBytes ), + // TODO + // ( + // // Network name (must be unique among all networks). + // pulsechain, + // // The name of the directory in the `eth2_network_config/built_in_network_configs` + // // directory where the configuration files are located for this network. + // "pulsechain", + // // Set to `true` if the genesis state can be found in the `built_in_network_configs` + // // directory. + // false // GENESIS_STATE_IS_NOT_KNOWN + // ), ( // Network name (must be unique among all networks). prater, @@ -323,6 +334,16 @@ define_hardcoded_nets!( // directory. CHIADO_GENESIS_STATE_SOURCE ), + ( + // Network name (must be unique among all networks). + pulsechain_testnet, + // The name of the directory in the `eth2_network_config/built_in_network_configs` + // directory where the configuration files are located for this network. + "pulsechain_testnet", + // Set to `true` if the genesis state can be found in the `built_in_network_configs` + // directory. + GenesisStateSource::Unknown + ), ( // Network name (must be unique among all networks). sepolia, diff --git a/common/eth2_network_config/built_in_network_configs/pulsechain_testnet/boot_enr.yaml b/common/eth2_network_config/built_in_network_configs/pulsechain_testnet/boot_enr.yaml new file mode 100644 index 000000000..257d68206 --- /dev/null +++ b/common/eth2_network_config/built_in_network_configs/pulsechain_testnet/boot_enr.yaml @@ -0,0 +1,2 @@ +# TODO +[] diff --git a/common/eth2_network_config/built_in_network_configs/pulsechain_testnet/config.yaml b/common/eth2_network_config/built_in_network_configs/pulsechain_testnet/config.yaml new file mode 100644 index 000000000..c8703c85e --- /dev/null +++ b/common/eth2_network_config/built_in_network_configs/pulsechain_testnet/config.yaml @@ -0,0 +1,75 @@ +# PulseChain Testnet-V3 config + +# Extends the mainnet preset +CONFIG_NAME: 'pulsechain-testnet-v3' +PRESET_BASE: 'mainnet' + +# Transition +# --------------------------------------------------------------- +TERMINAL_TOTAL_DIFFICULTY: 58750003716598352947541 + +# Genesis +# --------------------------------------------------------------- +MIN_GENESIS_ACTIVE_VALIDATOR_COUNT: 5000 +# Jan 28 2023 00:00:00 UTC +MIN_GENESIS_TIME: 1674864000 +# Genesis Fork Version +GENESIS_FORK_VERSION: 0x00000942 +# 300 seconds +GENESIS_DELAY: 300 + + +# Forking +# --------------------------------------------------------------- +# Some forks are disabled for now: +# - These may be re-assigned to another fork-version later +# - Temporarily set to max uint64 value: 2**64 - 1 + +# Altair +ALTAIR_FORK_VERSION: 0x00000943 +ALTAIR_FORK_EPOCH: 1 +# Merge +BELLATRIX_FORK_VERSION: 0x00000944 +BELLATRIX_FORK_EPOCH: 2 + +# Time parameters +# --------------------------------------------------------------- +# 10 seconds +SECONDS_PER_SLOT: 10 +# 14 (estimate from Eth1 mainnet) +SECONDS_PER_ETH1_BLOCK: 14 +# 2**8 (= 256) epochs ~27 hours +MIN_VALIDATOR_WITHDRAWABILITY_DELAY: 256 +# 2**8 (= 256) epochs ~27 hours +SHARD_COMMITTEE_PERIOD: 256 +# 2**11 (= 2,048) Eth1 blocks ~8 hours +ETH1_FOLLOW_DISTANCE: 2048 + + +# Validator cycle +# --------------------------------------------------------------- +# 2**5 * 10**15 (= 32,000,000,000,000,000) Gwei +MAX_EFFECTIVE_BALANCE: 32000000000000000 +# 2**2 (= 4) +INACTIVITY_SCORE_BIAS: 4 +# 2**4 (= 16) +INACTIVITY_SCORE_RECOVERY_RATE: 16 +# 2**4 * 10**15 (= 16,000,000,000,000,000) Gwei +EJECTION_BALANCE: 16000000000000000 +# 2**2 (= 4) +MIN_PER_EPOCH_CHURN_LIMIT: 4 +# 2**16 (= 65,536) +CHURN_LIMIT_QUOTIENT: 65536 + + +# Fork choice +# --------------------------------------------------------------- +# 40% +PROPOSER_SCORE_BOOST: 40 + +# Deposit contract +# --------------------------------------------------------------- +# Ethereum PoW Mainnet +DEPOSIT_CHAIN_ID: 942 +DEPOSIT_NETWORK_ID: 942 +DEPOSIT_CONTRACT_ADDRESS: 0x3693693693693693693693693693693693693693 diff --git a/common/eth2_network_config/built_in_network_configs/pulsechain_testnet/deploy_block.txt b/common/eth2_network_config/built_in_network_configs/pulsechain_testnet/deploy_block.txt new file mode 100644 index 000000000..35a10a975 --- /dev/null +++ b/common/eth2_network_config/built_in_network_configs/pulsechain_testnet/deploy_block.txt @@ -0,0 +1 @@ +16492700 \ No newline at end of file diff --git a/common/lighthouse_version/src/lib.rs b/common/lighthouse_version/src/lib.rs index 5387d322e..d2a701276 100644 --- a/common/lighthouse_version/src/lib.rs +++ b/common/lighthouse_version/src/lib.rs @@ -37,9 +37,10 @@ mod test { #[test] fn version_formatting() { - let re = - Regex::new(r"^Lighthouse/v[0-9]+\.[0-9]+\.[0-9]+(-rc.[0-9])?(-[[:xdigit:]]{7})?\+?$") - .unwrap(); + let re = Regex::new( + r"^Lighthouse-Pulse/v[0-9]+\.[0-9]+\.[0-9]+(-rc.[0-9])?(-[[:xdigit:]]{7})?\+?$", + ) + .unwrap(); assert!( re.is_match(VERSION), "version doesn't match regex: {}",