Fix MEV backend and token-aggregation deployment wiring
All checks were successful
Deploy to Phoenix / deploy (push) Successful in 12s
All checks were successful
Deploy to Phoenix / deploy (push) Successful in 12s
This commit is contained in:
@@ -55,9 +55,14 @@ CUSDC_V2="${COMPLIANT_USDC_V2:-${CUSDC_V2_ADDRESS_138:-0x219522c60e83dEe01FC5b03
|
||||
|
||||
BLOCKERS=()
|
||||
WARNINGS=()
|
||||
NOTES=()
|
||||
KNOWN_REGISTRY_ORPHANS=(
|
||||
"0x9AA44008f30B7F6D2BfB74016420c5eA49c5ebE4"
|
||||
)
|
||||
|
||||
ok() { printf '[OK] %s\n' "$*"; }
|
||||
warn() { printf '[WARN] %s\n' "$*"; WARNINGS+=("$*"); }
|
||||
note() { printf '[NOTE] %s\n' "$*"; NOTES+=("$*"); }
|
||||
block() { printf '[BLOCKER] %s\n' "$*"; BLOCKERS+=("$*"); }
|
||||
|
||||
call_or_fail() {
|
||||
@@ -204,7 +209,11 @@ audit_registry_orphans() {
|
||||
[[ -z "$address" ]] && continue
|
||||
code="$(cast code "$address" --rpc-url "$RPC_URL" 2>/dev/null || true)"
|
||||
if [[ -z "$code" || "$code" == "0x" ]]; then
|
||||
warn "UniversalAssetRegistry has an active GRU entry with no bytecode: $address"
|
||||
if printf '%s\n' "${KNOWN_REGISTRY_ORPHANS[@]}" | grep -Fqx "$address"; then
|
||||
note "UniversalAssetRegistry still contains the known orphaned GRU entry from the interrupted 2026-04-03 rollout: $address"
|
||||
else
|
||||
warn "UniversalAssetRegistry has an active GRU entry with no bytecode: $address"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
@@ -220,7 +229,7 @@ if [[ "$RUN_LOCAL_TESTS" == "1" ]]; then
|
||||
run_local_suite
|
||||
ok "Local CompliantFiatTokenV2 suite passed."
|
||||
else
|
||||
warn "Skipping local Foundry suite. Re-run with --run-local-tests or RUN_LOCAL_TESTS=1 to include it."
|
||||
note "Skipping local Foundry suite. Re-run with --run-local-tests or RUN_LOCAL_TESTS=1 to include it."
|
||||
fi
|
||||
|
||||
check_token "cUSDT V2" "$CUSDT_V2" "cUSDT" "USD"
|
||||
@@ -228,9 +237,17 @@ check_token "cUSDC V2" "$CUSDC_V2" "cUSDC" "USD"
|
||||
audit_registry_orphans
|
||||
|
||||
printf '\n=== Summary ===\n'
|
||||
printf 'Notes: %s\n' "${#NOTES[@]}"
|
||||
printf 'Warnings: %s\n' "${#WARNINGS[@]}"
|
||||
printf 'Blockers: %s\n' "${#BLOCKERS[@]}"
|
||||
|
||||
if [[ "${#NOTES[@]}" -gt 0 ]]; then
|
||||
printf '\nNotes:\n'
|
||||
for item in "${NOTES[@]}"; do
|
||||
printf ' - %s\n' "$item"
|
||||
done
|
||||
fi
|
||||
|
||||
if [[ "${#WARNINGS[@]}" -gt 0 ]]; then
|
||||
printf '\nWarnings:\n'
|
||||
for item in "${WARNINGS[@]}"; do
|
||||
|
||||
@@ -180,6 +180,13 @@ if submit_disabled.strip().lower() in truthy:
|
||||
else:
|
||||
add_row("MEV_SUBMIT_DISABLED", str(env_path), submit_disabled or "0", "ok")
|
||||
|
||||
supervisor_url = os.environ.get("MEV_SUPERVISOR_URL") or env_values.get("MEV_SUPERVISOR_URL", "")
|
||||
if supervisor_url:
|
||||
add_row("MEV_SUPERVISOR_URL", str(env_path), supervisor_url, "ok")
|
||||
else:
|
||||
add_row("MEV_SUPERVISOR_URL", str(env_path), "(missing)", "missing")
|
||||
issues.append("MEV_SUPERVISOR_URL is not configured")
|
||||
|
||||
if chain is None:
|
||||
add_row(f"chains.{chain_key}", str(config_path), "(missing chain section)", "missing")
|
||||
issues.append(f"chains.{chain_key} section is missing")
|
||||
|
||||
@@ -14,6 +14,12 @@ WETH10="0xf4BB2e28688e89fCcE3c0580D37d36A7672E8A9f"
|
||||
USDT="0x004b63A7B5b0E06f6bB6adb4a5F9f590BF3182D1"
|
||||
USDC="0x71D6687F38b93CCad569Fa6352c876eea967201b"
|
||||
|
||||
ROOT_V1_CODE="000"
|
||||
TOKEN_AGG_V1_CODE="000"
|
||||
V2_CAPS_CODE="000"
|
||||
V2_PLAN_CODE="000"
|
||||
V2_INTERNAL_PLAN_CODE="000"
|
||||
|
||||
try_path() {
|
||||
local prefix="$1"
|
||||
local path="$2"
|
||||
@@ -77,12 +83,36 @@ echo ""
|
||||
echo "== planner-v2 checks =="
|
||||
echo ""
|
||||
echo "-- prefix: /token-aggregation (published v2 path) --"
|
||||
try_path "/token-aggregation" "/api/v2/providers/capabilities?chainId=138"
|
||||
V2_CAPS_CODE=$(curl -sS -o /tmp/ta-check.json -w "%{http_code}" -m 25 \
|
||||
"${BASE_URL}/token-aggregation/api/v2/providers/capabilities?chainId=138" 2>/dev/null || echo "000")
|
||||
echo " $V2_CAPS_CODE /token-aggregation/api/v2/providers/capabilities?chainId=138"
|
||||
if [[ "$V2_CAPS_CODE" == "200" ]]; then
|
||||
head -c 220 /tmp/ta-check.json
|
||||
echo
|
||||
fi
|
||||
if [[ -f /tmp/ta-check.json ]] && head -c 20 /tmp/ta-check.json | grep -qi '<!DOCTYPE'; then
|
||||
echo " [WARN] capabilities response looks like HTML — nginx may not proxy /token-aggregation/api/v2/ to token-aggregation (VMID 5000: scripts/fix-explorer-token-aggregation-api-v2-proxy.sh)"
|
||||
fi
|
||||
try_post_path "/token-aggregation" "/api/v2/routes/plan" "{\"sourceChainId\":138,\"tokenIn\":\"${WETH10}\",\"tokenOut\":\"${USDT}\",\"amountIn\":\"100000000000000000\"}"
|
||||
try_post_path "/token-aggregation" "/api/v2/routes/internal-execution-plan" "{\"sourceChainId\":138,\"tokenIn\":\"${WETH10}\",\"tokenOut\":\"${USDT}\",\"amountIn\":\"100000000000000000\"}"
|
||||
V2_PLAN_CODE=$(curl -sS -o /tmp/ta-check.json -w "%{http_code}" -m 25 \
|
||||
-H "content-type: application/json" \
|
||||
-X POST \
|
||||
--data "{\"sourceChainId\":138,\"tokenIn\":\"${WETH10}\",\"tokenOut\":\"${USDT}\",\"amountIn\":\"100000000000000000\"}" \
|
||||
"${BASE_URL}/token-aggregation/api/v2/routes/plan" 2>/dev/null || echo "000")
|
||||
echo " $V2_PLAN_CODE POST /token-aggregation/api/v2/routes/plan"
|
||||
if [[ "$V2_PLAN_CODE" == "200" || "$V2_PLAN_CODE" == "400" ]]; then
|
||||
head -c 260 /tmp/ta-check.json
|
||||
echo
|
||||
fi
|
||||
V2_INTERNAL_PLAN_CODE=$(curl -sS -o /tmp/ta-check.json -w "%{http_code}" -m 25 \
|
||||
-H "content-type: application/json" \
|
||||
-X POST \
|
||||
--data "{\"sourceChainId\":138,\"tokenIn\":\"${WETH10}\",\"tokenOut\":\"${USDT}\",\"amountIn\":\"100000000000000000\"}" \
|
||||
"${BASE_URL}/token-aggregation/api/v2/routes/internal-execution-plan" 2>/dev/null || echo "000")
|
||||
echo " $V2_INTERNAL_PLAN_CODE POST /token-aggregation/api/v2/routes/internal-execution-plan"
|
||||
if [[ "$V2_INTERNAL_PLAN_CODE" == "200" || "$V2_INTERNAL_PLAN_CODE" == "400" ]]; then
|
||||
head -c 260 /tmp/ta-check.json
|
||||
echo
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "== DODO stable depth sanity =="
|
||||
@@ -140,7 +170,32 @@ echo " - gas-registry 404: redeploy token-aggregation from repo (implements GET
|
||||
echo " - Health: curl -s http://127.0.0.1:3001/health on explorer VM (not always proxied as /health)."
|
||||
echo " - planner-v2 publishes under /token-aggregation/api/v2/* so it does not collide with Blockscout /api/v2/* on explorer.d-bis.org."
|
||||
echo " - Apex https://explorer.d-bis.org/api/v1/* returns 400 while /token-aggregation/api/v1/* works: add HTTP+HTTPS location /api/v1/ → token-aggregation (scripts/fix-explorer-http-api-v1-proxy.sh on explorer VM)."
|
||||
echo " - POST /token-aggregation/api/v2/* returns 405: insert v2 proxy block (scripts/fix-explorer-token-aggregation-api-v2-proxy.sh on VMID 5000)."
|
||||
echo " - If POST /token-aggregation/api/v2/* returns 405 or HTML instead of JSON, insert the v2 proxy block (scripts/fix-explorer-token-aggregation-api-v2-proxy.sh on VMID 5000)."
|
||||
echo " - Fresh binary + PMM env: bash scripts/deploy-token-aggregation-for-publication.sh then rsync dist/node_modules/.env to /opt/token-aggregation; systemctl restart token-aggregation (see TOKEN_AGGREGATION_REPORT_API_RUNBOOK.md)."
|
||||
echo " - DODO v3 pilot routes should return provider=dodo_v3, routePlanPresent=true, and an internal-execution-plan object targeting EnhancedSwapRouterV2 when CHAIN138_ENABLE_DODO_V3_EXECUTION is live."
|
||||
echo " - The funded canonical cUSDC/USDC DODO pool should report non-zero route-tree depth on Chain 138; if it falls back to near-zero TVL again, check the DODO valuation path and the canonical PMM integration address."
|
||||
|
||||
ROOT_V1_CODE=$(curl -sS -o /tmp/ta-root-v1.json -w "%{http_code}" -m 25 \
|
||||
"${BASE_URL}/api/v1/tokens?chainId=138&limit=1" 2>/dev/null || echo "000")
|
||||
TOKEN_AGG_V1_CODE=$(curl -sS -o /tmp/ta-tokenagg-v1.json -w "%{http_code}" -m 25 \
|
||||
"${BASE_URL}/token-aggregation/api/v1/tokens?chainId=138&limit=1" 2>/dev/null || echo "000")
|
||||
|
||||
echo ""
|
||||
echo "== summary =="
|
||||
echo "root_v1=$ROOT_V1_CODE token_aggregation_v1=$TOKEN_AGG_V1_CODE v2_caps=$V2_CAPS_CODE v2_plan=$V2_PLAN_CODE v2_internal_plan=$V2_INTERNAL_PLAN_CODE"
|
||||
|
||||
if [[ "$V2_CAPS_CODE" != "200" || "$V2_PLAN_CODE" != "200" || "$V2_INTERNAL_PLAN_CODE" != "200" ]]; then
|
||||
echo "[fail] planner-v2 publication is unhealthy" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "$TOKEN_AGG_V1_CODE" == "502" || "$TOKEN_AGG_V1_CODE" == "000" ]]; then
|
||||
echo "[fail] published /token-aggregation/api/v1 surface is unhealthy" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "$ROOT_V1_CODE" == "400" ]]; then
|
||||
echo "[warn] apex /api/v1 remains routed to Blockscout and not token-aggregation; use /token-aggregation/api/v1 or add the dedicated apex proxy if required." >&2
|
||||
fi
|
||||
|
||||
echo "[OK] token-aggregation planner-v2 is healthy; published v1 surface is reachable."
|
||||
|
||||
Reference in New Issue
Block a user