Files
lighthouse/testing/ef_tests/download_test_vectors.sh
Michael Sproul 95b99ee724 Spec v1.7.0 alpha.3 (#8988)
Update spec code for compliance with spec v1.7.0-alpha.3: https://github.com/ethereum/consensus-specs/releases/tag/v1.7.0-alpha.3

The actual consensus changes are minimal. There are few more changes that are only relevant to fork choice or P2P validation that we will pick up in future PRs.

The change "Ignore beacon block if parent payload unknown" is currently covered in a hacky way by `load_parent` and can be improved once we have fork choice.

The change "Add parent_block_root to bid filtering key" is relevant to bid gossip validation, which we don't have at all in unstable yet.


Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
2026-03-16 11:40:22 +00:00

70 lines
2.0 KiB
Bash
Executable File

#!/usr/bin/env bash
set -Eeuo pipefail
TESTS=("general" "minimal" "mainnet")
version=${1}
if [[ "$version" == "nightly" || "$version" =~ ^nightly-[0-9]+$ ]]; then
if [[ -z "${GITHUB_TOKEN:-}" ]]; then
echo "Error GITHUB_TOKEN is not set"
exit 1
fi
for cmd in jq; do
if ! command -v "${cmd}" >/dev/null 2>&1; then
echo "Error ${cmd} is not installed"
exit 1
fi
done
repo="ethereum/consensus-specs"
api="https://api.github.com"
auth_header="Authorization: token ${GITHUB_TOKEN}"
if [[ "$version" == "nightly" ]]; then
run_id=$(curl --fail -s -H "${auth_header}" \
"${api}/repos/${repo}/actions/workflows/nightly-reftests.yml/runs?branch=master&status=success&per_page=1" |
jq -r '.workflow_runs[0].id')
else
run_id="${version#nightly-}"
fi
if [[ "${run_id}" == "null" || -z "${run_id}" ]]; then
echo "No successful nightly workflow run found"
exit 1
fi
echo "Downloading nightly test vectors for run: ${run_id}"
curl --fail -H "${auth_header}" "${api}/repos/${repo}/actions/runs/${run_id}/artifacts" |
jq -c '.artifacts[] | {name, url: .archive_download_url}' |
while read -r artifact; do
name=$(echo "${artifact}" | jq -r .name)
url=$(echo "${artifact}" | jq -r .url)
if [[ "$name" == "consensustestgen.log" ]]; then
continue
fi
echo "Downloading artifact: ${name}"
curl --progress-bar --location --show-error --retry 3 --retry-all-errors --fail \
-H "${auth_header}" -H "Accept: application/vnd.github+json" \
--output "${name}" "${url}" || {
echo "Failed to download ${name}"
exit 1
}
done
else
for test in "${TESTS[@]}"; do
if [[ ! -e "${test}.tar.gz" ]]; then
echo "Downloading: ${version}/${test}.tar.gz"
curl --progress-bar --location --remote-name --show-error --retry 3 --retry-all-errors --fail \
"https://github.com/ethereum/consensus-specs/releases/download/${version}/${test}.tar.gz" \
|| {
echo "Curl failed. Aborting"
rm -f "${test}.tar.gz"
exit 1
}
fi
done
fi