Skip to content

Commit cadb1aa

Browse files
bump submodules (#2279)
* bump submodules * undo a couple of bumps (32-bit failure) * launch_local_testnet.sh: timeout and various fixes * undo nim-http-utils bump (breaks RPC for VC)
1 parent 2cd627f commit cadb1aa

File tree

10 files changed

+55
-28
lines changed

10 files changed

+55
-28
lines changed

Jenkinsfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ def runStages() {
4040
set -e
4141
make -j${env.NPROC} V=1
4242
make -j${env.NPROC} V=1 LOG_LEVEL=TRACE NIMFLAGS='-d:testnet_servers_image' nimbus_beacon_node
43-
# Miracl fallback
44-
# make -j${env.NPROC} V=1 LOG_LEVEL=TRACE NIMFLAGS='-d:BLS_FORCE_BACKEND=miracl -d:testnet_servers_image' nimbus_beacon_node
43+
# Miracl fallback
44+
# make -j${env.NPROC} V=1 LOG_LEVEL=TRACE NIMFLAGS='-d:BLS_FORCE_BACKEND=miracl -d:testnet_servers_image' nimbus_beacon_node
4545
"""
4646
}
4747
},
@@ -53,8 +53,8 @@ def runStages() {
5353
// EXECUTOR_NUMBER will be 0 or 1, since we have 2 executors per Jenkins node
5454
sh """#!/bin/bash
5555
set -e
56-
./scripts/launch_local_testnet.sh --testnet 0 --nodes 4 --stop-at-epoch 5 --log-level DEBUG --disable-htop --data-dir local_testnet0_data --base-port \$(( 9000 + EXECUTOR_NUMBER * 100 )) --base-rpc-port \$(( 7000 + EXECUTOR_NUMBER * 100 )) --base-metrics-port \$(( 8008 + EXECUTOR_NUMBER * 100 )) -- --verify-finalization --discv5:no
57-
./scripts/launch_local_testnet.sh --testnet 1 --nodes 4 --stop-at-epoch 5 --log-level DEBUG --disable-htop --data-dir local_testnet1_data --base-port \$(( 9000 + EXECUTOR_NUMBER * 100 )) --base-rpc-port \$(( 7000 + EXECUTOR_NUMBER * 100 )) --base-metrics-port \$(( 8008 + EXECUTOR_NUMBER * 100 )) -- --verify-finalization --discv5:no
56+
./scripts/launch_local_testnet.sh --testnet 0 --nodes 4 --stop-at-epoch 5 --log-level DEBUG --disable-htop --data-dir local_testnet0_data --base-port \$(( 9000 + EXECUTOR_NUMBER * 100 )) --base-rpc-port \$(( 7000 + EXECUTOR_NUMBER * 100 )) --base-metrics-port \$(( 8008 + EXECUTOR_NUMBER * 100 )) --timeout 600 -- --verify-finalization --discv5:no
57+
./scripts/launch_local_testnet.sh --testnet 1 --nodes 4 --stop-at-epoch 5 --log-level DEBUG --disable-htop --data-dir local_testnet1_data --base-port \$(( 9000 + EXECUTOR_NUMBER * 100 )) --base-rpc-port \$(( 7000 + EXECUTOR_NUMBER * 100 )) --base-metrics-port \$(( 8008 + EXECUTOR_NUMBER * 100 )) --timeout 2400 -- --verify-finalization --discv5:no
5858
"""
5959
}
6060
}

scripts/launch_local_testnet.sh

Lines changed: 43 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ if [ ${PIPESTATUS[0]} != 4 ]; then
3131
exit 1
3232
fi
3333

34-
OPTS="hgt:n:d:"
35-
LONGOPTS="help,testnet:,nodes:,data-dir:,stop-at-epoch:,disable-htop,disable-vc,enable-logtrace,log-level:,base-port:,base-rpc-port:,base-metrics-port:,with-ganache,reuse-existing-data-dir"
34+
OPTS="ht:n:d:g"
35+
LONGOPTS="help,testnet:,nodes:,data-dir:,with-ganache,stop-at-epoch:,disable-htop,disable-vc,enable-logtrace,log-level:,base-port:,base-rpc-port:,base-metrics-port:,reuse-existing-data-dir,timeout:"
3636

3737
# default values
3838
TESTNET="1"
@@ -48,6 +48,7 @@ BASE_RPC_PORT="7000"
4848
REUSE_EXISTING_DATA_DIR="0"
4949
ENABLE_LOGTRACE="0"
5050
STOP_AT_EPOCH_FLAG=""
51+
TIMEOUT_DURATION="0"
5152

5253
print_help() {
5354
cat <<EOF
@@ -70,6 +71,7 @@ CI run: $(basename "$0") --disable-htop -- --verify-finalization
7071
--enable-logtrace display logtrace asr analysis
7172
--log-level set the log level (default: ${LOG_LEVEL})
7273
--reuse-existing-data-dir instead of deleting and recreating the data dir, keep it and reuse everything we can from it
74+
--timeout timeout in seconds (default: ${TIMEOUT_DURATION} - no timeout)
7375
EOF
7476
}
7577

@@ -91,10 +93,6 @@ while true; do
9193
TESTNET="$2"
9294
shift 2
9395
;;
94-
-n|--stop-at-epoch)
95-
STOP_AT_EPOCH_FLAG="--stop-at-epoch=$2"
96-
shift 2
97-
;;
9896
-n|--nodes)
9997
NUM_NODES="$2"
10098
shift 2
@@ -103,6 +101,14 @@ while true; do
103101
DATA_DIR="$2"
104102
shift 2
105103
;;
104+
-g|--with-ganache)
105+
USE_GANACHE="1"
106+
shift
107+
;;
108+
--stop-at-epoch)
109+
STOP_AT_EPOCH_FLAG="--stop-at-epoch=$2"
110+
shift 2
111+
;;
106112
--disable-htop)
107113
USE_HTOP="0"
108114
shift
@@ -111,8 +117,8 @@ while true; do
111117
USE_VC="0"
112118
shift
113119
;;
114-
-g|--with-ganache)
115-
USE_GANACHE="1"
120+
--enable-logtrace)
121+
ENABLE_LOGTRACE="1"
116122
shift
117123
;;
118124
--log-level)
@@ -135,9 +141,9 @@ while true; do
135141
REUSE_EXISTING_DATA_DIR="1"
136142
shift
137143
;;
138-
--enable-logtrace)
139-
ENABLE_LOGTRACE="1"
140-
shift
144+
--timeout)
145+
TIMEOUT_DURATION="$2"
146+
shift 2
141147
;;
142148
--)
143149
shift
@@ -282,11 +288,11 @@ EOF
282288
# instance as the parent and the target process name as a pattern to the
283289
# "pkill" command.
284290
cleanup() {
285-
pkill -P $$ nimbus_beacon_node &>/dev/null || true
286-
pkill -P $$ nimbus_validator_client &>/dev/null || true
291+
pkill -f -P $$ nimbus_beacon_node &>/dev/null || true
292+
pkill -f -P $$ nimbus_validator_client &>/dev/null || true
287293
sleep 2
288-
pkill -9 -P $$ nimbus_beacon_node &>/dev/null || true
289-
pkill -9 -P $$ nimbus_validator_client &>/dev/null || true
294+
pkill -f -9 -P $$ nimbus_beacon_node &>/dev/null || true
295+
pkill -f -9 -P $$ nimbus_validator_client &>/dev/null || true
290296
}
291297
trap 'cleanup' SIGINT SIGTERM EXIT
292298

@@ -401,7 +407,7 @@ for NUM_NODE in $(seq 0 $(( NUM_NODES - 1 ))); do
401407
${STOP_AT_EPOCH_FLAG} \
402408
--data-dir="${VALIDATOR_DATA_DIR}" \
403409
--rpc-port="$(( BASE_RPC_PORT + NUM_NODE ))" \
404-
> "${DATA_DIR}/log_val${NUM_NODE}.txt" 2>&1 & PIDS="${PIDS},$!"
410+
> "${DATA_DIR}/log_val${NUM_NODE}.txt" 2>&1 &
405411
fi
406412
done
407413

@@ -415,6 +421,19 @@ if [[ "$BG_JOBS" != "$NUM_JOBS" ]]; then
415421
exit 1
416422
fi
417423

424+
# timeout - implemented with a background job
425+
timeout_reached() {
426+
echo -e "\nTimeout reached. Aborting.\n"
427+
cleanup
428+
}
429+
trap 'timeout_reached' SIGALRM
430+
431+
if [[ "${TIMEOUT_DURATION}" != "0" ]]; then
432+
export PARENT_PID=$$
433+
( sleep ${TIMEOUT_DURATION} && kill -ALRM ${PARENT_PID} ) 2>/dev/null & WATCHER_PID=$!
434+
fi
435+
436+
# launch htop or wait for background jobs
418437
if [[ "$USE_HTOP" == "1" ]]; then
419438
htop -p "$PIDS"
420439
cleanup
@@ -427,8 +446,16 @@ else
427446
echo "${FAILED} child processes had non-zero exit codes (or exited early)."
428447
dump_logs
429448
dump_logtrace
449+
if [[ "${TIMEOUT_DURATION}" != "0" ]]; then
450+
pkill -HUP -P ${WATCHER_PID}
451+
fi
430452
exit 1
431453
fi
432454
fi
433455

434456
dump_logtrace
457+
458+
if [[ "${TIMEOUT_DURATION}" != "0" ]]; then
459+
pkill -HUP -P ${WATCHER_PID}
460+
fi
461+

vendor/karax

Submodule karax updated from f1cd9e6 to 32de202

vendor/nim-chronos

vendor/nim-protobuf-serialization

vendor/nimbus-build-system

0 commit comments

Comments
 (0)