Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
60 changes: 60 additions & 0 deletions .github/workflows/legacy-seven-validator-fanout.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Legacy 7-Validator Mempool Fanout Diagnostic

on:
pull_request:
paths:
- '.github/workflows/legacy-seven-validator-fanout.yml'
- 'internal/api/performance_lab_test.go'
- 'internal/api/peer_sync.go'
- 'internal/api/server.go'
- 'internal/api/peer_transport.go'
workflow_dispatch:

permissions:
contents: read

concurrency:
group: legacy-fanout-${{ github.ref }}
cancel-in-progress: true

jobs:
strict-fanout-stress:
name: Strict 3s mempool convergence (20 repeats, race)
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
cache: false
- name: Record precise runner and commit
shell: bash
run: |
set -euo pipefail
mkdir -p evidence
{
echo "commit=$GITHUB_SHA"
echo "run_id=$GITHUB_RUN_ID"
echo "runner_os=$RUNNER_OS"
echo "runner_arch=$RUNNER_ARCH"
echo "cpu_count=$(nproc)"
echo "go_version=$(go version)"
echo "topology=seven-in-process-legacy-httptest-validators-one-GitHub-runner"
echo "acceptance=24-tx-on-all-seven-within-original-3s-no-timeout-change"
} > evidence/environment.txt
- name: Repeat strict mempool lab with race instrumentation
shell: bash
run: |
set -euo pipefail
go test -race ./internal/api \
-run '^TestLabSevenValidatorsCertifiedFinality$' \
-count=20 -timeout=14m -v 2>&1 | tee evidence/fanout-stress.log
- name: Upload strict diagnostics even on failure
if: always()
uses: actions/upload-artifact@v6
with:
name: legacy-fanout-${{ github.sha }}-${{ github.run_attempt }}
path: evidence/
if-no-files-found: warn
retention-days: 30
23 changes: 20 additions & 3 deletions internal/api/performance_lab_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ type labNode struct {
}

type labCluster struct {
tb testing.TB
nodes []*labNode
tb testing.TB
nodes []*labNode
lastSubmitted []string
}

type labFaultTransport struct {
Expand Down Expand Up @@ -200,6 +201,10 @@ func (c *labCluster) submitTransactions(transactions []tx.Envelope, workers int)
if len(transactions) == 0 {
return
}
c.lastSubmitted = c.lastSubmitted[:0]
for _, envelope := range transactions {
c.lastSubmitted = append(c.lastSubmitted, tx.ID(envelope))
}
if workers <= 0 {
workers = 1
}
Expand Down Expand Up @@ -266,7 +271,19 @@ func (c *labCluster) waitForMempools(size int, timeout time.Duration) {
for _, node := range c.nodes {
counts = append(counts, node.server.ledger.MempoolSize())
}
c.tb.Fatalf("mempools did not converge to %d before timeout: %v", size, counts)
missing := make(map[int][]string, len(c.nodes))
for index, node := range c.nodes {
seen := make(map[string]struct{})
for _, entry := range node.server.ledger.Snapshot().Mempool {
seen[entry.ID] = struct{}{}
}
for _, id := range c.lastSubmitted {
if _, found := seen[id]; !found {
missing[index] = append(missing[index], id)
}
}
}
c.tb.Fatalf("mempools did not converge to %d before timeout: counts=%v missingTxIDsByNode=%v", size, counts, missing)
}

func (c *labCluster) driveUntilHeight(indices []int, height uint64, timeout time.Duration) time.Duration {
Expand Down
Loading