Skip to content

Add a soak/concurrency test for the reward-payout + verification pipeline (double-spend detection) #82

Description

@cybermax4200

Why this matters now: Complements #2/#20 — without a stress test, the financial-safety fixes cannot be proven or kept safe.

Problem / What: No load/soak test exists that hammers proof approval + reward payout with process restarts and forced shutdowns to detect duplicate on-chain payments or duplicate RewardPayout rows.

Key Challenges: Driving enough throughput with controllable failure injection (kill worker mid-payout, drop Redis, drop Postgres) and asserting global invariants (one txHash per proofId, sum of payouts == sum of approved rewards).

Acceptance Criteria:

  • A soak test in CI (or a documented manual harness) asserts zero duplicate payouts across injected failures.
  • Invariants are checked by a query, not by manual inspection.

Relevant files/functions: tests/integration/proof-to-reward.test.ts, src/workers/rewardWorker.ts, src/services/rewardPayoutSweeper.ts.

Out of scope: Full chaos-engineering platform.

Labels: advanced, testing, reliability, security

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions