Skip to content

Commit

Permalink
Merge pull request #31 from ephemery-testnet/pk910/135-interval-change
Browse files Browse the repository at this point in the history
Genesis update & interval increase
  • Loading branch information
pk910 authored Jul 3, 2024
2 parents 2da6071 + e6e614a commit 1bd1a30
Show file tree
Hide file tree
Showing 12 changed files with 199 additions and 61 deletions.
22 changes: 17 additions & 5 deletions .github/workflows/build-testnet-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,32 +27,44 @@ jobs:
- name: Build nodevars.env
run: bash ./scripts/build-nodevars.sh

- name: Build legacy configs
run: bash ./scripts/build-legacy-config.sh

- name: Check all generated configs
run: bash ./scripts/check-genesis.sh

- name: Pack testnet configs
run: cd dist && tar cfz testnet-all.tar.gz *
run: cd dist && tar cfz network-config.tar.gz *

- name: Upload full config artifact
uses: actions/upload-artifact@v3
with:
path: ./dist/network-config.tar.gz
name: network-config.tar.gz

- name: Pack legacy testnet configs
run: cd dist2 && tar cfz testnet-all.tar.gz *

- name: Upload full config artifact
uses: actions/upload-artifact@v3
with:
path: ./dist/testnet-all.tar.gz
path: ./dist2/testnet-all.tar.gz
name: testnet-all.tar.gz

- name: Upload genesis.json artifact
uses: actions/upload-artifact@v3
with:
path: ./dist/genesis.json
path: ./dist/metadata/genesis.json
name: genesis.json

- name: Upload config.yaml artifact
uses: actions/upload-artifact@v3
with:
path: ./dist/config.yaml
path: ./dist/metadata/config.yaml
name: config.yaml
- name: Upload genesis.ssz artifact
uses: actions/upload-artifact@v3
with:
path: ./dist/genesis.ssz
path: ./dist/metadata/genesis.ssz
name: genesis.ssz

29 changes: 23 additions & 6 deletions .github/workflows/scheduled-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ jobs:
- name: Build nodevars.env
run: bash ./scripts/build-nodevars.sh

- name: Build legacy configs
run: bash ./scripts/build-legacy-config.sh

- name: Check all generated configs
run: bash ./scripts/check-genesis.sh

Expand Down Expand Up @@ -82,18 +85,32 @@ jobs:
| genesis.json | Execution Layer Genesis |
| config.yaml | Consensus Layer Config |
| genesis.ssz | Consensus Layer Genesis |
| testnet-all.tar.gz | Full testnet configuration (`testnet` directory) |
| network-config.tar.gz | Ephemery network config files (standardized testnet layout) |
| testnet-all.tar.gz | Legacy genesis config structure (`testnet` directory) |
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Pack testnet configs
run: cd dist && tar cfz testnet-all.tar.gz *
run: cd dist && tar cfz network-config.tar.gz *

- name: Upload full config artifact
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/network-config.tar.gz
asset_name: network-config.tar.gz
asset_content_type: application/gzip
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Pack legacy testnet configs
run: cd dist2 && tar cfz testnet-all.tar.gz *

- name: Upload full config artifact
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/testnet-all.tar.gz
asset_path: ./dist2/testnet-all.tar.gz
asset_name: testnet-all.tar.gz
asset_content_type: application/gzip
env:
Expand All @@ -103,7 +120,7 @@ jobs:
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/genesis.json
asset_path: ./dist/metadata/genesis.json
asset_name: genesis.json
asset_content_type: application/json
env:
Expand All @@ -113,7 +130,7 @@ jobs:
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/config.yaml
asset_path: ./dist/metadata/config.yaml
asset_name: config.yaml
asset_content_type: application/yaml
env:
Expand All @@ -122,7 +139,7 @@ jobs:
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/genesis.ssz
asset_path: ./dist/metadata/genesis.ssz
asset_name: genesis.ssz
asset_content_type: application/octet-stream
env:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
apps/eth2-testnet-genesis
dist
dist2
temp
55 changes: 44 additions & 11 deletions cl-config.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# Extends the mainnet preset
PRESET_BASE: 'mainnet'
PRESET_BASE: $PRESET_BASE
CONFIG_NAME: testnet # needs to exist because of Prysm. Otherwise it conflicts with mainnet genesis

