Repository navigation
docs: verify treasury validation, audit logging, worker sync, and ind… - #859
Open
aetheron06 wants to merge 1 commit into
Open
aetheron06 wants to merge 1 commit into
aetheron06 wants to merge 1 commit into
Conversation
…exing Four issues whose implementations are already present on this branch. Each is recorded in the CHANGELOG "Verified" section, with the files and the tests that already enforce it. Zod request validation for the treasury multisig routes (mergepay#815). src/validations/treasury.ts carries the dedicated schemas the issue asks for: treasuryTxProposalCreateSchema, treasurySignatureSubmitSchema (a strict body that refuses key material), and treasuryXdrSchema. They are parsed at every entry point - src/routes/treasury-multisig.ts, src/routes/treasury-signatures.ts, and src/routes/treasury-proposals.ts - and registered with openApiBody on the two multisig routes so the OpenAPI graph describes the payload. 10 route-level 400 assertions in tests/treasury-multisig-routes.test.ts and 14 schema tests in tests/treasury-multisig-validation.test.ts cover the rejection paths. Audit logging for state-changing group and expense actions (mergepay#817). src/services/audit.ts is the reusable Prisma-backed helper, with auditTx / logActionTx / auditGroupMemberActionTx / auditMultisigActionTx so a record is written in the same transaction as the change it documents. Every payload passes through sanitizeAuditMetadata, which redacts 21 sensitive key names to [REDACTED] by exact, case-insensitive key match and recurses into nested objects and arrays. 61 tests across seven audit suites cover the written, the rejected, and the sanitized cases. Background worker job for stale transaction cleanup and status sync (mergepay#814). src/worker/index.ts runs syncPendingTransactionStatuses and cleanupChallenges in the cycle loop through runCycleTask, so each gets the shared retry budget, the heartbeat, and the dead-letter audit record. The cycle also recovers stale leases and expires stale treasury proposals. 15 tests in tests/worker/tx-status-sync.test.ts and 2 in tests/cleanup-challenges.test.ts cover the task logic and the "one bad row does not stop the batch" guarantee. Database indexing and query optimization for group expense history (mergepay#811). prisma/schema.prisma declares 63 @@index blocks, and the dedicated index migrations carry the matching CREATE INDEX statements - including the compound expenses(group_id, created_at, id) that backs the shared (createdAt, id) cursor the expense and settlement-history services order by, so pagination is served by an index rather than a sort. Closes mergepay#815 Closes mergepay#817 Closes mergepay#814 Closes mergepay#811 Verification: npm test 4252 passed / 22 skipped across 207 files, npm run build clean, npm run lint 0 errors (32 pre-existing warnings, unchanged).
|
@aetheron06 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! 🚀 |
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.
…exing
Four issues whose implementations are already present on this branch. Each is recorded in the CHANGELOG "Verified" section, with the files and the tests that already enforce it.
Zod request validation for the treasury multisig routes (#815). src/validations/treasury.ts carries the dedicated schemas the issue asks for: treasuryTxProposalCreateSchema, treasurySignatureSubmitSchema (a strict body that refuses key material), and treasuryXdrSchema. They are parsed at every entry point - src/routes/treasury-multisig.ts, src/routes/treasury-signatures.ts, and src/routes/treasury-proposals.ts
Audit logging for state-changing group and expense actions (#817). src/services/audit.ts is the reusable Prisma-backed helper, with auditTx / logActionTx / auditGroupMemberActionTx / auditMultisigActionTx so a record is written in the same transaction as the change it documents. Every payload passes through sanitizeAuditMetadata, which redacts 21 sensitive key names to [REDACTED] by exact, case-insensitive key match and recurses into nested objects and arrays. 61 tests across seven audit suites cover the written, the rejected, and the sanitized cases.
Background worker job for stale transaction cleanup and status sync (#814). src/worker/index.ts runs syncPendingTransactionStatuses and cleanupChallenges in the cycle loop through runCycleTask, so each gets the shared retry budget, the heartbeat, and the dead-letter audit record. The cycle also recovers stale leases and expires stale treasury proposals. 15 tests in tests/worker/tx-status-sync.test.ts and 2 in tests/cleanup-challenges.test.ts cover the task logic and the "one bad row does not stop the batch" guarantee.
Database indexing and query optimization for group expense history (#811). prisma/schema.prisma declares 63 @@index blocks, and the dedicated index migrations carry the matching CREATE INDEX statements - including the compound expenses(group_id, created_at, id) that backs the shared (createdAt, id) cursor the expense and settlement-history services order by, so pagination is served by an index rather than a sort.
Closes #815
Closes #817
Closes #814
Closes #811