diff --git a/metis-andromeda/l2geth/metis-andromeda-sepolia-l2geth-archive-leveldb-hash.yml b/metis-andromeda/l2geth/metis-andromeda-sepolia-l2geth-archive-leveldb-hash.yml index 4b6027e9..cb0b63d2 100644 --- a/metis-andromeda/l2geth/metis-andromeda-sepolia-l2geth-archive-leveldb-hash.yml +++ b/metis-andromeda/l2geth/metis-andromeda-sepolia-l2geth-archive-leveldb-hash.yml @@ -190,7 +190,7 @@ x-upstreams: frameSize: 20Mb msgSize: 50Mb url: $${WS_URL} - chain: + chain: metis-sepolia method-groups: enabled: - debug diff --git a/op/geth/mantle-sepolia-op-geth-archive-leveldb-hash.yml b/op/geth/mantle-sepolia-op-geth-archive-leveldb-hash.yml index 8804c2a7..2627b306 100644 --- a/op/geth/mantle-sepolia-op-geth-archive-leveldb-hash.yml +++ b/op/geth/mantle-sepolia-op-geth-archive-leveldb-hash.yml @@ -64,7 +64,7 @@ services: - --metrics - --metrics.addr=0.0.0.0 - --metrics.port=6060 - - --networkid=5001 + - --networkid=5003 - --nodiscover - --rpc.gascap=600000000 - --rpc.txfeecap=0 @@ -173,7 +173,7 @@ x-upstreams: frameSize: 20Mb msgSize: 50Mb url: $${WS_URL} - chain: + chain: mantle-sepolia method-groups: enabled: - debug diff --git a/op/geth/mantle-sepolia-op-geth-pruned-leveldb-hash.yml b/op/geth/mantle-sepolia-op-geth-pruned-leveldb-hash.yml index 9cc55273..e4bea04d 100644 --- a/op/geth/mantle-sepolia-op-geth-pruned-leveldb-hash.yml +++ b/op/geth/mantle-sepolia-op-geth-pruned-leveldb-hash.yml @@ -64,7 +64,7 @@ services: - --metrics - --metrics.addr=0.0.0.0 - --metrics.port=6060 - - --networkid=5001 + - --networkid=5003 - --nodiscover - --rpc.gascap=600000000 - --rpc.txfeecap=0 @@ -173,7 +173,7 @@ x-upstreams: frameSize: 20Mb msgSize: 50Mb url: $${WS_URL} - chain: + chain: mantle-sepolia method-groups: enabled: - debug diff --git a/reference-rpc-endpoint.json b/reference-rpc-endpoint.json index 9c396820..0d968ed8 100644 --- a/reference-rpc-endpoint.json +++ b/reference-rpc-endpoint.json @@ -472,7 +472,7 @@ }, "metis-sepolia": { "protocol": "eth", - "id": 59901, + "id": 59902, "urls": [ "https://metis-sepolia.drpc.org" ] diff --git a/reference-rpc-endpoint.sh b/reference-rpc-endpoint.sh index 34f0cb4f..da1fa644 100755 --- a/reference-rpc-endpoint.sh +++ b/reference-rpc-endpoint.sh @@ -13,6 +13,37 @@ if [ ! -f "$json_file" ]; then exit 1 fi +# Look up urls by registry key (drpc slug from the compose x-upstreams chain label). +# Works for non-EVM chains that have no chainid in the registry. +if [ "$1" = "--chain" ]; then + if [ $# -lt 2 ]; then + echo "Usage: $0 --chain " + exit 1 + fi + urls=$(jq -r --arg k "$2" '.[$k].urls // [] | .[]' "$json_file" 2>/dev/null | tr '\n' ' ') + if [ -z "${urls// /}" ]; then + echo "Chain not found: $2" + exit 1 + fi + echo "$urls" + exit 0 +fi + +# Look up the protocol family for a registry key (eth, starknet, aztec, bitcoin, solana, ...) +if [ "$1" = "--protocol" ]; then + if [ $# -lt 2 ]; then + echo "Usage: $0 --protocol " + exit 1 + fi + protocol=$(jq -r --arg k "$2" 'if has($k) then (.[$k].protocol // "eth") else empty end' "$json_file" 2>/dev/null) + if [ -z "$protocol" ]; then + echo "Chain not found: $2" + exit 1 + fi + echo "$protocol" + exit 0 +fi + # Look up by rollup_version (for Aztec: version from result.header.globalVariables.version) if [ "$1" = "--rollup-version" ]; then if [ $# -lt 2 ]; then diff --git a/sync-status.sh b/sync-status.sh index f5b54dd1..a19623b2 100755 --- a/sync-status.sh +++ b/sync-status.sh @@ -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