publish-manifest.sh: --override carries every height switch in consensus.override (proving v0 activation needs it)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
igneum-labs 2026-10-04 20:09:35 +00:00
parent 13ae84ecdb
commit 8082576477

View file

@ -6,7 +6,7 @@
#
# packaging/ota/publish-manifest.sh --version 0.3.1 --mac packaging/mac/dist/Igneum-Miner-0.3.1.dmg \
# [--win packaging/windows/dist/Igneum-Miner-Setup-0.3.1.exe] --notes "one line of what changed" \
# [--activation-height 120000 --deadline-note "difficulty v2"] [--min-supported 0.3.0] [--channel devnet] [--deploy]
# [--activation-height 120000 --deadline-note "difficulty v2"] [--override '{"difficulty_v2_activation_daa":33000,"proving_v0_activation_daa":120000}'] [--min-supported 0.3.0] [--channel devnet] [--deploy]
#
# A platform you do not pass is carried over from the manifest already in the folder when that one has the same
# version (the Windows build lands later than the Mac one: publish the Mac entry first, add the Windows entry when
@ -28,7 +28,7 @@ PUB="$HOME/.config/igneum/ota-signing-key.pub"
TOKEN_FILE="$HOME/.config/igneum/dl-token"
SIGNER="$ROOT/app/igneum-app/target/release/igneum-ota-sign"
VERSION="" MAC="" WIN="" NOTES="" ACTIVATION="" DEADLINE="" MIN_SUPPORTED="" CHANNEL="devnet" BASE="" DEST="" DEPLOY=0
VERSION="" MAC="" WIN="" NOTES="" ACTIVATION="" DEADLINE=""; OVERRIDE="" MIN_SUPPORTED="" CHANNEL="devnet" BASE="" DEST="" DEPLOY=0
while [ $# -gt 0 ]; do
case "$1" in
--version) VERSION="$2"; shift 2 ;;
@ -37,6 +37,7 @@ while [ $# -gt 0 ]; do
--notes) NOTES="$2"; shift 2 ;;
--activation-height) ACTIVATION="$2"; shift 2 ;;
--deadline-note) DEADLINE="$2"; shift 2 ;;
--override) OVERRIDE="$2"; shift 2 ;; # consensus.override: the exact JSON object every app writes to its override.json (all height switches, not just the new one)
--min-supported) MIN_SUPPORTED="$2"; shift 2 ;;
--channel) CHANNEL="$2"; shift 2 ;;
--base-url) BASE="$2"; shift 2 ;;
@ -115,9 +116,11 @@ fi
# canonical JSON: sorted keys, no whitespace; the signature is over these exact bytes
NEW="$DEST/igneum-app-latest.json.new"
python3 - "$NEW" "$VERSION" "$CHANNEL" "$NOTES" "$MIN_SUPPORTED" "$ACTIVATION" "$DEADLINE" "$MAC_ENTRY" "$WIN_ENTRY" <<'PY'
python3 - "$NEW" "$VERSION" "$CHANNEL" "$NOTES" "$MIN_SUPPORTED" "$ACTIVATION" "$DEADLINE" "$MAC_ENTRY" "$WIN_ENTRY" "${OVERRIDE:-}" <<'PY'
import json, sys, datetime
out, version, channel, notes, min_supported, activation, deadline, mac, win = sys.argv[1:10]
override = json.loads(sys.argv[10]) if len(sys.argv) > 10 and sys.argv[10] else None
if override is not None and not isinstance(override, dict): raise SystemExit("--override must be a JSON object")
def entry(s):
if not s: return None
url, sha, size, kind = s.split()
@ -129,7 +132,7 @@ m = {
"platforms": {k: v for k, v in (("mac", entry(mac)), ("windows", entry(win))) if v},
"min_supported_version": min_supported,
"notes": notes,
"consensus": {"activation_height": int(activation) if activation else None, "deadline_note": deadline},
"consensus": {"activation_height": int(activation) if activation else None, "deadline_note": deadline, **({"override": override} if override is not None else {})},
}
open(out, "w").write(json.dumps(m, sort_keys=True, separators=(",", ":"), ensure_ascii=False))
PY