monitoring scripts: protocol dispatch via registry slug + mantle/metis chainid fixes

- sync-status.sh: resolve protocol family from the compose x-upstreams chain
  label via the registry (reference-rpc-endpoint.sh --protocol) instead of
  path-substring guessing; legacy path detection kept as fallback for
  composes without a resolved label. Unknown families report
  'unsupported protocol: X' honestly instead of a bogus eth_chainId error.
  Aztec reference lookup falls back to slug urls when rollup_version is
  not in the registry.
- reference-rpc-endpoint.sh: new --chain <slug> (urls by registry key,
  works for idless non-EVM entries) and --protocol <slug> modes; existing
  chainid and --rollup-version lookups unchanged.
- mantle-sepolia: chainid 5001 -> 5003 (verified live: 0x138b), label and
  --networkid now correct
- metis-sepolia: label resolves via registry override (drpc chains.yaml
  carries wrong id 59901; live chain is 59902, verified via official RPC)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-06-12 06:34:31 +00:00
parent 714e8ba07a
commit 405f36d02f
6 changed files with 79 additions and 18 deletions

View File

@@ -34,17 +34,41 @@ for path in $pathlist; do
if $include; then
RPC_URL="$PROTO://$DOMAIN/$path"
# Detect Starknet vs Ethereum vs Aztec based on path
if echo "$path" | grep -qi "starknet"; then
is_starknet=true
is_aztec=false
elif echo "$path" | grep -qi "aztec"; then
is_starknet=false
is_aztec=true
else
is_starknet=false
is_aztec=false
# Resolve the protocol family from the compose x-upstreams chain label
# (drpc slug) via the registry. Falls back to legacy path-substring
# detection for composes without a resolved chain label.
chain_slug=$(grep -oP '^\s*chain:\s*\K\S+' "$BASEPATH/$1.yml" 2>/dev/null | head -1)
protocol=""
if [ -n "$chain_slug" ]; then
protocol=$($BASEPATH/reference-rpc-endpoint.sh --protocol "$chain_slug" 2>/dev/null) || protocol=""
fi
if [ -z "$protocol" ]; then
# Legacy detection by path substring
if echo "$path" | grep -qi "starknet"; then
protocol="starknet"
elif echo "$path" | grep -qi "aztec"; then
protocol="aztec"
else
protocol="eth"
fi
fi
case "$protocol" in
eth|starknet|aztec)
;;
*)
# Protocol family known from the registry but no probe support
# in check-health.sh yet - honest output instead of a bogus
# eth_chainId error. Add a handler when we deploy such a node.
echo "unsupported protocol: $protocol ($chain_slug)"
exit 1
;;
esac
is_starknet=false
is_aztec=false
[ "$protocol" = "starknet" ] && is_starknet=true
[ "$protocol" = "aztec" ] && is_aztec=true
ref=''
if [ -n "$2" ]; then
@@ -67,8 +91,14 @@ for path in $pathlist; do
version_hex="${version_hex#0x}"
version_hex="${version_hex: -8}"
version_decimal=$((16#$version_hex))
ref=$($BASEPATH/reference-rpc-endpoint.sh --rollup-version "$version_decimal")
if [ $? -ne 0 ]; then
ref=$($BASEPATH/reference-rpc-endpoint.sh --rollup-version "$version_decimal" 2>/dev/null)
if [ $? -ne 0 ] || [ -z "$ref" ]; then
# Fallback: reference urls by chain slug from the compose label
if [ -n "$chain_slug" ]; then
ref=$($BASEPATH/reference-rpc-endpoint.sh --chain "$chain_slug" 2>/dev/null) || ref=""
fi
fi
if [ -z "$ref" ]; then
echo "error: no reference endpoint for Aztec rollup_version $version_decimal"
exit 1
fi