338338
339339echo " 🔐 Waiting for AuthZ grants to be created by core validator..."
340340echo " 📝 Core validators create AuthZ grants after UV registration completes"
341- echo " 📋 Required grants: MsgVoteInbound, MsgVoteChainMeta, MsgVoteOutbound"
341+ echo " 📋 Required grants: MsgVoteInbound, MsgVoteChainMeta, MsgVoteOutbound, MsgVoteTssKeyProcess "
342342
343343# Get the hotkey address
344344HOTKEY_ADDR=$( $BINARY keys show " $HOTKEY_NAME " --address --keyring-backend test --home " $HOME_DIR " 2> /dev/null || echo " " )
345345
346346# Required message types (must match PushSigner validation requirements)
347- REQUIRED_MSG_TYPES=' ["/uexecutor.v1.MsgVoteInbound","/uexecutor.v1.MsgVoteChainMeta","/uexecutor.v1.MsgVoteOutbound"]'
348- REQUIRED_GRANTS=3
347+ REQUIRED_MSG_TYPES=' ["/uexecutor.v1.MsgVoteInbound","/uexecutor.v1.MsgVoteChainMeta","/uexecutor.v1.MsgVoteOutbound","/utss.v1.MsgVoteTssKeyProcess"]'
348+ REQUIRED_GRANTS=4
349+
350+ # Allow additional time for grant propagation during startup races.
351+ AUTHZ_GRANTS_WAIT_SECONDS=${AUTHZ_GRANTS_WAIT_SECONDS:- 120}
349352
350353# Query core-validator-1 for grants (genesis validator creates ALL grants immediately)
351354GRANTS_QUERY_HOST=" core-validator-1"
@@ -354,14 +357,14 @@ if [ -n "$HOTKEY_ADDR" ]; then
354357 echo " 🔍 Checking for AuthZ grants for hotkey: $HOTKEY_ADDR "
355358 echo " 📡 Querying grants from: $GRANTS_QUERY_HOST :1317"
356359
357- # Wait for all required AuthZ grants (should be fast - genesis validator creates all grants)
358- max_wait=20
360+ # Wait for all required AuthZ grants (genesis validator creates all grants, but propagation can lag )
361+ max_wait=$AUTHZ_GRANTS_WAIT_SECONDS
359362 wait_time=0
360363 MATCHED_GRANTS=0
361364 while [ $wait_time -lt $max_wait ]; do
362365 # Query grants and count only required message types
363366 MATCHED_GRANTS=$( curl -s " http://$GRANTS_QUERY_HOST :1317/cosmos/authz/v1beta1/grants/grantee/$HOTKEY_ADDR " 2> /dev/null | \
364- jq -r --argjson required " $REQUIRED_MSG_TYPES " ' [.grants[]? | select (.authorization.value.msg as $m | $required | index($m))] | length' 2> /dev/null || echo " 0" )
367+ jq -r --argjson required " $REQUIRED_MSG_TYPES " ' [.grants[]? | (.authorization.msg // .authorization. value.msg // "") as $m | select( $required | index($m))] | length' 2> /dev/null || echo " 0" )
365368
366369 if [ " $MATCHED_GRANTS " -ge " $REQUIRED_GRANTS " ] 2> /dev/null; then
367370 echo " ✅ Found all $MATCHED_GRANTS /$REQUIRED_GRANTS required AuthZ grants!"
@@ -377,11 +380,12 @@ if [ -n "$HOTKEY_ADDR" ]; then
377380 done
378381
379382 if [ " $MATCHED_GRANTS " -lt " $REQUIRED_GRANTS " ] 2> /dev/null; then
380- echo " ⚠️ Only found $MATCHED_GRANTS /$REQUIRED_GRANTS required grants after ${max_wait} s"
381- echo " The universal validator may fail startup validation if grants are missing ."
383+ echo " ⚠️ Only found $MATCHED_GRANTS /$REQUIRED_GRANTS required grants after ${max_wait} s"
384+ echo " Continuing startup; grants may still arrive shortly ."
382385 fi
383386else
384- echo " ⚠️ Could not get hotkey address, skipping AuthZ check"
387+ echo " ❌ Could not get hotkey address, cannot verify AuthZ grants"
388+ exit 1
385389fi
386390
387391# ---------------------------
@@ -407,7 +411,7 @@ if [ -n "$EXPECTED_PEER_ID" ]; then
407411 reg_wait=0
408412 while [ $reg_wait -lt $max_reg_wait ]; do
409413 # Query all universal validators via REST API and look for our peer_id
410- FOUND=$( curl -s " http://core-validator-1:1317/push/ uvalidator/v1/all_universal_validators " 2> /dev/null | \
414+ FOUND=$( curl -s " http://core-validator-1:1317/uvalidator/v1/universal_validators " 2> /dev/null | \
411415 jq -r --arg pid " $EXPECTED_PEER_ID " \
412416 ' .universal_validator[]? | select(.network_info.peer_id == $pid) | .network_info.peer_id' 2> /dev/null || echo " " )
413417
@@ -424,10 +428,13 @@ if [ -n "$EXPECTED_PEER_ID" ]; then
424428 done
425429
426430 if [ -z " $FOUND " ]; then
427- echo " ⚠️ Validator not found on-chain after ${max_reg_wait} s, continuing anyway..."
431+ echo " ❌ Validator not found on-chain after ${max_reg_wait} s"
432+ echo " Failing startup so container restarts until registration is correct."
433+ exit 1
428434 fi
429435else
430- echo " ⚠️ Unknown UNIVERSAL_ID, skipping registration check"
436+ echo " ❌ Unknown UNIVERSAL_ID, cannot validate on-chain registration"
437+ exit 1
431438fi
432439
433440# ---------------------------
0 commit comments