Skip to content

feat: Circuit integrity, wallet monitor, XDR decoder & tx monitor - #1109

Merged
ayomideadeniran merged 2 commits into
SoroLabs:mainfrom
Dev-sandy1:feat/issue-1061-1062-1063-1077
Aug 27, 2026
Merged

feat: Circuit integrity, wallet monitor, XDR decoder & tx monitor#1109
ayomideadeniran merged 2 commits into
SoroLabs:mainfrom
Dev-sandy1:feat/issue-1061-1062-1063-1077

Conversation

@Dev-sandy1

Copy link
Copy Markdown

Summary

Implements features for issues #1061, #1062, #1063, and #1077:

Issue #1077 — Circuit Verification Key Integrity Manifest & Boot-Time Attestation

  • Added \CircuitIntegrityVerifier\ class in \zk-proof-service/lib/circuit-integrity.js\
  • Maintains HMAC-signed \manifest.json\ with SHA-256 hashes of all circuit artifacts
  • Verifies all circuit file checksums against manifest during server boot
  • Refuses service startup if any artifact fails checksum attestation
  • Integrated into \createServer()\ in \zk-proof-service/server.js\

Issue #1063 — Wallet Balance Low-Threshold Monitor & Auto-Refill Sweep Alerts

  • Added \WalletBalanceMonitor\ class in \keeper/src/walletBalanceMonitor.js\
  • Monitors keeper XLM balance every 60 seconds (configurable)
  • Multi-channel alerts: PagerDuty, Discord, Telegram
  • Warning threshold (default 50 XLM) and critical threshold (default 20 XLM)
  • Automated XLM sweep from funding wallet when below critical threshold
  • Added config options in \keeper/src/config.js\

Issue #1062 — Stellar XDR Structured Error Decoder & Automated Recovery Engine

  • Added \XDRErrorDecoder\ class in \keeper/src/xdrErrorDecoder.js\
  • Decodes base64 XDR error strings using @stellar/stellar-sdk\
  • Maps result codes to automated recovery actions:
    • \ xBAD_SEQ\ → Resync sequence counter
    • \ xINSUFFICIENT_FEE\ → Escalate fee and retry
    • \HostError\ → Quarantine task to DLQ
    • \ xBAD_AUTH\ → Alert operator
    • \ xINSUFFICIENT_BALANCE\ → Top up wallet
  • Injectable recovery handlers for custom deployment logic

Issue #1061 — Durable Transaction Monitor & Unconfirmed Timeout Resolution

  • Added \TxMonitor\ class in \keeper/src/txMonitor.js\
  • Persists submitted transaction hashes with persistence adapters (Memory/Redis)
  • Background worker polls \getTransaction\ until terminal state or expiry
  • Configurable max ledger age (default 10 ledgers) before expiry
  • Emits status change events: \ xConfirmed, \ xFailed, \ xExpired, \ xStatusChange\
  • Resilient across keeper crashes via persistent store

Testing

All new modules are designed with injectable dependencies for testability:

  • \WalletBalanceMonitor: inject custom \getBalanceFn, \sendAlertFn, \sweepFn\
  • \XDRErrorDecoder: inject recovery handlers via constructor
  • \TxMonitor: inject custom store adapter and logger
  • \CircuitIntegrityVerifier: inject custom logger and signing secret

Closes #1061
Closes #1062
Closes #1063
Closes #1077

…x monitor

- Issue SoroLabs#1077: Add CircuitIntegrityVerifier for boot-time circuit artifact
  attestation with HMAC-signed manifest and SHA-256 verification
- Issue SoroLabs#1063: Add WalletBalanceMonitor with configurable warning/critical
  thresholds, multi-channel alerts (PagerDuty, Discord, Telegram), and
  automated XLM sweep from funding wallet
- Issue SoroLabs#1062: Add XDRErrorDecoder that parses Stellar XDR error strings
  into structured errors with automated recovery actions (resync sequence,
  escalate fee, quarantine to DLQ, top up wallet)
- Issue SoroLabs#1061: Add TxMonitor durable transaction monitor with persistent
  store, background polling, ledger age expiry, and status change events

Closes SoroLabs#1061
Closes SoroLabs#1062
Closes SoroLabs#1063
Closes SoroLabs#1077
@drips-wave

drips-wave Bot commented Aug 26, 2026

Copy link
Copy Markdown

@Dev-sandy1 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

@vercel

vercel Bot commented Aug 26, 2026

Copy link
Copy Markdown

@Ebuka321 is attempting to deploy a commit to the Ayomide Adeniran's projects Team on Vercel.

A member of the Team first needs to authorize it.

@ayomideadeniran

Copy link
Copy Markdown
Contributor

Pr Under Review.

@ayomideadeniran
ayomideadeniran merged commit 116c491 into SoroLabs:main Aug 27, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment