feat: gas optimization, key rotation, liquidity dashboard, fee bump recovery - #529
Merged
Conversation
…ecovery - Soroban Contract Gas Optimization (Pidoko257#366): New sorobanGasAnalyzer service with recordGasBenchmark (stores per-operation gas metrics), getGasBenchmarks (aggregated percentiles p50/p95/p99), and analyzeGasOptimizations (auto-detects high gas, moderate gas, and high-variance operations with priority recommendations). 4 tests passing. - Cryptographic Key Rotation Scheduling (Pidoko257#365): New keyRotationService with registerKey (configurable rotation interval, default 90 days), rotateKey (atomic key swap with multi-active-key rotation window), scheduled rotation job detecting expired/emergency keys, age-based alert system (warning at 14d, critical at 3d), full audit trail via key_rotation_events table, and zero-downtime rotation via status transitions (active → rotating → active). - Liquidity Monitoring Dashboard (Pidoko257#363): New liquidityDashboardService with getLiquidityStatus (real-time provider/asset liquidity with health scores), getLiquidityTrends (7-day historical trending with depletion projections), checkLowLiquidityAlerts (configurable warning/critical thresholds), and EventEmitter-based WebSocket subscription for real-time dashboard updates. - SEP-31 Fee Bump Recovery (Pidoko257#364): New feeBumpRecoveryService with state machine (pending → submitting → submitted → confirmed), exponential backoff retry (base 5s, max 5min, configurable), dead letter queue for unrecoverable failures (sequence mismatch, insufficient balance, max retries exceeded), manual admin retry endpoint, and recovery stats with success rate monitoring. 6 tests passing. Closes Pidoko257#366 Closes Pidoko257#365 Closes Pidoko257#363 Closes Pidoko257#364
|
@levoski1 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
Addresses 4 issues: Soroban gas optimization analysis, automated HSM key rotation scheduling, real-time liquidity monitoring dashboard, and SEP-31 fee bump recovery with retry logic.
Changes
Soroban Contract Gas Optimization (#366)
src/services/sorobanGasAnalyzer.tswithrecordGasBenchmark()storing per-operation gas metricsgetGasBenchmarks()returns aggregated statistics with p50/p95/p99 percentilesanalyzeGasOptimizations()auto-detects high gas (>10M), moderate gas (>5M), and high-variance (p99 > 3x avg) operationsCryptographic Key Rotation Scheduling (#365)
src/services/keyRotationService.tswithregisterKey()supporting configurable rotation intervals (default 90 days)rotateKey()performs atomic key swap with multi-active-key rotation window (active → rotating → active)key_rotation_eventstable with source tracking (scheduled/manual/emergency)Liquidity Monitoring Dashboard (#363)
src/services/liquidityDashboardService.tswithgetLiquidityStatus()returning real-time provider/asset liquidity with health scoresgetLiquidityTrends()provides 7-day historical trending with depletion rate projectionscheckLowLiquidityAlerts()with configurable warning/critical thresholds per assetSEP-31 Fee Bump Recovery (#364)
src/services/feeBumpRecoveryService.tswith state machine (pending → submitting → submitted → confirmed)getFeeBumpRecoveryStats())Closes #366
Closes #365
Closes #363
Closes #364