# Genesis
# ---------------------------------------------------------------
# `2**14` (= 16,384)
MIN_GENESIS_ACTIVE_VALIDATOR_COUNT: $MIN_GENESIS_ACTIVE_VALIDATOR_COUNT
# Mar-01-2021 08:53:32 AM +UTC
# This is an invalid valid and should be updated when you create the genesis
#HUMAN_TIME_PLACEHOLDER
MIN_GENESIS_TIME: $GENESIS_TIMESTAMP
GENESIS_FORK_VERSION: $GENESIS_FORK_VERSION
GENESIS_DELAY: 300
GENESIS_DELAY: $GENESIS_DELAY


# Forking
Expand All @@ -28,12 +27,22 @@ BELLATRIX_FORK_EPOCH: 0
TERMINAL_TOTAL_DIFFICULTY: 0
TERMINAL_BLOCK_HASH: 0x0000000000000000000000000000000000000000000000000000000000000000
TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH: 18446744073709551615

# Capella
CAPELLA_FORK_VERSION: $CAPELLA_FORK_VERSION
CAPELLA_FORK_EPOCH: 0
# Deneb

# DENEB
DENEB_FORK_VERSION: $DENEB_FORK_VERSION
DENEB_FORK_EPOCH: $DENEB_FORK_EPOCH
DENEB_FORK_EPOCH: 0

# Electra
ELECTRA_FORK_VERSION: $ELECTRA_FORK_VERSION
ELECTRA_FORK_EPOCH: 18446744073709551615

# EIP7594 - Peerdas
EIP7594_FORK_VERSION: $EIP7594_FORK_VERSION
EIP7594_FORK_EPOCH: 18446744073709551615

# Time parameters
# ---------------------------------------------------------------
Expand All @@ -42,13 +51,12 @@ SECONDS_PER_SLOT: $SLOT_DURATION_IN_SECONDS
# 14 (estimate from Eth1 mainnet)
SECONDS_PER_ETH1_BLOCK: $SLOT_DURATION_IN_SECONDS
# 2**8 (= 256) epochs ~27 hours
MIN_VALIDATOR_WITHDRAWABILITY_DELAY: 256
MIN_VALIDATOR_WITHDRAWABILITY_DELAY: $MIN_VALIDATOR_WITHDRAWABILITY_DELAY
# 2**8 (= 256) epochs ~27 hours
SHARD_COMMITTEE_PERIOD: 256
SHARD_COMMITTEE_PERIOD: $SHARD_COMMITTEE_PERIOD
# 2**11 (= 2,048) Eth1 blocks ~8 hours
ETH1_FOLLOW_DISTANCE: $ETH1_FOLLOW_DISTANCE


# Validator cycle
# ---------------------------------------------------------------
# 2**2 (= 4)
Expand All @@ -60,14 +68,20 @@ EJECTION_BALANCE: $EJECTION_BALANCE
# 2**2 (= 4)
MIN_PER_EPOCH_CHURN_LIMIT: 4
# 2**16 (= 65,536)
CHURN_LIMIT_QUOTIENT: 65536
CHURN_LIMIT_QUOTIENT: $CHURN_LIMIT_QUOTIENT
# [New in Deneb:EIP7514] 2**3 (= 8)
MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT: $MAX_CHURN
MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT: $MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT

# Fork choice
# ---------------------------------------------------------------
# 40%
PROPOSER_SCORE_BOOST: 40
# 20%
REORG_HEAD_WEIGHT_THRESHOLD: 20
# 160%
REORG_PARENT_WEIGHT_THRESHOLD: 160
# `2` epochs
REORG_MAX_EPOCHS_SINCE_FINALIZATION: 2

# Deposit contract
# ---------------------------------------------------------------
Expand Down Expand Up @@ -113,3 +127,22 @@ MAX_REQUEST_BLOB_SIDECARS: 768
MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS: 4096
# `6`
BLOB_SIDECAR_SUBNET_COUNT: 6

# Whisk
# `Epoch(2**8)`
WHISK_EPOCHS_PER_SHUFFLING_PHASE: 256
# `Epoch(2)`
WHISK_PROPOSER_SELECTION_GAP: 2

