feat: Cache network fee variables in StellarService - #1
Open
Devadakene wants to merge 124 commits into
Open
Conversation
git commit -m Closes
- Add Pino logger imports to auth middleware - Replace console.error with structured logger in auth.ts - Replace console.log/error with structured logger in reconciler service - Add logger to reconciliation script with structured JSON output - All logs now include service name, environment, and ISO timestamps - Sensitive data (API keys, auth headers) automatically redacted by Pino - Logs structured as JSON for easy parsing by log aggregators Fixes: sublime247#1332
- Create accounting retry queue with exponential backoff (60s-10 attempts) - Add accounting retry worker with structured logging - Route failed sync operations to retry queue for manual/scheduled retry - Replace console logs with structured Pino logging in syncWorker - Add event listeners for job completion and failure monitoring - Implement distinction between transient and permanent errors - Transient errors (rate limit, network) auto-retry with backoff - Permanent errors moved to retry queue after exhausting primary attempts - Export retry queue functions and worker in queue index - Update queue shutdown to include retry queue and worker cleanup - Add logger mocking to accounting sync tests - Update test assertions to use mocked logger instead of console spies Key features: - Failed updates retry correctly with exponential backoff - Operators can manually retry operations via retryAccountingOperation() - Queue stats and job inspection available via getAccountingRetryQueueStats() - Structured logging for debugging and monitoring - Conservative 2-concurrency limit to respect API rate limits Fixes sublime247#1312
Add KmsFileSigner to hsmService.ts that signs SHA-256 file digests using AWS KMS asymmetric keys, with automatic signing on upload via s3Upload.ts and signature verification on read paths. Closes sublime247#1286
feat(sep31): implement dynamic fee bump strategy using Horizon base fee
- Strip optional 'sha256=' prefix from incoming signature headers before timing-safe comparison. - Utilize raw request body when available for HMAC verification.
…roduction - Register existing profile command handlers in CLI main entry point - Enables saving, loading, switching, listing, and deleting profiles - Profiles stored in .momo-profiles.json with API URL and key per environment - Active profile selection allows seamless environment switching - Fallback to environment variables or .momorc when no profile is active - No breaking changes to existing configuration system
…7#1310) - Add src/services/providerReconciliationService.ts - ProviderReconciliationService class with runDailySettlement() entry point that: audits the double-entry ledger, aggregates per-provider merchant fees + provider fees from completed transactions, posts two balanced double-entry ledger transactions per provider (merchant fee sweep DR1100/CR4000 and provider fee expense DR5000/CR1100), persists a settlement record, and returns a structured SettlementSummary - getSettlementHistory() and getLatestSettlement() query helpers - Exported as providerReconciliationService singleton - Add src/jobs/dailySettlementJob.ts - runDailySettlementJob() handler; throws on any provider failure so the scheduler logs a fatal error and PagerDuty is notified - Add migrations/20260624_create_provider_settlement_records.sql - provider_settlement_records table with unique constraint on (settlement_date, provider) for idempotent upserts - Indexes on settlement_date, provider, and status - Update src/jobs/scheduler.ts - Register daily-settlement job at 01:00 AM UTC - Schedule overridable via DAILY_SETTLEMENT_CRON env var Closes sublime247#1310
…1273 Closes sublime247#1258, sublime247#1261, sublime247#1273 ## Issue sublime247#1258 - Provider Latency Watchdog and Dynamic Circuit Breaker Tweaking - Created src/services/providerLatencyWatchdog.ts with sliding window latency tracking - Integrated recordProviderLatency() into MobileMoneyService.executeProviderOperation() - Added tripCircuitBreaker() to src/utils/circuitBreaker.ts - Updated all providers to return providerResponseTimeMs consistently ## Issue sublime247#1261 - Automated Callback Retry Queue for Webhooks - Created src/queue/webhookRetryQueue.ts (BullMQ queue with exponential backoff) - Created src/queue/webhookRetryWorker.ts (retry worker) - Integrated retry queue into WebhookService.notifyTransactionWebhook() and notifyFlatTransactionWebhook() - Registered worker in src/index.ts and added to graceful shutdown ## Issue sublime247#1273 - SEP-24 Interactive Deposit and Withdrawal Flow validation - Added token limits (MAX_ACTIVE_TRANSACTIONS_PER_ACCOUNT) in src/stellar/sep24.ts - generateInteractiveUrl() now signs URLs with HMAC-SHA256 via generateSignedSep24Url() - Added GET /sep24/callback/:id endpoint with verifySep24Signature middleware
- Add swagger-ui-react component with Try It Out enabled - New /sandbox route for interactive API testing - Link from API Reference page and navbar - Configurable via API_BASE_URL env var
…s-snapshot-export-entrypoint feat(analytics): add versioned analytics snapshot export
…ool-rebalancing-engine Add atomic LP reserve rebalancer and QuickBooks sales receipt sync
…rovider-settlement-automation Feature/1310 daily provider settlement automation
…l-swagger-sandbox feat(docs-portal): add interactive Swagger UI sandbox page
[MEDIUM] Build Liquidity Pool Rebalancing Engine for Stellar Assets
feat(cli): add telemetry config toggle to momo-cli setup wizard
…l-error-matrix feat(providers): map Vodacom and Tigo transaction codes to global error matrix
…ess-worker-bundle-assets-sizes Issue 1048 compress worker bundle assets sizes
…ount Add VIP Fee Discount Tier logic check
…-1292 Pr issue 1292
…t-coverage Feature/syncworker test coverage
…provider feat: add Wave Senegal mobile money provider (sublime247#1256)
…-callback-ingest Tune performance metric of parsing in the pipeline
…d-sanctions-engine Feature/automated sanctions engine
Log Provider Status Changes on Dashboard
…pliance-ivms101 Feature/webhook compliance ivms101
…ity-tax-config fix: password complexity validation (sublime247#1295) and configurable tax rates (sublime247#1311)
…-image-load-times feat: optimize image load times in docs portal using sharp
…list-middleware feat: add IP blacklist middleware and worker-level IP check
[MEDIUM] Automate API Specs Generation Sync during docs builds
…tions-sync-cron feat(aml): implement periodic sanctions list sync cron (sublime247#1293)
…olver-spans sublime247#1015 Add Datadog APM Tracing for GraphQL Resolvers execution
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.
Description
This PR resolves the issue by caching the network base fee details retrieved from the Horizon client to reduce redundant API calls on startup and during transaction dispatches.
feeCacheand a corresponding TTL parameterFEE_CACHE_TTL_MS(set to 1 minute) instellarService.ts.getNetworkBaseFee()that queries the Horizon client usingthis.server.fetchBaseFee()and stores the result in the cache, returning the cached value if it is still fresh.submitFeeBumpTransaction(),sendPayment(),enableClawback(), andexecuteClawback()to use the cached network fee.Acceptance Criteria Checklist