Skip to content

docs: verify treasury validation, audit logging, worker sync, and ind… - #859

Open
aetheron06 wants to merge 1 commit into
mergepay:mainfrom
aetheron06:docs/verify-815-817-814-811
Open

aetheron06 wants to merge 1 commit into
mergepay:mainfrom
aetheron06:docs/verify-815-817-814-811

Conversation

@aetheron06

Copy link
Copy Markdown
Contributor

…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

  • 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 (#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

…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).
@drips-wave

drips-wave Bot commented Oct 20, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants