Skip to content

Commit

Permalink
Missing the escape for double quotes 😫
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmygchen committed May 31, 2024
1 parent 8f35e7f commit f2f5113
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/local-testnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: jpribyl/action-docker-layer-caching@v0.1.1
# Ignore the failure of a step and avoid terminating the job.
continue-on-error: true

- name: Build Docker image
run: |
docker build --build-arg FEATURES=portable -t lighthouse:local .
Expand Down Expand Up @@ -148,7 +144,7 @@ jobs:
- name: Upload logs artifact
uses: actions/upload-artifact@v4
with:
name: logs-local-testnet
name: logs-doppelganger-protection-failure
path: |
scripts/local_testnet/logs
retention-days: 3
Expand Down
1 change: 1 addition & 0 deletions scripts/local_testnet/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
logs
14 changes: 5 additions & 9 deletions scripts/tests/doppelganger_protection.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ $SCRIPT_DIR/../local_testnet/start_local_testnet.sh -e $ENCLAVE_NAME -b false -c
kurtosis service stop $ENCLAVE_NAME cl-4-lighthouse-geth el-4-geth-lighthouse vc-4-geth-lighthouse > /dev/null

# Get the http port to get the config
http_address=`kurtosis port print $ENCLAVE_NAME cl-1-lighthouse-geth http`
BN1_HTTP_ADDRESS=`kurtosis port print $ENCLAVE_NAME cl-1-lighthouse-geth http`

# Get the genesis time and genesis delay
MIN_GENESIS_TIME=`curl -s $http_address/eth/v1/config/spec | jq '.data.MIN_GENESIS_TIME|tonumber'`
GENESIS_DELAY=`curl -s $http_address/eth/v1/config/spec | jq '.data.GENESIS_DELAY|tonumber'`
MIN_GENESIS_TIME=`curl -s $BN1_HTTP_ADDRESS/eth/v1/config/spec | jq '.data.MIN_GENESIS_TIME|tonumber'`
GENESIS_DELAY=`curl -s $BN1_HTTP_ADDRESS/eth/v1/config/spec | jq '.data.GENESIS_DELAY|tonumber'`

CURRENT_TIME=`date +%s`
# Note: doppelganger protection can only be started post epoch 0
Expand Down Expand Up @@ -132,10 +132,6 @@ if [[ "$BEHAVIOR" == "success" ]]; then
echo "Waiting three epochs..."
sleep $(( $SECONDS_PER_SLOT * 32 * 3 ))

# Get BN2 localhost URL
bn2_2_local_url=$(kurtosis enclave inspect $ENCLAVE_NAME | grep 'cl-2-lighthouse-geth' | grep -oP 'http://[^ ]+')
echo "Performing checks using beacon node 2: $bn2_2_local_url"

# Get VC4 validator keys
keys_path=$SCRIPT_DIR/$ENCLAVE_NAME/node_4/validators
rm -rf $keys_path && mkdir -p $keys_path
Expand All @@ -144,7 +140,7 @@ if [[ "$BEHAVIOR" == "success" ]]; then

for val in 0x*; do
[[ -e $val ]] || continue
is_attester=$(run_command_without_exit "curl -s $bn2_2_local_url/lighthouse/validator_inclusion/3/$val | jq | grep -q '"is_previous_epoch_target_attester": false'")
is_attester=$(run_command_without_exit "curl -s $BN1_HTTP_ADDRESS/lighthouse/validator_inclusion/3/$val | jq | grep -q '\"is_previous_epoch_target_attester\": false'")
echo $is_attester
if [[ $is_attester -eq 0 ]]; then
echo "$val did not attest in epoch 2."
Expand All @@ -166,7 +162,7 @@ if [[ "$BEHAVIOR" == "success" ]]; then
sleep $(( $SECONDS_PER_SLOT * 32 * 2 ))
for val in 0x*; do
[[ -e $val ]] || continue
is_attester=$(run_command_without_exit "curl -s $bn2_2_local_url/lighthouse/validator_inclusion/5/$val | jq | grep -q '"is_previous_epoch_target_attester": true'")
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'")
if [[ $is_attester -eq 0 ]]; then
echo "$val attested in epoch 4."
else
Expand Down

0 comments on commit f2f5113

Please sign in to comment.