← Back to Pull requests

wallet_rpc_server: deduplicate payment IDs in get_bulk_payments #11759

Open
unknown opened this pull request with 88 lines diff across 1 files
View on GitHub
unknown unknown commented on Nov 16, 2026 20:32 UTC
Author

Fixes #11745

Problem


get_bulk_payments appends matching payments for every occurrence of a
parsed payment ID. Repeated IDs in the request cause duplicated results
and excessive memory usage (reported: 3,000 copies of one ID → 300,000
payments, ~131 MB response, 1.1 GB peak RSS).

Fix


Deduplicate the input payment IDs with an unordered_set before the
processing loop, so each unique ID is looked up only once. Order of
first occurrence is preserved.

Testing


  • Added regression test in tests/functional_tests/transfer.py

  • (check_get_bulk_payments).
  • Verified the test fails on unpatched master and passes with the patch.

  • Full transfer functional test suite passes (1/1 tests passed).
  • Diff: 88 lines (+66 / -22) across 1 files Reviewer: selsta Review duration: 20179m
    All Vouch review confidence checks passed
    Residual risk 0.28 = Change Risk (0.53) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.53 · 88 lines diff across 1 files
    0.53
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.269
    Sensitive Paths sensitive_paths
    0.053
    Real PR Conversation Timeline
    1 comments
    "Review active on #11759"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 53% (MEDIUM) · Higher = larger blast radius
    53%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 28.3% · Safe to merge
    28.3%