fix zero-gravity doubled-v bug in Dockerfile asset names

Remove leading 'v' from ZERO_GRAVITY_VERSION values in context.yml
(1.0.6, 3.0.8 instead of v1.0.6, v3.0.8) and add defensive stripping in
zerog.Dockerfile (VERSION=${ZERO_GRAVITY_VERSION#v}) to prevent
asset names like aristotle-vv1.0.6.tar.gz / galileo-vv3.0.8.tar.gz.

The asset filename is always <spec>-v<version>.tar.gz, and the Dockerfile
was adding a 'v' prefix to versions that already had one.

Verified URLs resolve:
- aristotle: https://github.com/0gfoundation/0gchain-Aristotle/releases/download/v1.0.6/aristotle-v1.0.6.tar.gz
- galileo: https://github.com/0gfoundation/0gchain-NG/releases/download/v3.0.8/galileo-v3.0.8.tar.gz

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
2026-08-25 04:36:36 +00:00
parent 6979290310
commit 7cbd053236
3 changed files with 14 additions and 11 deletions

View File

@@ -35,7 +35,7 @@ services:
context: ./zero-gravity context: ./zero-gravity
dockerfile: zerog.Dockerfile dockerfile: zerog.Dockerfile
args: args:
ZERO_GRAVITY_VERSION: ${ZERO_GRAVITY_ARISTOTLE_ZEROG_VERSION:-v1.0.6} ZERO_GRAVITY_VERSION: ${ZERO_GRAVITY_ARISTOTLE_ZEROG_VERSION:-1.0.6}
ZERO_GRAVITY_CHAIN_SPEC: aristotle ZERO_GRAVITY_CHAIN_SPEC: aristotle
sysctls: sysctls:
# TCP Performance # TCP Performance
@@ -118,7 +118,7 @@ services:
context: ./zero-gravity context: ./zero-gravity
dockerfile: zerog.Dockerfile dockerfile: zerog.Dockerfile
args: args:
ZERO_GRAVITY_VERSION: ${ZERO_GRAVITY_ARISTOTLE_ZEROG_VERSION:-v1.0.6} ZERO_GRAVITY_VERSION: ${ZERO_GRAVITY_ARISTOTLE_ZEROG_VERSION:-1.0.6}
ZERO_GRAVITY_CHAIN_SPEC: aristotle ZERO_GRAVITY_CHAIN_SPEC: aristotle
ports: ports:
- 19914:19914 - 19914:19914

View File

@@ -35,7 +35,7 @@ services:
context: ./zero-gravity context: ./zero-gravity
dockerfile: zerog.Dockerfile dockerfile: zerog.Dockerfile
args: args:
ZERO_GRAVITY_VERSION: ${ZERO_GRAVITY_GALILEO_ZEROG_VERSION:-v3.0.8} ZERO_GRAVITY_VERSION: ${ZERO_GRAVITY_GALILEO_ZEROG_VERSION:-3.0.8}
ZERO_GRAVITY_CHAIN_SPEC: galileo ZERO_GRAVITY_CHAIN_SPEC: galileo
sysctls: sysctls:
# TCP Performance # TCP Performance
@@ -118,7 +118,7 @@ services:
context: ./zero-gravity context: ./zero-gravity
dockerfile: zerog.Dockerfile dockerfile: zerog.Dockerfile
args: args:
ZERO_GRAVITY_VERSION: ${ZERO_GRAVITY_GALILEO_ZEROG_VERSION:-v3.0.8} ZERO_GRAVITY_VERSION: ${ZERO_GRAVITY_GALILEO_ZEROG_VERSION:-3.0.8}
ZERO_GRAVITY_CHAIN_SPEC: galileo ZERO_GRAVITY_CHAIN_SPEC: galileo
ports: ports:
- 16172:16172 - 16172:16172

View File

@@ -22,20 +22,23 @@ ARG ZERO_GRAVITY_CHAIN_SPEC
# curl uses -f (fail on HTTP error). Without it a 404 HTML body is written into the .tar.gz # curl uses -f (fail on HTTP error). Without it a 404 HTML body is written into the .tar.gz
# and the build dies several layers later at "tar: not in gzip format" -- an error that # and the build dies several layers later at "tar: not in gzip format" -- an error that
# points nowhere near the real cause. That has cost three separate misdiagnoses. # points nowhere near the real cause. That has cost three separate misdiagnoses.
#
# Strip leading 'v' from version if present, to avoid doubled-v (e.g., vv1.0.6 -> v1.0.6)
RUN set -eu; \ RUN set -eu; \
ASSET="${ZERO_GRAVITY_CHAIN_SPEC}-v${ZERO_GRAVITY_VERSION}.tar.gz"; \ VERSION="${ZERO_GRAVITY_VERSION#v}"; \
ASSET="${ZERO_GRAVITY_CHAIN_SPEC}-v${VERSION}.tar.gz"; \
if [ "${ZERO_GRAVITY_CHAIN_SPEC}" = "aristotle" ]; then \ if [ "${ZERO_GRAVITY_CHAIN_SPEC}" = "aristotle" ]; then \
REPO="0gfoundation/0gchain-Aristotle"; \ REPO="0gfoundation/0gchain-Aristotle"; \
TAGS="${ZERO_GRAVITY_VERSION} v${ZERO_GRAVITY_VERSION} ${ZERO_GRAVITY_CHAIN_SPEC}-v${ZERO_GRAVITY_VERSION}"; \ TAGS="${VERSION} v${VERSION} ${ZERO_GRAVITY_CHAIN_SPEC}-v${VERSION}"; \
else \ else \
REPO="0gfoundation/0gchain-NG"; \ REPO="0gfoundation/0gchain-NG"; \
TAGS="v${ZERO_GRAVITY_VERSION} ${ZERO_GRAVITY_CHAIN_SPEC}-v${ZERO_GRAVITY_VERSION} ${ZERO_GRAVITY_VERSION}"; \ TAGS="v${VERSION} ${ZERO_GRAVITY_CHAIN_SPEC}-v${VERSION} ${VERSION}"; \
fi; \ fi; \
for TAG in ${TAGS}; do \ for TAG in ${TAGS}; do \
URL="https://github.com/${REPO}/releases/download/${TAG}/${ASSET}"; \ URL="https://github.com/${REPO}/releases/download/${TAG}/${ASSET}"; \
echo "0g: trying tag '${TAG}' -> ${URL}"; \ echo "0g: trying tag '${TAG}' -> ${URL}"; \
if curl -fsSL "${URL}" -o "/tmp/${ASSET}"; then \ if curl -fsSL "${URL}" -o "/tmp/${ASSET}"; then \
echo "0g: resolved ${ZERO_GRAVITY_CHAIN_SPEC} ${ZERO_GRAVITY_VERSION} from tag '${TAG}'"; \ echo "0g: resolved ${ZERO_GRAVITY_CHAIN_SPEC} ${VERSION} from tag '${TAG}'"; \
break; \ break; \
fi; \ fi; \
rm -f "/tmp/${ASSET}"; \ rm -f "/tmp/${ASSET}"; \
@@ -44,7 +47,7 @@ RUN set -eu; \
echo "0g: FATAL - no release asset '${ASSET}' found in ${REPO} under any of: ${TAGS}" >&2; \ echo "0g: FATAL - no release asset '${ASSET}' found in ${REPO} under any of: ${TAGS}" >&2; \
echo "0g: aristotle and galileo are SEPARATE repos on SEPARATE version lines" >&2; \ echo "0g: aristotle and galileo are SEPARATE repos on SEPARATE version lines" >&2; \
echo "0g: aristotle = 0gchain-Aristotle (1.0.x), galileo = 0gchain-NG (3.0.x)" >&2; \ echo "0g: aristotle = 0gchain-Aristotle (1.0.x), galileo = 0gchain-NG (3.0.x)" >&2; \
echo "0g: check that version '${ZERO_GRAVITY_VERSION}' exists for '${ZERO_GRAVITY_CHAIN_SPEC}'" >&2; \ echo "0g: check that version '${VERSION}' exists for '${ZERO_GRAVITY_CHAIN_SPEC}'" >&2; \
exit 1; \ exit 1; \
fi fi
@@ -67,7 +70,7 @@ RUN set -eu; \
# version, nor the layout. Assert on the binaries here so the NEXT upstream reshuffle # version, nor the layout. Assert on the binaries here so the NEXT upstream reshuffle
# reports itself at the point of failure instead. # reports itself at the point of failure instead.
RUN set -eu; \ RUN set -eu; \
SRC="/tmp/${ZERO_GRAVITY_CHAIN_SPEC}-v${ZERO_GRAVITY_VERSION}"; \ SRC="/tmp/${ZERO_GRAVITY_CHAIN_SPEC}-v${VERSION}"; \
tar -xzf "${SRC}.tar.gz" -C /tmp; \ tar -xzf "${SRC}.tar.gz" -C /tmp; \
mkdir -p /0g; \ mkdir -p /0g; \
if [ -d "${SRC}/rpc" ]; then \ if [ -d "${SRC}/rpc" ]; then \
@@ -88,7 +91,7 @@ RUN set -eu; \
done; \ done; \
if [ -n "${missing}" ]; then \ if [ -n "${missing}" ]; then \
echo "0g: FATAL - missing after extraction:${missing}" >&2; \ echo "0g: FATAL - missing after extraction:${missing}" >&2; \
echo "0g: ${ZERO_GRAVITY_CHAIN_SPEC} v${ZERO_GRAVITY_VERSION} tarball layout not recognised." >&2; \ echo "0g: ${ZERO_GRAVITY_CHAIN_SPEC} v${VERSION} tarball layout not recognised." >&2; \
echo "0g: known layouts are '<root>/rpc/bin/' (per-profile) and '<root>/bin/' (flat)." >&2; \ echo "0g: known layouts are '<root>/rpc/bin/' (per-profile) and '<root>/bin/' (flat)." >&2; \
echo "0g: contents of /0g were:" >&2; \ echo "0g: contents of /0g were:" >&2; \
ls -la /0g >&2 || true; \ ls -la /0g >&2 || true; \