Repository navigation
Conversation
|
@PHADAR6 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
9311105 to
a17fd96
Compare
|
@PHADAR6 Our automated scan matched code from the PolinRider malware campaign, which steals developer credentials (GitHub, npm, wallets) and spreads through infected repositories:
What to do:
The PR will be re-scanned automatically and can be merged once it is clean. |
a17fd96 to
9bf6ea2
Compare
Strips the payload this branch picked up (deleted api.js, truncated eslint.config.js, unhooked package.json). No functional change to the branch's own work.
|
@PHADAR6 Our automated scan matched code from the PolinRider malware campaign, which steals developer credentials (GitHub, npm, wallets) and spreads through infected repositories:
What to do:
The PR will be re-scanned automatically and can be merged once it is clean. |
- removed branch_structure.json (payload path) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This issue was resolved by the wrong person. I'm the one who this issue was assigned to but this PR is already linked to the issue, it should be deleted. A fix for this issue can be found in #1551 |
|
This PR came from a machine infected with the PolinRider malware. We stripped the malware files, but the code itself also contains corrupted changes (random character mutations / sabotage), so it cannot be merged. Found in |
|
Skipping this PR: it still contains deliberately corrupted code and cannot be merged. The migration SQL is broken:
These are the same character-mutation patterns found in the earlier version of this PR. Your machine appears to be infected with malware that modifies code before you push. Before contributing again, clean your machine: scan for and remove the malware, rotate your GitHub tokens and SSH keys, and audit your git hooks and global git config. Then open a fresh PR from a clean clone and check every line of the diff by hand. |
1a4dc98 to
0c935d6
Compare
|
Warning Possible malicious code: please review before merging. An automated security scan flagged files in this pull request that appear to contain malicious code. Code like this can run automatically when a project is opened in an editor or its dependencies are installed, so it could compromise the machine of anyone who checks out this branch. Automated scans can be wrong, so this may be a false positive. Maintainers: please review the flagged files carefully before merging, on GitHub in your browser rather than by checking out the branch. The malicious part is often hidden far off to the right of an ordinary-looking line, so scroll sideways through each file. @PHADAR6: this pull request adds or changes these files, possibly without your knowledge. Malware like this spreads by adding itself to repositories on machines it has infected, so your machine might be compromised. Please undo these changes in this pull request, and don't open or run other projects on that machine until you've checked it. Flagged files at commit Only merge once you're confident these files are safe. ℹ️ Posted automatically by Drips Wave. Questions? Contact support@drips.network. |
Overview
This PR makes revenue settlement batches crash-safe and multi-instance safe by introducing an atomic claim step before payout, an outbox-style status machine (
claimed→submitted→completed/failed), and strict settlement bookkeeping. Each ledger row is linked to at most one non-failed settlement, a real payout hash is never erased, and events from terminal failures are released back to the unsettled pool so they are eventually paid exactly once.Related Issue
Changes
🔒 Atomic claim before payout
[MODIFY]
src/services/usageStore.tsmarkAsSettledis now strict: it throws when the settlement is missing, guards the update onsettlement_id IS NULL OR settlement_id = $1, and throws when the updated row count differs from the number of event ids (rolling back the transaction).FOR UPDATE SKIP LOCKED,WHERE settlement_id IS NULL), with the payout amount derived from the rows actually claimed.[ADD]
migrations/0027_settlement_claim_outbox.sqlclaimed,submitted,completed,failed.[ADD]
migrations/0027_settlement_claim_outbox.down.sql🧪 Tests
[MODIFY]
src/services/usageStore.test.tsmarkAsSettled: missing settlement throws, row-count mismatch throws and rolls back, guarded overwrite behaviour.[MODIFY]
src/__tests__/revenueSettlementService.test.tsState machine
At-most-once argument
A ledger row can only be linked to a settlement via the guarded claim (
settlement_id IS NULL), and the partial unique index prevents two non-failed settlements from referencing the same row. Claiming happens inside one short transaction that commits before any RPC call, so row locks are never held across the payout. A crash after claim but before payout leaves aclaimedsettlement with no hash, which the sweeper releases; a crash after the hash is persisted leaves asubmittedsettlement that reconciliation advances. Because a real payout hash is never cleared, a local failure after payout cannot cause the events to be re-claimed and paid again.Verification Results
stellar_tx_hashon a settlement that has oneclearTxHashpath removed; hash persisted onsubmittedrevenueSettlementService.test.tsandusageStore.test.tsnpm run db:check-migrationspasses0027up/down addednpm run lint,npm run typecheck,npm run build,npm testpassrunBatchOnce,reconcilePendingSettlementsOnce,markAsSettledCloses #1490