Skip to content

Commit

Permalink
Merge pull request #112 from ethpandaops/bbusa/default-minimal-override
Browse files Browse the repository at this point in the history
feat: enable default minimal preset overrides
  • Loading branch information
barnabasbusa authored May 2, 2024
2 parents c9cfeb9 + 7fbb1fb commit b496b59
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,35 @@ gen_el_config(){
fi
}

gen_minimal_config() {
declare -A replacements=(
[MIN_PER_EPOCH_CHURN_LIMIT]=2
[CHURN_LIMIT_QUOTIENT]=32
[MIN_EPOCHS_FOR_BLOCK_REQUESTS]=272
[WHISK_EPOCHS_PER_SHUFFLING_PHASE]=4
[WHISK_PROPOSER_SELECTION_GAP]=1
[MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA]=64000000000
[MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT]=128000000000
)

for key in "${!replacements[@]}"; do
sed -i "s/$key:.*/$key: ${replacements[$key]}/" /data/custom_config_data/config.yaml
done
}

gen_cl_config(){
. /apps/el-gen/.venv/bin/activate
set -x
# Consensus layer: Check if genesis already exists
if ! [ -f "/data/custom_config_data/genesis.ssz" ]; then
tmp_dir=$(mktemp -d -t ci-XXXXXXXXXX)
mkdir -p /data/custom_config_data
# Replace environment vars in files
envsubst < /config/cl/config.yaml > /data/custom_config_data/config.yaml
envsubst < /config/cl/mnemonics.yaml > $tmp_dir/mnemonics.yaml
# Conditionally override values if preset is "minimal"
if [[ "$PRESET_BASE" == "minimal" ]]; then
gen_minimal_config
fi
cp $tmp_dir/mnemonics.yaml /data/custom_config_data/mnemonics.yaml
# Create deposit_contract.txt and deploy_block.txt
grep DEPOSIT_CONTRACT_ADDRESS /data/custom_config_data/config.yaml | cut -d " " -f2 > /data/custom_config_data/deposit_contract.txt
Expand Down

0 comments on commit b496b59

Please sign in to comment.