fix(deployment): parse cast send receipts and extend RPC timeouts for LINK ops
Some checks failed
CI/CD Pipeline / Solidity Contracts (push) Failing after 1m8s
CI/CD Pipeline / Lint and Format (push) Failing after 1m8s
CI/CD Pipeline / Terraform Validation (push) Failing after 25s
CI/CD Pipeline / Kubernetes Validation (push) Successful in 26s
CI/CD Pipeline / Security Scanning (push) Successful in 3m5s
Deploy ChainID 138 / Deploy ChainID 138 (push) Failing after 51s
HYBX OMNL TypeScript & anchor / token-aggregation build + reconcile artifact (push) Failing after 58s
OMNL reconcile anchor / Run omnl:reconcile and upload artifacts (push) Failing after 30s
Validation / validate-genesis (push) Successful in 27s
Validation / validate-kubernetes (push) Failing after 9s
Validation / validate-smart-contracts (push) Failing after 8s
Validation / validate-terraform (push) Failing after 44s
Validation / validate-documentation (push) Failing after 18s
Validation / validate-security (push) Failing after 2m14s
Verify Deployment / Verify Deployment (push) Failing after 51s

Cast can exit 0 on mined reverts; classify receipt output so operators see
failures. Add cast --timeout/--rpc-timeout on mainnet and L2 LINK transfers.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
defiQUG
2026-05-11 15:23:05 -07:00
parent 21578e1a13
commit 0561d26bcd
2 changed files with 50 additions and 10 deletions

View File

@@ -75,15 +75,34 @@ fi
# If a selector is missing, bridge.calculateFee / ccipSend revert with CCIPRouter: chain not supported.
CCIP_ROUTER="${CCIP_ROUTER:-}"
# cast send often exits 0 even when the receipt shows status 0 (revert). Parse human receipt output.
report_cast_send_result() {
local _out="$1"
if echo "$_out" | grep -qE 'status[[:space:]]+0[[:space:]]+\(failed\)'; then
log_warn " On-chain revert (mined, status=0)"
echo " $_out" >&2
elif echo "$_out" | grep -qE 'status[[:space:]]+1[[:space:]]+\(success\)'; then
log_success " OK (mined)"
[[ -n "$_out" ]] && echo " $_out"
elif echo "$_out" | grep -qiE 'Error:|revert|Failed|timeout|null response|invalid nonce'; then
log_warn " RPC / client failure (non-fatal)"
echo " $_out" >&2
elif echo "$_out" | grep -q 'transactionHash'; then
log_success " OK (submitted; verify receipt if status line missing)"
[[ -n "$_out" ]] && echo " $_out"
else
log_warn " Ambiguous cast output (non-fatal)"
echo " $_out" >&2
fi
}
run_or_echo() {
if [[ "$DRY_RUN" = "1" ]]; then
echo " [DRY RUN] $*"
else
# With set -e, _out=$(eval ...) would exit the whole script on failure; use if to absorb it.
local _out
if _out=$(eval "$*" 2>&1); then
log_success " OK"
[[ -n "$_out" ]] && echo " $_out"
report_cast_send_result "$_out"
else
log_warn " Failed (non-fatal)"
echo " $_out" >&2

View File

@@ -16,14 +16,33 @@ parse_link_tags "$@"
[[ -f "$SCRIPT_DIR/../lib/infura.sh" ]] && source "$SCRIPT_DIR/../lib/infura.sh" 2>/dev/null || true
[[ -n "${PRIVATE_KEY:-}" && ! "$PRIVATE_KEY" =~ ^0x ]] && PRIVATE_KEY="0x$PRIVATE_KEY"
report_cast_send_result() {
local _out="$1"
if echo "$_out" | grep -qE 'status[[:space:]]+0[[:space:]]+\(failed\)'; then
echo " On-chain revert (mined, status=0)" >&2
echo " $_out" >&2
elif echo "$_out" | grep -qE 'status[[:space:]]+1[[:space:]]+\(success\)'; then
echo " OK (mined)"
[[ -n "$_out" ]] && echo " $_out"
elif echo "$_out" | grep -qiE 'Error:|revert|Failed|timeout|null response|invalid nonce'; then
echo " RPC / client failure (non-fatal)" >&2
echo " $_out" >&2
elif echo "$_out" | grep -q 'transactionHash'; then
echo " OK (submitted)"
[[ -n "$_out" ]] && echo " $_out"
else
echo " Ambiguous cast output (non-fatal)" >&2
echo " $_out" >&2
fi
}
run_or_echo() {
if [[ "${DRY_RUN:-0}" = "1" ]]; then
echo " [DRY RUN] $*"
else
local _out
if _out=$(eval "$*" 2>&1); then
echo " OK"
[[ -n "$_out" ]] && echo " $_out"
report_cast_send_result "$_out"
else
echo " Failed (non-fatal)" >&2
echo " $_out" >&2
@@ -76,7 +95,7 @@ if [[ -n "${RPC_URL_138:-}" && -n "${LINK_TOKEN_CHAIN138:-${LINK_TOKEN:-}}" ]];
link="${link,,}"
rpc=$(ensure_rpc "$RPC_URL_138")
echo "Chain 138 (RPC: ${rpc%%\?*}...)"
_gas138="--legacy --gas-limit 250000 --gas-price 2000000000"
_gas138="--legacy --gas-limit 250000 --gas-price 2000000000 --timeout 120"
if [[ -n "${CCIPWETH9_BRIDGE_CHAIN138:-}" ]]; then
if has_sufficient_link "$link" "$DEPLOYER_ADDR" "$rpc" "$LINK_AMOUNT_WEI"; then
run_or_echo "cast send $link \"transfer(address,uint256)\" ${CCIPWETH9_BRIDGE_CHAIN138,,} $LINK_AMOUNT_WEI --rpc-url \"$rpc\" --private-key \"\$PRIVATE_KEY\" $_gas138"
@@ -99,16 +118,17 @@ if [[ -n "${ETHEREUM_MAINNET_RPC:-}" && -n "${MAINNET_LINK_TOKEN:-${CCIP_ETH_LIN
link="${MAINNET_LINK_TOKEN:-$CCIP_ETH_LINK_TOKEN}"
rpc=$(ensure_rpc "$ETHEREUM_MAINNET_RPC")
echo "Ethereum Mainnet"
_pub_timeout="--timeout 300 --rpc-timeout 120"
if [[ -n "${MAINNET_CCIP_WETH9_BRIDGE:-}" ]]; then
if has_sufficient_link "$link" "$DEPLOYER_ADDR" "$rpc" "$LINK_AMOUNT_WEI"; then
run_or_echo "cast send $link \"transfer(address,uint256)\" $MAINNET_CCIP_WETH9_BRIDGE $LINK_AMOUNT_WEI --rpc-url \"$rpc\" --private-key \"\$PRIVATE_KEY\" --legacy"
run_or_echo "cast send $link \"transfer(address,uint256)\" $MAINNET_CCIP_WETH9_BRIDGE $LINK_AMOUNT_WEI --rpc-url \"$rpc\" --private-key \"\$PRIVATE_KEY\" --legacy $_pub_timeout"
else
print_skip "ETH/WETH9" "$link" "$DEPLOYER_ADDR" "$rpc" "$LINK_AMOUNT_WEI"
fi
fi
if [[ -n "${MAINNET_CCIP_WETH10_BRIDGE:-}" ]]; then
if has_sufficient_link "$link" "$DEPLOYER_ADDR" "$rpc" "$LINK_AMOUNT_WEI"; then
run_or_echo "cast send $link \"transfer(address,uint256)\" $MAINNET_CCIP_WETH10_BRIDGE $LINK_AMOUNT_WEI --rpc-url \"$rpc\" --private-key \"\$PRIVATE_KEY\" --legacy"
run_or_echo "cast send $link \"transfer(address,uint256)\" $MAINNET_CCIP_WETH10_BRIDGE $LINK_AMOUNT_WEI --rpc-url \"$rpc\" --private-key \"\$PRIVATE_KEY\" --legacy $_pub_timeout"
else
print_skip "ETH/WETH10" "$link" "$DEPLOYER_ADDR" "$rpc" "$LINK_AMOUNT_WEI"
fi
@@ -142,16 +162,17 @@ for label in BSC POLYGON BASE OPTIMISM ARBITRUM AVALANCHE CRONOS GNOSIS CELO WEM
[[ -z "$addr9" && -z "$addr10" ]] && continue
echo "$label"
_pub_timeout_loop="--timeout 300 --rpc-timeout 120"
if [[ -n "$addr9" ]]; then
if has_sufficient_link "$link" "$DEPLOYER_ADDR" "$rpc" "$LINK_AMOUNT_WEI"; then
run_or_echo "cast send ${link,,} \"transfer(address,uint256)\" ${addr9,,} $LINK_AMOUNT_WEI --rpc-url \"$rpc\" --private-key \"\$PRIVATE_KEY\" --legacy"
run_or_echo "cast send ${link,,} \"transfer(address,uint256)\" ${addr9,,} $LINK_AMOUNT_WEI --rpc-url \"$rpc\" --private-key \"\$PRIVATE_KEY\" --legacy $_pub_timeout_loop"
else
print_skip "$label/WETH9" "$link" "$DEPLOYER_ADDR" "$rpc" "$LINK_AMOUNT_WEI"
fi
fi
if [[ -n "$addr10" ]]; then
if has_sufficient_link "$link" "$DEPLOYER_ADDR" "$rpc" "$LINK_AMOUNT_WEI"; then
run_or_echo "cast send ${link,,} \"transfer(address,uint256)\" ${addr10,,} $LINK_AMOUNT_WEI --rpc-url \"$rpc\" --private-key \"\$PRIVATE_KEY\" --legacy"
run_or_echo "cast send ${link,,} \"transfer(address,uint256)\" ${addr10,,} $LINK_AMOUNT_WEI --rpc-url \"$rpc\" --private-key \"\$PRIVATE_KEY\" --legacy $_pub_timeout_loop"
else
print_skip "$label/WETH10" "$link" "$DEPLOYER_ADDR" "$rpc" "$LINK_AMOUNT_WEI"
fi