Skip to content
25 changes: 18 additions & 7 deletions alerts/sender_with_alert.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,17 @@ function send_slack_message() {
while true
do

## Remove Proof Data
rm -rf ./scripts/test_files/gnark_groth16_bn254_infinite_script/infinite_proofs/*
rm -rf ./aligned_verification_data/*

mkdir -p ./scripts/test_files/gnark_groth16_bn254_infinite_script/infinite_proofs

## Generate Proof
nonce=$(aligned get-user-nonce --batcher_url $BATCHER_URL --user_addr $SENDER_ADDRESS 2>&1 | awk '{print $9}')
if ! [[ "$nonce" =~ ^[0-9]+$ ]]; then
echo "Failed getting user nonce, exiting"
exit 1
fi

x=$((nonce + 1)) # So we don't have any issues with nonce = 0
echo "Generating proof $x != 0"
echo "Generating proof $x != 0, nonce: $nonce"
go run ./scripts/test_files/gnark_groth16_bn254_infinite_script/cmd/main.go $x

## Send Proof
Expand All @@ -114,6 +115,16 @@ do
2>&1)

echo "$submit"

submit_errors=$(echo "$submit" | grep -oE 'ERROR[^]]*]([^[]*)' | sed 's/^[^]]*]//;s/[[:space:]]*$//')

# Loop through each error found and print with the custom message
while IFS= read -r error; do
if [[ -n "$error" ]]; then
slack_error_message="Error submitting proof to $NETWORK: $error"
send_slack_message "$slack_error_message"
fi
done <<< "$submit_errors"

echo "Waiting $VERIFICATION_WAIT_TIME seconds for verification"
sleep $VERIFICATION_WAIT_TIME
Expand Down Expand Up @@ -164,7 +175,7 @@ do
spent_amount_usd=$(echo "$spent_amount * $eth_usd" | bc | awk '{printf "%.2f", $1}')

slack_messsage=""
verified=1
verified=0

## Verify Proofs
echo "Verifying $REPETITIONS proofs $x != 0"
Expand All @@ -181,9 +192,9 @@ do
message="Proof verification failed for $proof [ ${batch_explorer_urls[@]} ]"
echo "$message"
send_pagerduty_alert "$message"
verified=0 # Some proofs failed, so we should not send the success message
break
elif echo "$verification" | grep -q verified; then
((verified++))
echo "Proof verification succeeded for $proof"
fi
done
Expand Down
2 changes: 1 addition & 1 deletion batcher/aligned-sdk/src/sdk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ pub fn get_payment_service_address(network: Network) -> ethers::types::H160 {

pub fn get_aligned_service_manager_address(network: Network) -> ethers::types::H160 {
match network {
Network::Devnet => H160::from_str("0x1613beB3B2C4f22Ee086B2b38C1476A3cE7f78E8").unwrap(),
Network::Devnet => H160::from_str("0x851356ae760d987E095750cCeb3bC6014560891C").unwrap(),
Network::Holesky => H160::from_str("0x58F280BeBE9B34c9939C3C39e0890C81f163B623").unwrap(),
Network::HoleskyStage => {
H160::from_str("0x9C5231FC88059C086Ea95712d105A2026048c39B").unwrap()
Expand Down
Loading