# EIP7594
NUMBER_OF_COLUMNS: 128
MAX_CELLS_IN_EXTENDED_MATRIX: 768
DATA_COLUMN_SIDECAR_SUBNET_COUNT: $DATA_COLUMN_SIDECAR_SUBNET_COUNT
MAX_REQUEST_DATA_COLUMN_SIDECARS: 16384
SAMPLES_PER_SLOT: $SAMPLES_PER_SLOT
CUSTODY_REQUIREMENT: $CUSTODY_REQUIREMENT
TARGET_NUMBER_OF_PEERS: $TARGET_NUMBER_OF_PEERS

# [New in Electra:EIP7251]
MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA: 128000000000 # 2**7 * 10**9 (= 128,000,000,000)
MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT: 256000000000 # 2**8 * 10**9 (= 256,000,000,000)
8 changes: 6 additions & 2 deletions el-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
preset_base: ${PRESET_BASE}
chain_id: ${CHAIN_ID}
deposit_contract_address: "${DEPOSIT_CONTRACT_ADDRESS}"
mnemonic: ${EL_AND_CL_MNEMONIC}
el_premine: {}
el_premine_addrs: {
# Sepolia genesis (core devs)
Expand Down Expand Up @@ -29,12 +31,14 @@ el_premine_addrs: {
"0x57c3dfd40A86628B67721115d7A03C9F341d7718": 100000000ETH, # Remy Roy

# faucets
"0xc90E920F4DCfd4954230edCaB168D0C5B9561e03": 1000000000ETH, # post-genesis distribution from https://github.com/taxmeifyoucan/ephemeral-testnet/blob/master/funding.txt (pk910)
"0xc90E920F4DCfd4954230edCaB168D0C5B9561e03": 1000000000ETH, # post-genesis distribution from https://github.com/ephemery-testnet/ephemery-resources/blob/master/funding.txt
"0x6Cc9397c3B38739daCbfaA68EaD5F5D77Ba5F455": 10000000ETH, # PoWFaucet: https://ephemery-faucet.pk910.de
"0x992775d32fd0ec76b95C5E76CeEA92ED5a4bE1F9": 10000000ETH, # https://faucet.bordel.wtf/
}
additional_preloaded_contracts: ${ADDITIONAL_PRELOADED_CONTRACTS}
genesis_timestamp: ${GENESIS_TIMESTAMP}
genesis_delay: ${GENESIS_DELAY}
genesis_gaslimit: ${GENESIS_GASLIMIT}
slot_duration_in_seconds: ${SLOT_DURATION_IN_SECONDS}
deneb_fork_epoch: ${DENEB_FORK_EPOCH}
electra_fork_epoch: ${ELECTRA_FORK_EPOCH}
eof_activation_epoch: ${EOF_ACTIVATION_EPOCH}
23 changes: 10 additions & 13 deletions scripts/build-boot-enr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
set -x

get_github_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
curl --silent "https://api.github.com/repos/$1/releases/latest" | jq -r ".tag_name"
}

if ! [ -d ./temp/lighthouse ]; then
Expand All @@ -23,17 +21,17 @@ tmp_dir=$(mktemp -d -t ci-XXXXXXXXXX)
mkdir -p $tmp_dir
mkdir -p ./dist/bootnode-keys

if [ -f ./dist/boot_enr.txt ]; then
rm ./dist/boot_enr.txt
if [ -f ./dist/metadata/bootstrap_nodes.txt ]; then
rm ./dist/metadata/bootstrap_nodes.txt
fi
if [ -f ./dist/bootstrap_nodes.txt ]; then
rm ./dist/bootstrap_nodes.txt
if [ -f ./dist/metadata/bootstrap_nodes.yaml ]; then
rm ./dist/metadata/bootstrap_nodes.yaml
fi

add_bootnode_enr() {
echo "add enr: $1"
echo "$1" >> ./dist/bootstrap_nodes.txt
echo "- $1" >> ./dist/boot_enr.txt
echo "$1" >> ./dist/metadata/bootstrap_nodes.txt
echo "- $1" >> ./dist/metadata/bootstrap_nodes.yaml
}

