Skip to content

feat: implement #492 - Link successor key versions on rotation - #631

Closed
sommy92 wants to merge 2 commits into
mux-labs:stagingfrom
sommy92:somzilla_issues
Closed

feat: implement #492 - Link successor key versions on rotation#631
sommy92 wants to merge 2 commits into
mux-labs:stagingfrom
sommy92:somzilla_issues

Conversation

@sommy92

@sommy92 sommy92 commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

This PR
Closes #492

  • Added keyVersion support to GenerateKeyRequest interface
  • generateKey now uses request.keyVersion ?? 1 instead of hardcoded 1
  • rotateKey derives keyVersion = predecessor.keyVersion + 1 and passes it to generateKey
  • Successor wallet is created with explicit keyVersion from generated key material
  • Added missing EventEmitter2 and RequestContextService DI injection
  • Added event emissions for key.generated and key.signed events
  • Fixed EventEmitterModule import in KeyManagementModule
  • Added KeyValidationCacheService to module providers
  • Updated unit tests with key version linking test
  • Added keyVersion to mock data in test fixtures

- Added keyVersion support to GenerateKeyRequest interface
- generateKey now uses request.keyVersion ?? 1 instead of hardcoded 1
- rotateKey derives keyVersion = predecessor.keyVersion + 1 and passes it to generateKey
- Successor wallet is created with explicit keyVersion from generated key material
- Added missing EventEmitter2 and RequestContextService DI injection
- Added event emissions for key.generated and key.signed events
- Fixed EventEmitterModule import in KeyManagementModule
- Added KeyValidationCacheService to module providers
- Updated unit tests with key version linking test
- Added keyVersion to mock data in test fixtures
@drips-wave

drips-wave Bot commented Jul 25, 2026

Copy link
Copy Markdown

@sommy92 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

Issue #493: Clear private keys from orchestrator API responses
- Added ResponseRedactionInterceptor to globally redact sensitive fields
  (privateKey, encryptedSecret, apiKey, token, etc.) from all API responses
- Recursively scans nested objects and arrays for sensitive patterns
- Added comprehensive unit tests (10 tests)

Issue #495: Add request id propagation across services
- Added RequestIdInterceptor to ensure every HTTP request has a unique
  x-request-id header propagated via AsyncLocalStorage/RequestContextService
- Interceptor reads from header or generates UUID, sets response header,
  and bootstraps into context for downstream services
- Added comprehensive unit tests (4 tests)

Issue #707: Idempotent settlement on duplicate tradeId
- Added Settlement Prisma model with unique tradeId constraint
- Created SettlementModule with service and controller for idempotent
  settlement processing using tradeId as idempotency key
- Service handles race conditions (P2002) with cache fallback + direct DB lookup
- Added comprehensive unit tests (9 tests)

Misc:
- Updated Wallet model with sentSettlements/receivedSettlements relations
- Registered global interceptors (RequestIdInterceptor, ResponseRedactionInterceptor)
  and SettlementModule in AppModule
@sommy92 sommy92 closed this by deleting the head repository Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Link successor key versions on rotation

1 participant