feat(analytics): Core payment reliability and latency percentile computation engine (#383) - #387
Draft
s6pa1rta3n-lab wants to merge 1 commit into
Draft
Conversation
… engine (Stellar-Analysis#383) - Implemented high-throughput DDSketch streaming quantile estimator with provable relative error bound alpha = 0.01 (1%) and exact mergeability - Implemented multi-status payment reliability counter (Success, Failed, TimedOut, Rejected) with SLA tracking - Implemented strict two-clock domain separation (consensus event-time vs ingestion wall-clock time) and clock skew detection - Implemented watermark tracker with configurable delay, window lifecycle states, and explicit late-event policies (DropAndRecord, SideOutput, RetroactiveUpdate) - Implemented WatermarkedAggregateStore integrating with the backend reconciliation engine with deterministic cryptographic hashing - Added Prometheus metrics registration and comprehensive integration test suite
s6pa1rta3n-lab
force-pushed
the
fix-issue-383
branch
from
September 1, 2026 15:11
298f73c to
041f128
Compare
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 of Changes & Root Cause Analysis
Root Cause
The repository lacked a core payment-reliability and latency-percentile computation engine to evaluate payment corridor performance, compute bounded-error quantile metrics (P50/P90/P95/P99), and generate deterministic off-chain aggregate snapshots for on-chain reconciliation. Without explicit two-clock event-time handling and watermarking, delayed or out-of-order ledger events could corrupt window calculations or disagree with finalized reconciliation periods.
Key Implementations
DDSketch Streaming Quantiles (
backend/src/analytics/sketch.rs):Multi-Status Payment Reliability (
backend/src/analytics/reliability.rs):Success,Failed,TimedOut, andRejected.PaymentCorridor) and SLA breach tracking against configurable threshold (default 2000ms).Two-Clock Domain Separation & Skew Detection (
backend/src/analytics/clock.rs):ClockSkewMonitor) with Prometheus warning counters.Monotonic Watermarking & Window State Machine (
backend/src/analytics/watermark.rs):ActiveFinalizedAmended.DropAndRecord,SideOutput, andRetroactiveUpdate.Reconciliation Subsystem Integration (
backend/src/analytics/reconciliation_bridge.rs):WatermarkedAggregateStoreadhering toOffChainAggregateStoretrait.reconcilable_periods()strictly with watermarked finalized windows ({end} \le W(t)$).snapshot_hashandsource_data_hash) for zero-tolerance on-chain agreement verification.Observability & Integration Tests (
backend/src/observability/metrics.rs&tests/payment_analytics_test.rs):Fixes #383
Payout Routing
0xF46C9F6d70C50BF81ef3588AB523a90a594a2F89GCL6OXAMLD75BMTINA6EMRUDWK5THQUSHMYNLSNBCJAPZJHNYJTUNIBC