add_bootnode_key() {
Expand All @@ -52,7 +50,7 @@ cat ./cl-bootnodes.txt | while read line ; do
add_bootnode_enr $line
elif [ ${bootnode_data[0]} = "lh_bootnode" ]; then
rm -rf $tmp_dir/*
./temp/lighthouse/lighthouse boot_node --testnet-dir ./dist --datadir $tmp_dir --port ${bootnode_data[3]} --enr-address ${bootnode_data[2]} &
./temp/lighthouse/lighthouse boot_node --testnet-dir ./dist/metadata --datadir $tmp_dir --port ${bootnode_data[3]} --enr-address ${bootnode_data[2]} &
sleep 2
killall lighthouse
sleep 2
Expand All @@ -64,7 +62,7 @@ cat ./cl-bootnodes.txt | while read line ; do
fi
elif [ ${bootnode_data[0]} = "lighthouse" ]; then
rm -rf $tmp_dir/*
./temp/lighthouse/lighthouse bn --testnet-dir ./dist --datadir $tmp_dir --enr-address ${bootnode_data[2]} --enr-udp-port ${bootnode_data[3]} --port ${bootnode_data[3]} &
./temp/lighthouse/lighthouse bn --testnet-dir ./dist/metadata --datadir $tmp_dir --enr-address ${bootnode_data[2]} --enr-udp-port ${bootnode_data[3]} --port ${bootnode_data[3]} &
sleep 10
killall lighthouse
sleep 2
Expand All @@ -77,7 +75,7 @@ cat ./cl-bootnodes.txt | while read line ; do
elif [ ${bootnode_data[0]} = "teku" ]; then
rm -rf $tmp_dir/*
echo -n 0x$(openssl rand -hex 32 | tr -d "\n") > $tmp_dir/jwtsecret
docker run -d --restart unless-stopped --name teku-node -u $UID -v ./dist:/testnet:ro -p 5052:5052 -v $tmp_dir:/data consensys/teku:latest \
docker run -d --restart unless-stopped --name teku-node -u $UID -v ./dist/metadata:/testnet:ro -p 5052:5052 -v $tmp_dir:/data consensys/teku:latest \
--network=/testnet/config.yaml --initial-state=/testnet/genesis.ssz \
--ee-endpoint=http://172.17.0.1:8651 --ee-jwt-secret-file=/data/jwtsecret \
--data-path=/data --p2p-enabled=true --p2p-interface=0.0.0.0 --p2p-advertised-ip=${bootnode_data[2]} --p2p-port=${bootnode_data[3]} --p2p-advertised-port=${bootnode_data[3]} \
Expand All @@ -95,4 +93,3 @@ cat ./cl-bootnodes.txt | while read line ; do
fi
done

cp ./dist/boot_enr.txt ./dist/boot_enr.yaml
18 changes: 13 additions & 5 deletions scripts/build-genesis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,21 @@ gen_all_config(){
# run ethereum-genesis-generator
docker run --rm -u $UID -v $PWD/temp/output:/data \
-v $PWD/temp/input:/config \
ethpandaops/ethereum-genesis-generator:2.0.11 \
ethpandaops/ethereum-genesis-generator:ephemery-1.0.0 \
all

# copy config folder structure
cp ./temp/output/custom_config_data -r ./dist
rm ./dist/mnemonics.yaml
mkdir ./dist
cp ./temp/output/metadata -r ./dist/metadata
cp ./temp/output/parsed -r ./dist/parsed

if [ -f ./dist/metadata/mnemonics.yaml ]; then
rm ./dist/metadata/mnemonics.yaml
fi
if [ -d ./dist/metadata/tranches ]; then
rmdir ./dist/metadata/tranches
fi

rm -rf ./temp

# build retention vars
Expand All @@ -45,8 +54,7 @@ gen_all_config(){
echo 'export CHAIN_ID="'"${CHAIN_ID}"'"' >> ./dist/retention.vars

# copy el bootnodes
cp ./el-bootnodes.txt ./dist/boot_enode.txt
cp ./el-bootnodes.txt ./dist/bootnode.txt
cp ./el-bootnodes.txt ./dist/metadata/enodes.txt

ls -lah ./dist
}
Expand Down
Loading

0 comments on commit 1bd1a30

Please sign in to comment.