feat: implement dividend snapshot validation, campaign audit trail, IPFS circuit breaker, and multi-sig validation#1192
Merged
Emmyt24 merged 1 commit intoMay 28, 2026
Conversation
…ign audit trail, IPFS circuit breaker, and multi-sig validation Closes Emmyt24#1123, Emmyt24#1124, Emmyt24#1125, Emmyt24#1126 Changes: - (Emmyt24#1123) Add dividend snapshot consistency verification to catch ingestion gaps * New verifySnapshotConsistency() function in dividendService.ts * Admin endpoint: GET /api/dividends/pools/:poolId/consistency * Validates holder balance sum vs expected total supply with 1 unit tolerance - (Emmyt24#1124) Persist campaign state transitions with full audit trail * New CampaignAuditTrail database model to record all state changes * Records from/to status, actor, timestamp, and optional txHash * Endpoint: GET /api/campaigns/:campaignId/audit-trail * Transactional recording of state changes - (Emmyt24#1125) Wrap IPFS/Pinata service calls in circuit breaker * Failure threshold: 5 consecutive failures * Success threshold: 2 consecutive successes to recover * Timeout before retry: 30 seconds * Metrics endpoint: GET /api/admin/operational/circuit-breaker/ipfs * Manual reset endpoint: POST /api/admin/operational/circuit-breaker/ipfs/reset - (Emmyt24#1126) Enforce comprehensive multi-sig threshold validation * Validate threshold is not zero or greater than signer count * Validate no duplicate signers in configuration * New DuplicateSigners error code (86) * Emit configuration events on success All changes include proper error handling, input validation at boundaries, and maintain existing code style and conventions. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
|
@victorisiguzoruzoma874 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.
Summary
Comprehensive feature implementation addressing 4 backend/contract issues:
Implementation Details
#1123 - Dividend Snapshot Consistency
verifySnapshotConsistency()function validates holder balance sumGET /api/dividends/pools/:poolId/consistency#1124 - Campaign Audit Trail
CampaignAuditTraildatabase model for all state transitionsrecordStateTransition(),getAuditTrail()GET /api/campaigns/:campaignId/audit-trailwith pagination#1125 - IPFS Circuit Breaker
GET /api/admin/operational/circuit-breaker/ipfsPOST /api/admin/operational/circuit-breaker/ipfs/reset#1126 - Multi-Sig Validation
DuplicateSigners(86)Test Plan
Notes
Closes #1123
Closes #1124
Closes #1125
Closes #1126