Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
b2865f2
checkpoint 0
orange-park Jan 9, 2026
49a1b01
Stop tracking local attachments
orange-park Jan 9, 2026
579ad9a
benchmark testing environment
orange-park Jan 12, 2026
63e976b
benchmark prototype
orange-park Jan 16, 2026
ce6299d
benchmark prototype0
orange-park Jan 16, 2026
7073e3f
Merge branch 'main' into contracts_on_stateDB
orange-park Jan 19, 2026
5962d99
benchmark prototype1
orange-park Jan 19, 2026
2fcd0aa
benchmark prototype2
orange-park Jan 21, 2026
67a1756
benchmark prototype3
orange-park Jan 22, 2026
ebdf87e
Merge remote-tracking branch 'origin/main' into contracts_on_stateDB
orange-park Jan 22, 2026
09b909f
sec to ms config
orange-park Jan 23, 2026
a097e07
local-tx issue resolved
orange-park Jan 23, 2026
0ce80fd
ct issue
orange-park Jan 25, 2026
f783e17
LT CT Fixed
orange-park Jan 29, 2026
b0f8321
skewness optimization
orange-park Jan 29, 2026
043e446
feat(benchmark): Add Go benchmark tool and fix thread-safety issues
U0001F3A2 Feb 2, 2026
f46a696
Merge remote-tracking branch 'origin/main' into contracts_on_stateDB
orange-park Feb 5, 2026
f9d4e54
add benchmark folder
U0001F3A2 Feb 5, 2026
1196dce
remove benchmark artifact
U0001F3A2 Feb 5, 2026
3bc6249
feat(benchmark): Add contract call support
U0001F3A2 Feb 5, 2026
352601d
fix(evm): Address code review feedback
U0001F3A2 Feb 5, 2026
829d3ac
refactor(chain): Replace goto with labeled break in queue drain loop
U0001F3A2 Feb 5, 2026
4e5a2c6
feat(benchmark): Add skewness and involved shards configuration
orange-park Feb 6, 2026
9a47edb
fix(benchmark): Guarantee distinct shards in GetBookingContractsForIn…
orange-park Feb 6, 2026
1bfbfee
guarantee distinct shards
orange-park Feb 6, 2026
2d4615c
fix(benchmark): Fix cross-shard E2E latency measurement
orange-park Feb 6, 2026
faaf9e3
feat(benchmark): Complete E2E benchmark workflow optimization (6-12x …
U0001F3A2 Feb 9, 2026
ebe7061
chore: Add benchmark binary to .gitignore
U0001F3A2 Feb 9, 2026
cb9074e
fix(test): Correct address sharding assumption in SetCode test
U0001F3A2 Feb 9, 2026
7d7af25
docs: Add test failures analysis for iteration 4
U0001F3A2 Feb 9, 2026
50c02b0
fix(test): Fix address sharding assumptions in unit tests
U0001F3A2 Feb 9, 2026
4504d98
docs: Complete 5-iteration review with final summary
U0001F3A2 Feb 9, 2026
97df850
fix(benchmark): Apply Zipfian skew to to-addresses and contract selec…
U0001F3A2 Feb 11, 2026
8642db3
fix: Address PR review issues - thread safety, sharding, validation, …
U0001F3A2 Feb 11, 2026
7ee9342
feat(benchmark): Add --involved-shards flag for variable cross-shard …
U0001F3A2 Feb 12, 2026
86287f7
fix(benchmark): Fix CSV export passing totalSubmitted correctly
U0001F3A2 Feb 12, 2026
4f79fab
fix: Add commit_time_ms to orchestrator status for accurate E2E latency
U0001F3A2 Feb 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
151 changes: 151 additions & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
name: Benchmark Regression Testing

on:
pull_request:
branches: [ main, develop ]
push:
branches: [ main, develop ]
workflow_dispatch:

env:
BASELINE_TPS: 1000 # Minimum acceptable TPS
BASELINE_LATENCY_P95: 500 # Maximum acceptable P95 latency (ms)

jobs:
benchmark:
runs-on: ubuntu-latest
timeout-minutes: 20

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
cache: true

- name: Cache storage
id: cache-storage
uses: actions/cache@v4
with:
path: storage/test_statedb
key: storage-${{ hashFiles('contracts/**', 'storage/create_storage.go') }}
restore-keys: |
storage-

- name: Generate storage (if cache miss)
if: steps.cache-storage.outputs.cache-hit != 'true'
run: |
echo "Storage cache miss, generating..."
time go run ./storage/create_storage.go

- name: Build benchmark
run: |
go build -o benchmark ./cmd/benchmark

- name: Start Docker network
run: |
docker compose up --build -d
echo "Waiting for services to be healthy..."
timeout 60s bash -c 'until docker compose ps | grep -q "healthy"; do sleep 2; done' || true
docker compose ps

- name: Run benchmark
id: benchmark
run: |
mkdir -p results
./benchmark \
-duration 10 \
-injection-rate 1000 \
-ct-ratio 0.5 \
-contract-ratio 0.0 \
-csv results/benchmark_ci.csv \
| tee benchmark_output.txt

- name: Parse benchmark results
id: parse
run: |
TPS=$(grep "Actual TPS" benchmark_output.txt | awk '{print $4}')
LATENCY_P95=$(grep "P95:" benchmark_output.txt | awk '{print $2}' | head -1)

echo "tps=${TPS}" >> "$GITHUB_OUTPUT"
echo "latency_p95=${LATENCY_P95}" >> "$GITHUB_OUTPUT"

echo "### Benchmark Results" >> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
echo "- **TPS**: ${TPS}" >> "$GITHUB_STEP_SUMMARY"
echo "- **Latency P95**: ${LATENCY_P95} ms" >> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
echo "Full results saved to \`results/benchmark_ci.csv\`" >> "$GITHUB_STEP_SUMMARY"

- name: Check performance regression
env:
TPS: ${{ steps.parse.outputs.tps }}
LATENCY_P95: ${{ steps.parse.outputs.latency_p95 }}
run: |
echo "Checking performance against baselines..."
echo " TPS: ${TPS} (baseline: ${BASELINE_TPS})"
echo " Latency P95: ${LATENCY_P95}ms (baseline: ${BASELINE_LATENCY_P95}ms)"

TPS_THRESHOLD=$(echo "${BASELINE_TPS} * 0.9" | bc)
if (( $(echo "${TPS} < ${TPS_THRESHOLD}" | bc -l) )); then
echo "::error::Performance regression detected! TPS ${TPS} is below threshold ${TPS_THRESHOLD}"
exit 1
fi

LATENCY_THRESHOLD=$(echo "${BASELINE_LATENCY_P95} * 1.1" | bc)
if (( $(echo "${LATENCY_P95} > ${LATENCY_THRESHOLD}" | bc -l) )); then
echo "::error::Performance regression detected! Latency P95 ${LATENCY_P95}ms exceeds threshold ${LATENCY_THRESHOLD}ms"
exit 1
fi

echo "::notice::Performance check passed ✓"

- name: Upload benchmark results
uses: actions/upload-artifact@v4
if: always()
with:
name: benchmark-results
path: |
results/benchmark_ci.csv
benchmark_output.txt

- name: Docker logs (on failure)
if: failure()
run: |
echo "=== Orchestrator logs ==="
docker compose logs --tail=100 shard-orch
echo ""
echo "=== Shard 0 logs ==="
docker compose logs --tail=100 shard-0

- name: Stop Docker network
if: always()
run: |
docker compose down

unit-tests:
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
cache: true

- name: Run unit tests
run: |
go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...

- name: Upload coverage
uses: codecov/codecov-action@v4
with:
files: ./coverage.txt
fail_ci_if_error: false
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,10 @@ venv/
storage/test_statedb/
storage/*.txt

# Benchmark results
results/

# Assignments
draft-pr.md

benchmark
Loading
Loading