Skip to content

Commit

Permalink
Add missing download image step and remove unused lcli dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmygchen committed May 31, 2024
1 parent be80833 commit 649d699
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 16 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/local-testnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ jobs:
sudo apt install -y kurtosis-cli yq
kurtosis analytics disable
- name: Download Docker image artifact
uses: actions/download-artifact@v4
with:
name: lighthouse-docker
path: .

- name: Load Docker image
run: docker load -i lighthouse-docker.tar

- name: Start local testnet
run: ./start_local_testnet.sh -e local -c -b false && sleep 60
working-directory: scripts/local_testnet
Expand Down Expand Up @@ -84,6 +93,15 @@ jobs:
sudo apt install -y kurtosis-cli yq
kurtosis analytics disable
- name: Download Docker image artifact
uses: actions/download-artifact@v4
with:
name: lighthouse-docker
path: .

- name: Load Docker image
run: docker load -i lighthouse-docker.tar

- name: Run the doppelganger protection failure test script
run: |
./doppelganger_protection.sh failure
Expand Down
3 changes: 0 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions lcli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,14 @@ ethereum_hashing = { workspace = true }
ethereum_ssz = { workspace = true }
environment = { workspace = true }
eth2_network_config = { workspace = true }
genesis = { workspace = true }
deposit_contract = { workspace = true }
tree_hash = { workspace = true }
clap_utils = { workspace = true }
lighthouse_network = { workspace = true }
validator_dir = { workspace = true, features = ["insecure_keys"] }
validator_dir = { workspace = true }
lighthouse_version = { workspace = true }
account_utils = { workspace = true }
eth2_wallet = { workspace = true }
eth1_test_rig = { workspace = true }
sensitive_url = { workspace = true }
eth2 = { workspace = true }
snap = { workspace = true }
beacon_chain = { workspace = true }
Expand Down
16 changes: 7 additions & 9 deletions scripts/tests/doppelganger_protection.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Requires `docker`, `kurtosis`, `yq`, `curl`, `jq`

set -Eeuo pipefail
set -Eeu

SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
NETWORK_PARAMS_FILE=$SCRIPT_DIR/network_params.yaml
Expand Down Expand Up @@ -43,7 +43,7 @@ function exit_and_dump_logs() {
# Start local testnet
$SCRIPT_DIR/../local_testnet/start_local_testnet.sh -e $ENCLAVE_NAME -b false -c -n $NETWORK_PARAMS_FILE

# Immediately stop node 4
# Immediately stop node 4 (as we only need the node 4 validator keys generated for later use)
kurtosis service stop $ENCLAVE_NAME cl-4-lighthouse-geth el-4-geth-lighthouse vc-4-geth-lighthouse

echo "Waiting an epoch before starting the next validator client"
Expand Down Expand Up @@ -123,7 +123,7 @@ if [[ "$BEHAVIOR" == "success" ]]; then

# 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 BN: $bn2_2_local_url"
echo "Performing checks using beacon node 2: $bn2_2_local_url"

# Get VC4 validator keys
keys_path=$SCRIPT_DIR/$ENCLAVE_NAME/node_4/validators
Expand All @@ -133,9 +133,8 @@ if [[ "$BEHAVIOR" == "success" ]]; then

for val in 0x*; do
[[ -e $val ]] || continue
resp=$(curl -s $bn2_2_local_url/lighthouse/validator_inclusion/3/$val)
# TODO: error handling
is_attester=$(echo $resp | jq | grep -q '"is_previous_epoch_target_attester": false')
curl -s $bn2_2_local_url/lighthouse/validator_inclusion/3/$val | jq | grep -q '"is_previous_epoch_target_attester": false'
is_attester=$?
if [[ $is_attester -eq 0 ]]; then
echo "$val did not attest in epoch 2."
else
Expand All @@ -152,9 +151,8 @@ if [[ "$BEHAVIOR" == "success" ]]; then
sleep $(( $SECONDS_PER_SLOT * 32 * 2 ))
for val in 0x*; do
[[ -e $val ]] || continue
resp=$(curl -s $bn2_2_host_url/lighthouse/validator_inclusion/5/$val)
# TODO: error handling
is_attester=$(echo $resp | jq | grep -q '"is_previous_epoch_target_attester": true')
curl -s $bn2_2_host_url/lighthouse/validator_inclusion/5/$val | jq | grep -q '"is_previous_epoch_target_attester": true'
is_attester=$?
if [[ $is_attester -eq 0 ]]; then
echo "$val attested in epoch 4."
else
Expand Down

0 comments on commit 649d699

Please sign in to comment.