Files
proxmox/scripts/verify/check-full-deployment-status.sh
defiQUG dbd517b279 Sync workspace: config, docs, scripts, CI, operator rules, and submodule pointers.
- Update dbis_core, cross-chain-pmm-lps, explorer-monorepo, metamask-integration, pr-workspace/chains
- Omit embedded publish git dirs and empty placeholders from index

Made-with: Cursor
2026-04-12 06:12:20 -07:00

447 lines
21 KiB
Bash
Executable File

#!/usr/bin/env bash
# Summarize the current "full deployment" posture across active Chain 138, GRU,
# public cW* pool, publication surfaces, and (when mainnet env is loaded) Mainnet
# DODO PMM peg/bot readiness via check-mainnet-pmm-peg-bot-readiness.sh.
#
# Usage:
# bash scripts/verify/check-full-deployment-status.sh
# bash scripts/verify/check-full-deployment-status.sh --skip-public-api
# bash scripts/verify/check-full-deployment-status.sh --json
#
# Exit codes:
# 0 = current full-deployment gate passes
# 1 = one or more deployment blockers remain
# Set SKIP_EXIT=1 to always exit 0 after printing the summary.
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
cd "$PROJECT_ROOT"
# shellcheck disable=SC1091
source "${PROJECT_ROOT}/smom-dbis-138/scripts/load-env.sh" >/dev/null 2>&1 || true
OUTPUT_JSON=0
SKIP_PUBLIC_API=0
SKIP_EXIT="${SKIP_EXIT:-0}"
RPC_URL="${RPC_URL_138_PUBLIC:-https://rpc-http-pub.d-bis.org}"
CAPTURE_TIMEOUT_SECONDS="${CAPTURE_TIMEOUT_SECONDS:-60}"
for arg in "$@"; do
case "$arg" in
--json) OUTPUT_JSON=1 ;;
--skip-public-api) SKIP_PUBLIC_API=1 ;;
--rpc-url=*) RPC_URL="${arg#--rpc-url=}" ;;
*)
echo "Unknown argument: $arg" >&2
exit 2
;;
esac
done
need_cmd() {
command -v "$1" >/dev/null 2>&1 || {
echo "[FAIL] Missing required command: $1" >&2
exit 1
}
}
need_cmd bash
need_cmd jq
need_cmd mktemp
TMPDIR="$(mktemp -d)"
cleanup() {
rm -rf "$TMPDIR"
}
trap cleanup EXIT
run_capture() {
local outfile="$1"
shift
if command -v timeout >/dev/null 2>&1 && [[ "${CAPTURE_TIMEOUT_SECONDS}" =~ ^[0-9]+$ ]] && (( CAPTURE_TIMEOUT_SECONDS > 0 )); then
if timeout "${CAPTURE_TIMEOUT_SECONDS}" "$@" >"$outfile" 2>&1; then
return 0
fi
return 1
fi
if "$@" >"$outfile" 2>&1; then
return 0
fi
return 1
}
write_fallback_json() {
local outfile="$1"
local fallback_json="$2"
printf '%s\n' "$fallback_json" >"$outfile"
}
CONFIG_OK=0
CONTRACTS_OK=0
PUBLIC_API_OK=0
GRU_V2_OK=0
GRU_ROLLOUT_OK=1
CW_STATUS_OK=1
GAS_STATUS_OK=1
CW_MESH_OK=1
GRU_PUBLIC_PROTOCOLS_OK=1
GRU_DEPLOYMENT_QUEUE_OK=1
GRU_FUNDING_OK=1
run_capture "$TMPDIR/config.out" bash scripts/validation/validate-config-files.sh && CONFIG_OK=1 || true
run_capture "$TMPDIR/contracts.out" bash scripts/verify/check-contracts-on-chain-138.sh "$RPC_URL" && CONTRACTS_OK=1 || true
run_capture "$TMPDIR/gru-v2.out" bash scripts/verify/check-gru-v2-chain138-readiness.sh --report-only && GRU_V2_OK=1 || true
if ! run_capture "$TMPDIR/gru-rollout.json" bash scripts/verify/check-gru-global-priority-rollout.sh --json; then
GRU_ROLLOUT_OK=0
write_fallback_json "$TMPDIR/gru-rollout.json" '{"summary":{"totalAssets":0,"liveTransport":0,"canonicalOnly":0,"backlog":0},"destinationSummary":{"nonEvmRelayPrograms":0},"desiredDestinationNetworks":{"nonEvmRelayPrograms":[]}}'
fi
if ! run_capture "$TMPDIR/cw-status.json" bash scripts/verify/check-cw-public-pool-status.sh --json; then
CW_STATUS_OK=0
write_fallback_json "$TMPDIR/cw-status.json" '{"summary":{"chainsChecked":0,"chainsWithCwTokens":0,"chainsWithBridgeAvailable":0,"chainsWithAnyPmmPools":0}}'
fi
if ! run_capture "$TMPDIR/gas-status.json" bash scripts/verify/check-gas-public-pool-status.sh --json; then
GAS_STATUS_OK=0
write_fallback_json "$TMPDIR/gas-status.json" '{"summary":{"gasFamiliesTracked":0,"transportPairs":0,"runtimeReadyPairs":0,"blockedPairs":0,"pairsWithWrappedNativePools":0,"pairsWithStableQuotePools":0,"pairsWithUniswapReference":0,"pairsWithRoutingVisibleOneInch":0,"supplyInvariantFailures":0},"rows":[]}'
fi
if ! run_capture "$TMPDIR/gas-matrix.json" bash scripts/verify/check-gas-rollout-deployment-matrix.sh --json; then
cat >"$TMPDIR/gas-matrix.json" <<'EOF'
{"summary":{"verifierRefsLoaded":0,"pairsWithL1DestinationConfigured":0,"pairsWithL1ReceiverMatchingRuntimeL2":0,"l1BridgesWithPartialDestinationIntrospection":0,"deployedGenericVerifierAddress":"","topMissingRequirements":[]},"rows":[]}
EOF
fi
if ! run_capture "$TMPDIR/cw-mesh.json" bash scripts/verify/check-cw-evm-deployment-mesh.sh --json; then
CW_MESH_OK=0
write_fallback_json "$TMPDIR/cw-mesh.json" '{"summary":{"totalChains":0,"fullSetChains":0,"partialChains":0,"totalMissingTokens":0,"totalCodeGaps":0},"chains":[]}'
fi
if ! run_capture "$TMPDIR/gru-public-protocols.json" bash scripts/verify/check-gru-v2-public-protocols.sh --json; then
GRU_PUBLIC_PROTOCOLS_OK=0
write_fallback_json "$TMPDIR/gru-public-protocols.json" '{"summary":{"publicProtocolsTracked":0,"publicProtocolsWithActiveCwPools":0}}'
fi
if ! run_capture "$TMPDIR/gru-deployment-queue.json" bash scripts/verify/check-gru-v2-deployment-queue.sh --json; then
GRU_DEPLOYMENT_QUEUE_OK=0
write_fallback_json "$TMPDIR/gru-deployment-queue.json" '{"summary":{"wave1Assets":0,"wave1TransportPending":0,"wave1WrappedSymbolsCoveredByPoolMatrix":0,"wave1WrappedSymbols":0,"firstTierWave1PoolsPlanned":0,"firstTierWave1PoolsRecordedLive":0,"chainsMissingCwSuites":0}}'
fi
if ! run_capture "$TMPDIR/gru-funding.json" bash scripts/verify/check-gru-v2-deployer-funding-status.sh --json; then
GRU_FUNDING_OK=0
write_fallback_json "$TMPDIR/gru-funding.json" '{"blockers":[],"warnings":[]}'
fi
MAINNET_PMM_PEG_STATUS="skipped"
if [[ -n "${ETHEREUM_MAINNET_RPC:-}" && -n "${DODO_PMM_INTEGRATION_MAINNET:-}" ]]; then
if run_capture "$TMPDIR/mainnet-pmm-peg.out" bash scripts/verify/check-mainnet-pmm-peg-bot-readiness.sh; then
MAINNET_PMM_PEG_STATUS="OK"
else
MAINNET_PMM_PEG_STATUS="FAIL"
fi
fi
if (( SKIP_PUBLIC_API == 1 )); then
printf 'SKIPPED\n' >"$TMPDIR/public-api.status"
else
if run_capture "$TMPDIR/public-api.out" bash scripts/verify/check-token-aggregation-chain138-api.sh; then
PUBLIC_API_OK=1
printf 'OK\n' >"$TMPDIR/public-api.status"
else
printf 'FAIL\n' >"$TMPDIR/public-api.status"
fi
fi
CONTRACT_TOTAL_LINE="$(grep '^Total:' "$TMPDIR/contracts.out" | tail -1 || true)"
CONTRACT_PRESENT="$(printf '%s\n' "$CONTRACT_TOTAL_LINE" | sed -n 's/^Total: \([0-9][0-9]*\) present, \([0-9][0-9]*\) missing\/empty (\([0-9][0-9]*\) addresses).*/\1/p')"
CONTRACT_MISSING="$(printf '%s\n' "$CONTRACT_TOTAL_LINE" | sed -n 's/^Total: \([0-9][0-9]*\) present, \([0-9][0-9]*\) missing\/empty (\([0-9][0-9]*\) addresses).*/\2/p')"
CONTRACT_ADDRESSES="$(printf '%s\n' "$CONTRACT_TOTAL_LINE" | sed -n 's/^Total: \([0-9][0-9]*\) present, \([0-9][0-9]*\) missing\/empty (\([0-9][0-9]*\) addresses).*/\3/p')"
GRU_V2_WARNINGS="$(sed -n 's/^Warnings: \([0-9][0-9]*\).*/\1/p' "$TMPDIR/gru-v2.out" | tail -1)"
GRU_V2_BLOCKERS="$(sed -n 's/^Blockers: \([0-9][0-9]*\).*/\1/p' "$TMPDIR/gru-v2.out" | tail -1)"
GRU_V2_WARNINGS="${GRU_V2_WARNINGS:-0}"
GRU_V2_BLOCKERS="${GRU_V2_BLOCKERS:-0}"
GRU_V2_ORPHAN_WARNING="$(grep -F 'active GRU entry with no bytecode' "$TMPDIR/gru-v2.out" | tail -1 | sed 's/^[-[:space:]]*//' || true)"
ROLLOUT_TOTAL="$(jq -r '.summary.totalAssets' "$TMPDIR/gru-rollout.json")"
ROLLOUT_LIVE="$(jq -r '.summary.liveTransport' "$TMPDIR/gru-rollout.json")"
ROLLOUT_CANONICAL_ONLY="$(jq -r '.summary.canonicalOnly' "$TMPDIR/gru-rollout.json")"
ROLLOUT_BACKLOG="$(jq -r '.summary.backlog' "$TMPDIR/gru-rollout.json")"
ROLLOUT_NON_EVM="$(jq -r '.destinationSummary.nonEvmRelayPrograms' "$TMPDIR/gru-rollout.json")"
NON_EVM_TARGETS="$(jq -r '.desiredDestinationNetworks.nonEvmRelayPrograms[]?.identifier' "$TMPDIR/gru-rollout.json" | paste -sd ', ' -)"
CW_CHAINS="$(jq -r '.summary.chainsChecked' "$TMPDIR/cw-status.json")"
CW_TOKENS="$(jq -r '.summary.chainsWithCwTokens' "$TMPDIR/cw-status.json")"
CW_BRIDGES="$(jq -r '.summary.chainsWithBridgeAvailable' "$TMPDIR/cw-status.json")"
CW_POOLS="$(jq -r '.summary.chainsWithAnyPmmPools' "$TMPDIR/cw-status.json")"
GAS_FAMILIES="$(jq -r '.summary.gasFamiliesTracked' "$TMPDIR/gas-status.json")"
GAS_TRANSPORT_PAIRS="$(jq -r '.summary.transportPairs' "$TMPDIR/gas-status.json")"
GAS_RUNTIME_READY="$(jq -r '.summary.runtimeReadyPairs' "$TMPDIR/gas-status.json")"
GAS_BLOCKED_PAIRS="$(jq -r '.summary.blockedPairs' "$TMPDIR/gas-status.json")"
GAS_WRAPPED_NATIVE_POOLS="$(jq -r '.summary.pairsWithWrappedNativePools' "$TMPDIR/gas-status.json")"
GAS_STABLE_POOLS="$(jq -r '.summary.pairsWithStableQuotePools' "$TMPDIR/gas-status.json")"
GAS_UNISWAP_REFS="$(jq -r '.summary.pairsWithUniswapReference' "$TMPDIR/gas-status.json")"
GAS_ONEINCH_VISIBLE="$(jq -r '.summary.pairsWithRoutingVisibleOneInch' "$TMPDIR/gas-status.json")"
GAS_SUPPLY_INVARIANT_FAILURES="$(jq -r '.summary.supplyInvariantFailures' "$TMPDIR/gas-status.json")"
GAS_MISSING_TOP_REQUIREMENTS="$(jq -r '
[
.rows[]
| .missing[]?
]
| group_by(.)
| map({ requirement: .[0], count: length })
| sort_by(-.count, .requirement)
| .[:5]
| map("\(.requirement)=\(.count)")
| join(", ")
' "$TMPDIR/gas-status.json")"
GAS_MISSING_TOP_REQUIREMENTS="${GAS_MISSING_TOP_REQUIREMENTS:-none}"
GAS_MATRIX_VERIFIER_REFS_LOADED="$(jq -r '.summary.verifierRefsLoaded' "$TMPDIR/gas-matrix.json")"
GAS_MATRIX_L1_DESTINATIONS="$(jq -r '.summary.pairsWithL1DestinationConfigured' "$TMPDIR/gas-matrix.json")"
GAS_MATRIX_L1_RECEIVER_MATCHES="$(jq -r '.summary.pairsWithL1ReceiverMatchingRuntimeL2' "$TMPDIR/gas-matrix.json")"
GAS_MATRIX_L1_PARTIAL_BRIDGES="$(jq -r '.summary.l1BridgesWithPartialDestinationIntrospection' "$TMPDIR/gas-matrix.json")"
GAS_MATRIX_GENERIC_VERIFIER="$(jq -r '.summary.deployedGenericVerifierAddress // empty' "$TMPDIR/gas-matrix.json")"
GAS_MATRIX_STRICT_ENV_KEY="$(jq -r '
[.rows[] | select(.reserveVerifierEnvKey == "CW_GAS_STRICT_ESCROW_VERIFIER_CHAIN138") | .reserveVerifierEnvKey][0] // ""
' "$TMPDIR/gas-matrix.json")"
GAS_MATRIX_HYBRID_ENV_KEY="$(jq -r '
[.rows[] | select(.reserveVerifierEnvKey == "CW_GAS_HYBRID_CAP_VERIFIER_CHAIN138") | .reserveVerifierEnvKey][0] // ""
' "$TMPDIR/gas-matrix.json")"
CW_MESH_TOTAL_CHAINS="$(jq -r '.summary.totalChains' "$TMPDIR/cw-mesh.json")"
CW_MESH_FULL_SETS="$(jq -r '.summary.fullSetChains' "$TMPDIR/cw-mesh.json")"
CW_MESH_PARTIAL_CHAINS="$(jq -r '.summary.partialChains' "$TMPDIR/cw-mesh.json")"
CW_MESH_MISSING_TOKENS="$(jq -r '.summary.totalMissingTokens' "$TMPDIR/cw-mesh.json")"
CW_MESH_CODE_GAPS="$(jq -r '.summary.totalCodeGaps' "$TMPDIR/cw-mesh.json")"
CW_MESH_INCOMPLETE_NAMES="$(jq -r '.chains[] | select(.missingCount > 0) | .chainKey' "$TMPDIR/cw-mesh.json" | paste -sd ', ' -)"
CW_MESH_CODE_GAP_NAMES="$(jq -r '.chains[] | select(.codeGapCount > 0) | .chainKey' "$TMPDIR/cw-mesh.json" | paste -sd ', ' -)"
PUBLIC_PROTOCOLS_TRACKED="$(jq -r '.summary.publicProtocolsTracked' "$TMPDIR/gru-public-protocols.json")"
PUBLIC_PROTOCOLS_ACTIVE="$(jq -r '.summary.publicProtocolsWithActiveCwPools' "$TMPDIR/gru-public-protocols.json")"
QUEUE_WAVE1_ASSETS="$(jq -r '.summary.wave1Assets' "$TMPDIR/gru-deployment-queue.json")"
QUEUE_WAVE1_TRANSPORT_PENDING="$(jq -r '.summary.wave1TransportPending' "$TMPDIR/gru-deployment-queue.json")"
QUEUE_WAVE1_SYMBOLS_COVERED="$(jq -r '.summary.wave1WrappedSymbolsCoveredByPoolMatrix' "$TMPDIR/gru-deployment-queue.json")"
QUEUE_WAVE1_SYMBOLS_TOTAL="$(jq -r '.summary.wave1WrappedSymbols' "$TMPDIR/gru-deployment-queue.json")"
QUEUE_FIRST_TIER_PLANNED="$(jq -r '.summary.firstTierWave1PoolsPlanned' "$TMPDIR/gru-deployment-queue.json")"
QUEUE_FIRST_TIER_LIVE="$(jq -r '.summary.firstTierWave1PoolsRecordedLive' "$TMPDIR/gru-deployment-queue.json")"
QUEUE_CHAINS_MISSING_CW="$(jq -r '.summary.chainsMissingCwSuites' "$TMPDIR/gru-deployment-queue.json")"
FUNDING_BLOCKER_COUNT="$(jq -r '.blockers | length' "$TMPDIR/gru-funding.json")"
FUNDING_WARNING_COUNT="$(jq -r '.warnings | length' "$TMPDIR/gru-funding.json")"
FAILURES=0
BLOCKERS=()
if [[ "$CONFIG_OK" != "1" ]]; then
FAILURES=$((FAILURES + 1))
BLOCKERS+=("Config validation is not green.")
fi
if [[ -z "$CONTRACT_MISSING" || "$CONTRACT_MISSING" != "0" ]]; then
FAILURES=$((FAILURES + 1))
BLOCKERS+=("Chain 138 canonical contract inventory is not fully present on-chain.")
fi
if (( SKIP_PUBLIC_API == 0 )) && [[ "$PUBLIC_API_OK" != "1" ]]; then
FAILURES=$((FAILURES + 1))
BLOCKERS+=("Public token-aggregation / planner API is not fully healthy.")
fi
if [[ -z "$GRU_V2_BLOCKERS" || "$GRU_V2_BLOCKERS" != "0" ]]; then
FAILURES=$((FAILURES + 1))
BLOCKERS+=("GRU v2 readiness still has live blockers.")
fi
if [[ "$GRU_ROLLOUT_OK" != "1" ]]; then
FAILURES=$((FAILURES + 1))
BLOCKERS+=("GRU global rollout summary could not be captured cleanly; rerun check-gru-global-priority-rollout.sh.")
fi
if [[ "$ROLLOUT_CANONICAL_ONLY" != "0" ]]; then
FAILURES=$((FAILURES + 1))
BLOCKERS+=("GRU Wave 1 is not transport-complete; $ROLLOUT_CANONICAL_ONLY canonical assets still need cW deployment / enablement.")
fi
if [[ "$ROLLOUT_BACKLOG" != "0" ]]; then
FAILURES=$((FAILURES + 1))
BLOCKERS+=("Global-priority GRU rollout still has $ROLLOUT_BACKLOG backlog assets outside the live manifest.")
fi
if [[ "$CW_STATUS_OK" != "1" ]]; then
FAILURES=$((FAILURES + 1))
BLOCKERS+=("Public cW pool summary could not be captured cleanly; rerun check-cw-public-pool-status.sh.")
fi
if [[ "$CW_MESH_OK" != "1" ]]; then
FAILURES=$((FAILURES + 1))
BLOCKERS+=("Public EVM cW token mesh summary could not be captured cleanly; rerun check-cw-evm-deployment-mesh.sh.")
fi
if [[ "$CW_MESH_PARTIAL_CHAINS" != "0" ]]; then
FAILURES=$((FAILURES + 1))
BLOCKERS+=("Public EVM cW token mesh is incomplete; $CW_MESH_PARTIAL_CHAINS chain(s) still miss $CW_MESH_MISSING_TOKENS token deployments (${CW_MESH_INCOMPLETE_NAMES:-none}).")
fi
if [[ "$CW_MESH_CODE_GAPS" != "0" ]]; then
FAILURES=$((FAILURES + 1))
BLOCKERS+=("Public EVM cW token mesh has $CW_MESH_CODE_GAPS configured address(es) with no bytecode (${CW_MESH_CODE_GAP_NAMES:-none}).")
fi
if [[ "$CW_POOLS" == "0" ]]; then
FAILURES=$((FAILURES + 1))
BLOCKERS+=("Public-chain cW* PMM pool rollout is still empty across all tracked chains.")
fi
if [[ "$GAS_STATUS_OK" != "1" ]]; then
FAILURES=$((FAILURES + 1))
BLOCKERS+=("Gas-native rollout summary could not be captured cleanly; rerun check-gas-public-pool-status.sh.")
fi
if [[ "$GAS_BLOCKED_PAIRS" != "0" ]]; then
FAILURES=$((FAILURES + 1))
BLOCKERS+=("Gas-native rollout still has $GAS_BLOCKED_PAIRS blocked GRU transport pair(s); top missing requirements: ${GAS_MISSING_TOP_REQUIREMENTS}.")
fi
if [[ "$GAS_SUPPLY_INVARIANT_FAILURES" != "0" ]]; then
FAILURES=$((FAILURES + 1))
BLOCKERS+=("Gas-native rollout has $GAS_SUPPLY_INVARIANT_FAILURES supply-invariant failure(s); fix escrow, treasury-backed, or cap accounting before enabling routing.")
fi
if [[ "$GAS_MATRIX_VERIFIER_REFS_LOADED" != "$GAS_TRANSPORT_PAIRS" ]]; then
FAILURES=$((FAILURES + 1))
BLOCKERS+=("Gas-native verifier wiring is incomplete; loaded verifier refs=${GAS_MATRIX_VERIFIER_REFS_LOADED}/${GAS_TRANSPORT_PAIRS}. Expected envs: ${GAS_MATRIX_STRICT_ENV_KEY:-CW_GAS_STRICT_ESCROW_VERIFIER_CHAIN138} and ${GAS_MATRIX_HYBRID_ENV_KEY:-CW_GAS_HYBRID_CAP_VERIFIER_CHAIN138}${GAS_MATRIX_GENERIC_VERIFIER:+ (deployed verifier: $GAS_MATRIX_GENERIC_VERIFIER)}.")
fi
if [[ "$GAS_WRAPPED_NATIVE_POOLS" != "$GAS_TRANSPORT_PAIRS" || "$GAS_STABLE_POOLS" != "$GAS_TRANSPORT_PAIRS" ]]; then
FAILURES=$((FAILURES + 1))
BLOCKERS+=("Gas-native rollout is missing required DODO pool coverage; wrapped-native live=${GAS_WRAPPED_NATIVE_POOLS}/${GAS_TRANSPORT_PAIRS}, stable-quote live=${GAS_STABLE_POOLS}/${GAS_TRANSPORT_PAIRS}.")
fi
if [[ "$GAS_UNISWAP_REFS" != "$GAS_TRANSPORT_PAIRS" ]]; then
FAILURES=$((FAILURES + 1))
BLOCKERS+=("Gas-native rollout is missing required Uniswap v3 reference venues; live references=${GAS_UNISWAP_REFS}/${GAS_TRANSPORT_PAIRS}.")
fi
if [[ "$PUBLIC_PROTOCOLS_ACTIVE" == "0" ]]; then
FAILURES=$((FAILURES + 1))
BLOCKERS+=("Public-chain cW* protocol rollout is still inactive across all tracked venues (Uniswap v3, Balancer, Curve 3, DODO PMM, 1inch).")
fi
if [[ "$GRU_PUBLIC_PROTOCOLS_OK" != "1" ]]; then
FAILURES=$((FAILURES + 1))
BLOCKERS+=("GRU public protocol summary could not be captured cleanly; rerun check-gru-v2-public-protocols.sh.")
fi
if [[ "$GRU_DEPLOYMENT_QUEUE_OK" != "1" ]]; then
FAILURES=$((FAILURES + 1))
BLOCKERS+=("GRU deployment queue summary could not be captured cleanly; rerun check-gru-v2-deployment-queue.sh.")
fi
if [[ "$FUNDING_BLOCKER_COUNT" != "0" ]]; then
FAILURES=$((FAILURES + 1))
BLOCKERS+=("Deployer funding gate still has $FUNDING_BLOCKER_COUNT blocker(s) for remaining live rollout work.")
fi
if [[ "$GRU_FUNDING_OK" != "1" ]]; then
FAILURES=$((FAILURES + 1))
BLOCKERS+=("Deployer funding summary could not be captured cleanly; rerun check-gru-v2-deployer-funding-status.sh.")
fi
if [[ "$ROLLOUT_NON_EVM" != "0" ]]; then
FAILURES=$((FAILURES + 1))
BLOCKERS+=("Desired non-EVM deployment targets remain planned / relay-dependent (${NON_EVM_TARGETS:-none}).")
fi
if (( OUTPUT_JSON == 1 )); then
jq -n \
--arg rpcUrl "$RPC_URL" \
--argjson configOk "$CONFIG_OK" \
--argjson contractsOk "$CONTRACTS_OK" \
--arg contractTotal "${CONTRACT_ADDRESSES:-}" \
--arg contractPresent "${CONTRACT_PRESENT:-}" \
--arg contractMissing "${CONTRACT_MISSING:-}" \
--arg publicApiStatus "$(cat "$TMPDIR/public-api.status")" \
--argjson gruV2Ok "$GRU_V2_OK" \
--arg gruV2Warnings "${GRU_V2_WARNINGS:-}" \
--arg gruV2Blockers "${GRU_V2_BLOCKERS:-}" \
--arg gruV2OrphanWarning "$GRU_V2_ORPHAN_WARNING" \
--slurpfile rollout "$TMPDIR/gru-rollout.json" \
--slurpfile cw "$TMPDIR/cw-status.json" \
--slurpfile gas "$TMPDIR/gas-status.json" \
--slurpfile gasMatrix "$TMPDIR/gas-matrix.json" \
--slurpfile cwMesh "$TMPDIR/cw-mesh.json" \
--slurpfile gruPublicProtocols "$TMPDIR/gru-public-protocols.json" \
--slurpfile gruDeploymentQueue "$TMPDIR/gru-deployment-queue.json" \
--slurpfile gruFunding "$TMPDIR/gru-funding.json" \
--arg mainnetPmmPeg "$MAINNET_PMM_PEG_STATUS" \
--argjson failures "$FAILURES" \
--argjson blockerList "$(printf '%s\n' "${BLOCKERS[@]}" | jq -R . | jq -s .)" \
'{
rpcUrl: $rpcUrl,
mainnetPmmPegReadiness: $mainnetPmmPeg,
configOk: ($configOk == 1),
contracts: {
ok: ($contractsOk == 1),
totalAddresses: ($contractTotal | tonumber? // null),
present: ($contractPresent | tonumber? // null),
missing: ($contractMissing | tonumber? // null)
},
publicApiStatus: $publicApiStatus,
gruV2: {
ok: ($gruV2Ok == 1),
warnings: ($gruV2Warnings | tonumber? // null),
blockers: ($gruV2Blockers | tonumber? // null),
orphanWarning: $gruV2OrphanWarning
},
gruRollout: $rollout[0],
gruPublicProtocols: $gruPublicProtocols[0],
gruDeploymentQueue: $gruDeploymentQueue[0],
deployerFunding: $gruFunding[0],
gasNativeRollout: $gas[0],
gasNativeDeploymentMatrix: $gasMatrix[0],
cwEvmMesh: $cwMesh[0],
cwPublicPools: $cw[0],
failures: $failures,
fullDeploymentComplete: ($failures == 0),
blockers: $blockerList
}'
exit 0
fi
echo "=== Full Deployment Status ==="
echo "RPC: $RPC_URL"
echo "Config validation: $([[ "$CONFIG_OK" == "1" ]] && echo OK || echo FAIL)"
if [[ -n "$CONTRACT_TOTAL_LINE" ]]; then
echo "Chain 138 contracts: ${CONTRACT_PRESENT:-?}/${CONTRACT_ADDRESSES:-?} present"
else
echo "Chain 138 contracts: unknown"
fi
if (( SKIP_PUBLIC_API == 1 )); then
echo "Public API: skipped"
else
echo "Public API: $([[ "$PUBLIC_API_OK" == "1" ]] && echo OK || echo FAIL)"
fi
echo "GRU v2: blockers=${GRU_V2_BLOCKERS:-?}, warnings=${GRU_V2_WARNINGS:-?}"
echo "GRU global rollout: live=${ROLLOUT_LIVE}/${ROLLOUT_TOTAL}, canonical_only=${ROLLOUT_CANONICAL_ONLY}, backlog=${ROLLOUT_BACKLOG}"
echo "GRU public protocols: active=${PUBLIC_PROTOCOLS_ACTIVE}/${PUBLIC_PROTOCOLS_TRACKED}"
echo "GRU Wave 1 queue: assets=${QUEUE_WAVE1_ASSETS}, transport_pending=${QUEUE_WAVE1_TRANSPORT_PENDING}, pool_matrix=${QUEUE_WAVE1_SYMBOLS_COVERED}/${QUEUE_WAVE1_SYMBOLS_TOTAL}, planned_pairs=${QUEUE_FIRST_TIER_PLANNED}, live_pairs=${QUEUE_FIRST_TIER_LIVE}, missing_cw_suite_chains=${QUEUE_CHAINS_MISSING_CW}"
echo "Deployer funding: blockers=${FUNDING_BLOCKER_COUNT}, warnings=${FUNDING_WARNING_COUNT}"
echo "Gas-native rollout: families=${GAS_FAMILIES}, runtime_ready=${GAS_RUNTIME_READY}/${GAS_TRANSPORT_PAIRS}, blocked=${GAS_BLOCKED_PAIRS}, dodo_wrapped=${GAS_WRAPPED_NATIVE_POOLS}/${GAS_TRANSPORT_PAIRS}, dodo_stable=${GAS_STABLE_POOLS}/${GAS_TRANSPORT_PAIRS}, uniswap_refs=${GAS_UNISWAP_REFS}/${GAS_TRANSPORT_PAIRS}, 1inch_visible=${GAS_ONEINCH_VISIBLE}"
echo "Gas-native matrix: l1_destinations=${GAS_MATRIX_L1_DESTINATIONS}/${GAS_TRANSPORT_PAIRS}, l1_receivers_match=${GAS_MATRIX_L1_RECEIVER_MATCHES}/${GAS_TRANSPORT_PAIRS}, verifier_refs=${GAS_MATRIX_VERIFIER_REFS_LOADED}/${GAS_TRANSPORT_PAIRS}, l1_partial_bridges=${GAS_MATRIX_L1_PARTIAL_BRIDGES}, top_missing=${GAS_MISSING_TOP_REQUIREMENTS}"
echo "cW EVM mesh: full_sets=${CW_MESH_FULL_SETS}/${CW_MESH_TOTAL_CHAINS}, partial=${CW_MESH_PARTIAL_CHAINS}, missing_tokens=${CW_MESH_MISSING_TOKENS}, code_gaps=${CW_MESH_CODE_GAPS}"
echo "cW public mesh: chains=${CW_CHAINS}, withTokens=${CW_TOKENS}, withBridge=${CW_BRIDGES}, withPools=${CW_POOLS}"
echo "Mainnet PMM peg/bot readiness (ETHEREUM_MAINNET_RPC + DODO_PMM_INTEGRATION_MAINNET): ${MAINNET_PMM_PEG_STATUS}"
echo "Desired non-EVM targets: ${NON_EVM_TARGETS:-none}"
echo ""
if (( FAILURES == 0 )); then
echo "[OK] Full deployment gate is green."
else
echo "[WARN] Full deployment is not complete. Active blockers:"
for blocker in "${BLOCKERS[@]}"; do
echo "- $blocker"
done
fi
if [[ -n "$GRU_V2_ORPHAN_WARNING" ]]; then
echo ""
echo "Additional warning:"
echo "- $GRU_V2_ORPHAN_WARNING"
fi
if (( FAILURES > 0 )) && [[ "$SKIP_EXIT" != "1" ]]; then
exit 1
fi