fix(blockchain): resolve issues #917 #933 #934 #937 — reliability har…#1068
Merged
hman38705 merged 1 commit intoJun 30, 2026
Conversation
…olutions-plug#934 solutions-plug#937 — reliability hardening ## solutions-plug#933 — WATCHED_TX_TTL now configurable (WATCHED_TX_TTL_SECS) - Remove hardcoded 30-min Duration const; replace with config-driven value - Add Config::watched_tx_ttl_secs (default 1800) read from WATCHED_TX_TTL_SECS - Thread the value into BlockchainClient::watched_tx_ttl field - Migration 019 creates watched_transactions table with expires_at column driven by the same TTL, satisfying the DB persistence requirement ## solutions-plug#934 — WATCHED_TX_MAX_SIZE cap now rejects (503) instead of silently evicting - Cap behaviour changed from evict-oldest to reject-with-503; callers receive a clear error rather than silently losing monitor coverage of old hashes - Add Config::watched_tx_max_size (default 10 000) read from WATCHED_TX_MAX_SIZE - Add Metrics::watched_tx_count IntGauge updated on every insert/eviction/removal - Add Prometheus alert WatchedTxCountHigh (>8000, warning) and WatchedTxCountCritical (>=10000, critical) in performance/config/alerts.yaml ## solutions-plug#937 — Deduplication check for watched transactions - watch_transaction now returns Result<(), WatchTxError> instead of () - WatchTxError::AlreadyWatched returned when hash already in map (no dup insert) - WatchTxError::CapReached returned when map is full (propagates to 503 in handler) - blockchain_tx_status handler matches on the error variants: AlreadyWatched is treated as idempotent (status still returned), CapReached returns 503 SERVICE_UNAVAILABLE with a clear message - Migration 019 adds UNIQUE constraint on tx_hash for DB-layer dedup ## solutions-plug#917 — Stellar RPC reachability probe at startup & /health/ready endpoint - validate_network_passphrase now differentiates dev vs production: PREDICTIQ_ENV=production → process::exit(1) on failure/mismatch all other envs → log warning and continue - Add probe_stellar_ready() for per-request liveness checking - Add GET /health/ready readiness endpoint returning 200/503 + JSON body with ready bool and stellar_rpc field ("ok" | "unreachable") - Route registered in main.rs public_routes ## Docs & config - services/api/README.md: document WATCHED_TX_TTL_SECS, WATCHED_TX_MAX_SIZE, PREDICTIQ_ENV, /health/ready endpoint, watched_tx_count metric - services/api/.env.example: add commented-out examples for new variables - Config test structs updated with new required fields
|
@knytcomics-ui 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! 🚀 |
hman38705
added a commit
that referenced
this pull request
Jun 30, 2026
…_watched_transactions, cap check in watch_transaction, DB persistence for tx watch/resolve, fix duplicate health_live Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
…dening
closes #933 — WATCHED_TX_TTL now configurable (WATCHED_TX_TTL_SECS)
closes #934 — WATCHED_TX_MAX_SIZE cap now rejects (503) instead of silently evicting
closes #937 — Deduplication check for watched transactions
closes #917 — Stellar RPC reachability probe at startup & /health/ready endpoint
Docs & config
Description
Type of Change
Testing Done
Bundle Size
Checklist
Related Issues
Closes #