File tree Expand file tree Collapse file tree 1 file changed +27
-1
lines changed
Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Original file line number Diff line number Diff line change 9393
9494 # # Generate Proof
9595 nonce=$( aligned get-user-nonce --batcher_url $BATCHER_URL --user_addr $SENDER_ADDRESS 2>&1 | awk ' {print $9}' )
96+ echo $nonce
97+ if ! [[ " $nonce " =~ ^[0-9]+$ ]]; then
98+ echo " Failed getting user nonce, retrying in 10 seconds"
99+ sleep 10
100+ continue
101+ fi
102+
96103 x=$(( nonce + 1 )) # So we don't have any issues with nonce = 0
97- echo " Generating proof $x != 0"
104+ echo " Generating proof $x != 0, nonce: $nonce "
98105 go run ./scripts/test_files/gnark_groth16_bn254_infinite_script/cmd/main.go $x
99106
100107 # # Send Proof
114121 2>&1 )
115122
116123 echo " $submit "
124+
125+ submit_errors=$( echo " $submit " | grep -oE ' ERROR[^]]*]([^[]*)' | sed ' s/^[^]]*]//;s/[[:space:]]*$//' )
126+
127+ # Loop through each error found and print with the custom message
128+ is_error=0
129+ while IFS= read -r error; do
130+ if [[ -n " $error " ]]; then
131+ slack_error_message=" Error submitting proof to $NETWORK : $error "
132+ send_slack_message " $slack_error_message "
133+ is_error=1
134+ fi
135+ done <<< " $submit_errors"
136+
137+ if [ $is_error -eq 1 ]; then
138+ echo " Error submitting proofs to $NETWORK , retrying in 60 seconds"
139+ send_slack_message " Error submitting proofs to $NETWORK , retrying in 60 seconds"
140+ sleep 60
141+ continue
142+ fi
117143
118144 echo " Waiting $VERIFICATION_WAIT_TIME seconds for verification"
119145 sleep $VERIFICATION_WAIT_TIME
You can’t perform that action at this time.
0 commit comments