Replace INTERVALS_PER_SLOT with explicit slot component times (#7944)

https://github.com/ethereum/consensus-specs/pull/4476


  


Co-Authored-By: Barnabas Busa <barnabas.busa@ethereum.org>

Co-Authored-By: Eitan Seri- Levi <eserilev@gmail.com>

Co-Authored-By: Eitan Seri-Levi <eserilev@ucsc.edu>

Co-Authored-By: Michael Sproul <michaelsproul@users.noreply.github.com>

Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
This commit is contained in:
Eitan Seri-Levi
2026-02-01 21:58:42 -08:00
committed by GitHub
parent cd8049a696
commit 3ecf964385
56 changed files with 579 additions and 184 deletions

View File

@@ -9,7 +9,7 @@ NETWORK_PARAMS_FILE=$SCRIPT_DIR/network_params.yaml
BEHAVIOR=$1
ENCLAVE_NAME=local-testnet-$BEHAVIOR
SECONDS_PER_SLOT=$(yq eval ".network_params.seconds_per_slot" $NETWORK_PARAMS_FILE)
SLOT_DURATION_MS=$(yq eval ".network_params.slot_duration_ms" $NETWORK_PARAMS_FILE)
KEYS_PER_NODE=$(yq eval ".network_params.num_validator_keys_per_node" $NETWORK_PARAMS_FILE)
LH_IMAGE_NAME=$(yq eval ".participants[0].cl_image" $NETWORK_PARAMS_FILE)
@@ -56,7 +56,7 @@ GENESIS_DELAY=`curl -s $BN1_HTTP_ADDRESS/eth/v1/config/spec | jq '.data.GENESIS_
CURRENT_TIME=`date +%s`
# Note: doppelganger protection can only be started post epoch 0
echo "Waiting until next epoch before starting the next validator client..."
DELAY=$(( $SECONDS_PER_SLOT * 32 + $GENESIS_DELAY + $MIN_GENESIS_TIME - $CURRENT_TIME))
DELAY=$((($SLOT_DURATION_MS / 1000) * 32 + $GENESIS_DELAY + $MIN_GENESIS_TIME - $CURRENT_TIME))
sleep $DELAY
# Use BN2 for the next validator client
@@ -98,7 +98,7 @@ EOF
# Check if doppelganger VC has stopped and exited. Exit code 1 means the check timed out and VC is still running.
check_exit_cmd="until [ \$(get_service_status $service_name) != 'RUNNING' ]; do sleep 1; done"
doppelganger_exit=$(run_command_without_exit "timeout $(( $SECONDS_PER_SLOT * 32 * 2 )) bash -c \"$check_exit_cmd\"")
doppelganger_exit=$(run_command_without_exit "timeout $((($SLOT_DURATION_MS / 1000) * 32 * 2 )) bash -c \"$check_exit_cmd\"")
if [[ $doppelganger_exit -eq 1 ]]; then
echo "Test failed: expected doppelganger but VC is still running. Check the logs for details."
@@ -148,7 +148,7 @@ EOF
#
# See: https://lighthouse-book.sigmaprime.io/api_validator_inclusion.html
echo "Waiting three epochs..."
sleep $(( $SECONDS_PER_SLOT * 32 * 3 ))
sleep $((($SLOT_DURATION_MS / 1000) * 32 * 3 ))
# Get VC4 validator keys
keys_path=$SCRIPT_DIR/$ENCLAVE_NAME/node_4/validators
@@ -176,7 +176,7 @@ EOF
#
# See: https://lighthouse-book.sigmaprime.io/api_validator_inclusion.html
echo "Waiting two more epochs..."
sleep $(( $SECONDS_PER_SLOT * 32 * 2 ))
sleep $(( $SLOT_DURATION_MS / 1000 * 32 * 2 ))
for val in 0x*; do
[[ -e $val ]] || continue
is_attester=$(run_command_without_exit "curl -s $BN1_HTTP_ADDRESS/lighthouse/validator_inclusion/5/$val | jq | grep -q '\"is_previous_epoch_target_attester\": true'")

View File

@@ -11,7 +11,7 @@ participants:
cl_image: lighthouse:local
validator_count: 0
network_params:
seconds_per_slot: 6
slot_duration_ms: 6000
electra_fork_epoch: 0
fulu_fork_epoch: 100000 # a really big number so this test stays in electra
preset: "minimal"

View File

@@ -20,7 +20,7 @@ participants:
supernode: false
validator_count: 0
network_params:
seconds_per_slot: 6
slot_duration_ms: 6000
fulu_fork_epoch: 0
preset: "minimal"
additional_services:

View File

@@ -10,7 +10,7 @@ participants:
count: 4
network_params:
fulu_fork_epoch: 0
seconds_per_slot: 3
slot_duration_ms: 3000
num_validator_keys_per_node: 20
global_log_level: debug
snooper_enabled: false