Repository navigation
test(rewards): add soak and concurrency stress test for double-spend detection - #102
Open
Ranjeet2063 wants to merge 1 commit into
Open
Ranjeet2063 wants to merge 1 commit into
Ranjeet2063 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Ranjeet2063
force-pushed
the
test/reward-concurrency-soak-82
branch
from
November 10, 2026 09:14
146efef to
228bc65
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Without a comprehensive load/soak stress test, the proof approval and reward payout pipeline cannot be systematically verified against race conditions, process crashes, or network dropouts that could risk duplicate on-chain Stellar transactions or duplicate
RewardPayoutrecords (#82).Solution
This PR adds a dedicated soak and concurrency stress testing suite to
tests/integration/proof-to-reward.test.tswith controllable failure injections and automated invariant query verification:High-Throughput Concurrency Simulation:
Controllable Failure Injections:
PROCESSINGstate, verifying that the sweeper recovers stale rows without duplicating transactions upon retry.Automated Invariant Queries:
proofIdacross all injected failures (duplicateOnChainPayments.length === 0).PAIDstatus rows inRewardPayouttable (duplicatePaidRows.length === 0).PROCESSINGrows remaining after sweep and drainage.sum(paid amounts) === sum(approved proof reward amounts)).Verification
npx jest tests/integration/proof-to-reward.test.ts: 5/5 tests passed 100% green.npx eslint tests/integration/proof-to-reward.test.ts: 0 errors, 0 warnings.npx prettier --check tests/integration/proof-to-reward.test.ts: 100% compliant.Closes #82