Created
December 5, 2025 22:05
-
-
Save jcstein/1c931501c7a136580363ce6928467b8d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # Bash-only Celestia blob submit load tester. | |
| # Usage: COUNT=100 NS=0x676d DATA=0x676d CMD="celestia blob submit" ./celestia_blob_bench.sh | |
| set -euo pipefail | |
| COUNT=${COUNT:-20} | |
| CMD=${CMD:-"celestia blob submit"} | |
| NS=${NS:-"0x676d"} | |
| DATA=${DATA:-"0x676d"} | |
| printf "Running %s submissions: %s %s %s\n" "$COUNT" "$CMD" "$NS" "$DATA" | |
| ok=0 | |
| fail=0 | |
| times=() | |
| has_jq=1 | |
| if ! command -v jq >/dev/null 2>&1; then | |
| has_jq=0 | |
| echo "Note: jq not found; height/commitment parsing skipped." >&2 | |
| fi | |
| for i in $(seq 1 "$COUNT"); do | |
| start_ns=$(date +%s%N) | |
| out=$($CMD "$NS" "$DATA" 2>&1) || rc=$? | |
| end_ns=$(date +%s%N) | |
| dur_ms=$(( (end_ns - start_ns) / 1000000 )) | |
| rc=${rc:-0} | |
| if [ "$rc" -eq 0 ]; then | |
| ok=$((ok + 1)) | |
| times+=("$dur_ms") | |
| if [ "$has_jq" -eq 1 ]; then | |
| height=$(echo "$out" | jq -r '(.result.height // .height // "-")') | |
| commitment=$(echo "$out" | jq -r '(.result.commitments[0] // .commitments[0] // "-")') | |
| else | |
| height="-" | |
| commitment="-" | |
| fi | |
| printf "[%03d] ok %7.2f ms | height=%s | commitment=%s\n" "$i" "$dur_ms" "$height" "$commitment" | |
| else | |
| fail=$((fail + 1)) | |
| printf "[%03d] fail %7.2f ms | rc=%s | %s\n" "$i" "$dur_ms" "$rc" "$out" | |
| fi | |
| unset rc | |
| done | |
| if [ "${#times[@]}" -gt 0 ]; then | |
| sum=0 | |
| min=${times[0]} | |
| max=${times[0]} | |
| for t in "${times[@]}"; do | |
| sum=$((sum + t)) | |
| (( t < min )) && min=$t | |
| (( t > max )) && max=$t | |
| done | |
| avg=$(printf "%s\n" "${times[@]}" | awk '{s+=$1; c++} END {if(c>0) printf "%.2f", s/c; else print "0"}') | |
| printf "\nSummary: total=%s ok=%s fail=%s\n" "$COUNT" "$ok" "$fail" | |
| printf "Durations (ms): avg=%s min=%s max=%s\n" "$avg" "$min" "$max" | |
| else | |
| printf "\nSummary: total=%s ok=%s fail=%s (no successes to compute stats)\n" "$COUNT" "$ok" "$fail" | |
| fi |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Latency Summary (grpc-mocha.pops.one vs full.consensus.mocha-4)
grpc-mocha.pops.one
full.consensus.mocha-4
Comparison
Bottom Line
Both endpoints perform similarly, but full.consensus.mocha-4 is marginally faster while grpc-mocha.pops.one is slightly more stable.