mirror of
https://gitlab.com/pulsechaincom/lighthouse-pulse.git
synced 2024-12-22 03:30:38 +00:00
Fix doppelganger script (#3988)
## Issue Addressed N/A ## Proposed Changes The doppelganger tests were failing silently since the `PROPOSER_BOOST` config was not set. Sets the config and script returns an error if any subprocess fails.
This commit is contained in:
parent
fa8b920dd8
commit
3721f3a83c
@ -45,7 +45,7 @@ SECONDS_PER_SLOT=3
|
|||||||
SECONDS_PER_ETH1_BLOCK=1
|
SECONDS_PER_ETH1_BLOCK=1
|
||||||
|
|
||||||
# Proposer score boost percentage
|
# Proposer score boost percentage
|
||||||
PROPOSER_SCORE_BOOST=70
|
PROPOSER_SCORE_BOOST=40
|
||||||
|
|
||||||
# Command line arguments for validator client
|
# Command line arguments for validator client
|
||||||
VC_ARGS=""
|
VC_ARGS=""
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
# Requires `lighthouse`, ``lcli`, `ganache`, `curl`, `jq`
|
# Requires `lighthouse`, ``lcli`, `ganache`, `curl`, `jq`
|
||||||
|
|
||||||
|
|
||||||
BEHAVIOR=$1
|
BEHAVIOR=$1
|
||||||
|
|
||||||
if [[ "$BEHAVIOR" != "success" ]] && [[ "$BEHAVIOR" != "failure" ]]; then
|
if [[ "$BEHAVIOR" != "success" ]] && [[ "$BEHAVIOR" != "failure" ]]; then
|
||||||
@ -9,13 +10,22 @@ if [[ "$BEHAVIOR" != "success" ]] && [[ "$BEHAVIOR" != "failure" ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
exit_if_fails() {
|
||||||
|
echo $@
|
||||||
|
$@
|
||||||
|
EXIT_CODE=$?
|
||||||
|
if [[ $EXIT_CODE -eq 1 ]]; then
|
||||||
|
exit 111
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
source ./vars.env
|
source ./vars.env
|
||||||
|
|
||||||
../local_testnet/clean.sh
|
exit_if_fails ../local_testnet/clean.sh
|
||||||
|
|
||||||
echo "Starting ganache"
|
echo "Starting ganache"
|
||||||
|
|
||||||
../local_testnet/ganache_test_node.sh &> /dev/null &
|
exit_if_fails ../local_testnet/ganache_test_node.sh &> /dev/null &
|
||||||
GANACHE_PID=$!
|
GANACHE_PID=$!
|
||||||
|
|
||||||
# Wait for ganache to start
|
# Wait for ganache to start
|
||||||
@ -23,14 +33,14 @@ sleep 5
|
|||||||
|
|
||||||
echo "Setting up local testnet"
|
echo "Setting up local testnet"
|
||||||
|
|
||||||
../local_testnet/setup.sh
|
exit_if_fails ../local_testnet/setup.sh
|
||||||
|
|
||||||
# Duplicate this directory so slashing protection doesn't keep us from re-using validator keys
|
# Duplicate this directory so slashing protection doesn't keep us from re-using validator keys
|
||||||
cp -R $HOME/.lighthouse/local-testnet/node_1 $HOME/.lighthouse/local-testnet/node_1_doppelganger
|
exit_if_fails cp -R $HOME/.lighthouse/local-testnet/node_1 $HOME/.lighthouse/local-testnet/node_1_doppelganger
|
||||||
|
|
||||||
echo "Starting bootnode"
|
echo "Starting bootnode"
|
||||||
|
|
||||||
../local_testnet/bootnode.sh &> /dev/null &
|
exit_if_fails ../local_testnet/bootnode.sh &> /dev/null &
|
||||||
BOOT_PID=$!
|
BOOT_PID=$!
|
||||||
|
|
||||||
# wait for the bootnode to start
|
# wait for the bootnode to start
|
||||||
@ -38,20 +48,20 @@ sleep 10
|
|||||||
|
|
||||||
echo "Starting local beacon nodes"
|
echo "Starting local beacon nodes"
|
||||||
|
|
||||||
../local_testnet/beacon_node.sh $HOME/.lighthouse/local-testnet/node_1 9000 8000 &> /dev/null &
|
exit_if_fails ../local_testnet/beacon_node.sh $HOME/.lighthouse/local-testnet/node_1 9000 8000 &> /dev/null &
|
||||||
BEACON_PID=$!
|
BEACON_PID=$!
|
||||||
../local_testnet/beacon_node.sh $HOME/.lighthouse/local-testnet/node_2 9100 8100 &> /dev/null &
|
exit_if_fails ../local_testnet/beacon_node.sh $HOME/.lighthouse/local-testnet/node_2 9100 8100 &> /dev/null &
|
||||||
BEACON_PID2=$!
|
BEACON_PID2=$!
|
||||||
../local_testnet/beacon_node.sh $HOME/.lighthouse/local-testnet/node_3 9200 8200 &> /dev/null &
|
exit_if_fails ../local_testnet/beacon_node.sh $HOME/.lighthouse/local-testnet/node_3 9200 8200 &> /dev/null &
|
||||||
BEACON_PID3=$!
|
BEACON_PID3=$!
|
||||||
|
|
||||||
echo "Starting local validator clients"
|
echo "Starting local validator clients"
|
||||||
|
|
||||||
../local_testnet/validator_client.sh $HOME/.lighthouse/local-testnet/node_1 http://localhost:8000 &> /dev/null &
|
exit_if_fails ../local_testnet/validator_client.sh $HOME/.lighthouse/local-testnet/node_1 http://localhost:8000 &> /dev/null &
|
||||||
VALIDATOR_1_PID=$!
|
VALIDATOR_1_PID=$!
|
||||||
../local_testnet/validator_client.sh $HOME/.lighthouse/local-testnet/node_2 http://localhost:8100 &> /dev/null &
|
exit_if_fails ../local_testnet/validator_client.sh $HOME/.lighthouse/local-testnet/node_2 http://localhost:8100 &> /dev/null &
|
||||||
VALIDATOR_2_PID=$!
|
VALIDATOR_2_PID=$!
|
||||||
../local_testnet/validator_client.sh $HOME/.lighthouse/local-testnet/node_3 http://localhost:8200 &> /dev/null &
|
exit_if_fails ../local_testnet/validator_client.sh $HOME/.lighthouse/local-testnet/node_3 http://localhost:8200 &> /dev/null &
|
||||||
VALIDATOR_3_PID=$!
|
VALIDATOR_3_PID=$!
|
||||||
|
|
||||||
echo "Waiting an epoch before starting the next validator client"
|
echo "Waiting an epoch before starting the next validator client"
|
||||||
@ -73,9 +83,14 @@ if [[ "$BEHAVIOR" == "failure" ]]; then
|
|||||||
|
|
||||||
echo "Done"
|
echo "Done"
|
||||||
|
|
||||||
if [[ $DOPPELGANGER_EXIT -eq 124 ]]; then
|
# We expect to find a doppelganger, exit with success error code if doppelganger was found
|
||||||
|
# and failure if no doppelganger was found.
|
||||||
|
if [[ $DOPPELGANGER_EXIT -eq 1 ]]; then
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$BEHAVIOR" == "success" ]]; then
|
if [[ "$BEHAVIOR" == "success" ]]; then
|
||||||
|
@ -44,5 +44,8 @@ SECONDS_PER_SLOT=3
|
|||||||
# Seconds per Eth1 block
|
# Seconds per Eth1 block
|
||||||
SECONDS_PER_ETH1_BLOCK=1
|
SECONDS_PER_ETH1_BLOCK=1
|
||||||
|
|
||||||
|
# Proposer score boost percentage
|
||||||
|
PROPOSER_SCORE_BOOST=40
|
||||||
|
|
||||||
# Enable doppelganger detection
|
# Enable doppelganger detection
|
||||||
VC_ARGS=" --enable-doppelganger-protection "
|
VC_ARGS=" --enable-doppelganger-protection "
|
||||||
|
Loading…
Reference in New Issue
Block a user