fix(indexer): preserve pool coverage and bound provider failover #1454

Merged
PlasticDigits merged 2 commits from fix/issue-1453-liquidity-feed into main 2026-10-09 11:51:03 +00:00
Owner

Successful pool reads could be discarded when later fee or book queries failed, allowing supported reserves to expire and making a partial liquidity subtotal look like a withdrawal. This change commits pool observations independently and keeps compatible hybrid reserve/book generations separate.

The pool lane acquires matching fees after committing reserves; the book lane consumes those observations. Queries pin and verify the same height. Monotonic writes preserve original timestamps, and advisory leadership plus cancellation monitoring coalesces each lane across replicas. Shared provider budgets, bounded capacity waits, healthy failover, capped backoff/Retry-After and one recovery probe limit upstream work. Discovery retains successful phases through capacity waits instead of skipping legitimate events.

Adds migration 20261009145300, full valid reserve/book storage ranges, focused failure/recovery fixtures, make verify-issue-1453, redacted operational probes and LF1453 agent guidance. Runtime still requires a separate migration job. Retail presentation stays unchanged; browser fixture matching now accepts the Vite development proxy prefix.

Refs #1453. Complete removal of existing quote-triggered LCD calls remains #1452; this PR does not claim zero quote RPC or the <250 ms quote target.

Final verification: make verify-issue-1453 12 PASS / 0 FAIL / 2 SKIP; make verify-issue-1380 13 PASS / 0 FAIL / 2 SKIP. Implementation commit b9809df5; evidence commit 91c26fa9.

Validation and scoped evidence: verification report, counts and fingerprint.

  • Focused verifier runs functional groups and retests: provider/config/book/valuation/discovery library tests, 83 disposable-Postgres tests per pass, 97 frontend tests per pass, four desktop/phone browser checks, and nine probe privacy/budget tests.
  • Related liquidity, discovery, database isolation, execution-floor, unfillable-book and listing verifiers were run; exact results and corrected initial failures are recorded in the report.
  • Production was audited read-only through openbao-tools/workstation/bao-exec: three providers configured; two passed height-pinned pool probes and one lacked the required response-height header. The deployed revision was pre-fix.

Issue acceptance checklist:

  • AC1: independently committed pool survives fee/book failure; hybrid eligibility remains honest.
  • AC2: mocked steady coverage/secondary/tertiary/saturated-provider recovery passes; deployed completeness and freshness budget remain unverified.
  • AC3: bounded provider circuits, rate/concurrency admission, Retry-After and recovery probes tested.
  • AC4: configuration/header evidence collected; actual deployment failover/recovery remains unverified.
  • AC5: eligible pool/hybrid cached consumers verified; complete request-RPC removal remains #1452.
  • AC6: stable totals, price changes/decreases/zero and UTC stock tested locally; deployment latency and funded LP controls remain unverified.
  • AC7: monotonic pool/hybrid observations and atomic headline/pair/history behavior tested.
  • AC8: original 03/04/05 UTC evidence preserved; exact omitted contribution remains unknown and no historical repair was justified.
  • AC9: focused verifier, config/docs/invariants, agent guidance and plain retail behavior covered.

Reviewing agent instructions: follow the QA checklist, provision a dedicated disposable QA database, run make verify-issue-1453, inspect the migration and pool-versus-hybrid readers, then examine the redacted operational/history receipts. Mark unavailable items SKIP with the attempted prerequisite and concrete reason; overall PASS WITH SKIPS is permitted when runnable checks pass. Leave skipped acceptance unchecked. Executed failures must be repaired and retested, and local PASS cannot establish production deployment or reconstruct missing historical inputs.

Followups are deployment of the separately migrated indexer, measured live recovery/latency, #1452 integration, and evidence-supported historical reconciliation if original observations become available. This PR intentionally does not close #1453.

Successful pool reads could be discarded when later fee or book queries failed, allowing supported reserves to expire and making a partial liquidity subtotal look like a withdrawal. This change commits pool observations independently and keeps compatible hybrid reserve/book generations separate. The pool lane acquires matching fees after committing reserves; the book lane consumes those observations. Queries pin and verify the same height. Monotonic writes preserve original timestamps, and advisory leadership plus cancellation monitoring coalesces each lane across replicas. Shared provider budgets, bounded capacity waits, healthy failover, capped backoff/Retry-After and one recovery probe limit upstream work. Discovery retains successful phases through capacity waits instead of skipping legitimate events. Adds migration `20261009145300`, full valid reserve/book storage ranges, focused failure/recovery fixtures, `make verify-issue-1453`, redacted operational probes and [LF1453 agent guidance](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/commit/91c26fa94f2b147209f9ff9111b2d66a0c41b1eb/skills/AGENTS_LIQUIDITY_FEED.md). Runtime still requires a separate migration job. Retail presentation stays unchanged; browser fixture matching now accepts the Vite development proxy prefix. Refs #1453. Complete removal of existing quote-triggered LCD calls remains #1452; this PR does not claim zero quote RPC or the <250 ms quote target. Final verification: `make verify-issue-1453` **12 PASS / 0 FAIL / 2 SKIP**; `make verify-issue-1380` **13 PASS / 0 FAIL / 2 SKIP**. Implementation commit `b9809df5`; evidence commit `91c26fa9`. Validation and scoped evidence: [verification report](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/commit/91c26fa94f2b147209f9ff9111b2d66a0c41b1eb/docs/qa/issue-1453/verification.md), [counts and fingerprint](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/commit/91c26fa94f2b147209f9ff9111b2d66a0c41b1eb/docs/qa/issue-1453/verification-results.json). - Focused verifier runs functional groups and retests: provider/config/book/valuation/discovery library tests, 83 disposable-Postgres tests per pass, 97 frontend tests per pass, four desktop/phone browser checks, and nine probe privacy/budget tests. - Related liquidity, discovery, database isolation, execution-floor, unfillable-book and listing verifiers were run; exact results and corrected initial failures are recorded in the report. - Production was audited read-only through `openbao-tools/workstation/bao-exec`: three providers configured; two passed height-pinned pool probes and one lacked the required response-height header. The deployed revision was pre-fix. Issue acceptance checklist: - [x] AC1: independently committed pool survives fee/book failure; hybrid eligibility remains honest. - [ ] AC2: mocked steady coverage/secondary/tertiary/saturated-provider recovery passes; deployed completeness and freshness budget remain unverified. - [x] AC3: bounded provider circuits, rate/concurrency admission, Retry-After and recovery probes tested. - [ ] AC4: configuration/header evidence collected; actual deployment failover/recovery remains unverified. - [ ] AC5: eligible pool/hybrid cached consumers verified; complete request-RPC removal remains #1452. - [ ] AC6: stable totals, price changes/decreases/zero and UTC stock tested locally; deployment latency and funded LP controls remain unverified. - [x] AC7: monotonic pool/hybrid observations and atomic headline/pair/history behavior tested. - [ ] AC8: original 03/04/05 UTC evidence preserved; exact omitted contribution remains unknown and no historical repair was justified. - [x] AC9: focused verifier, config/docs/invariants, agent guidance and plain retail behavior covered. Reviewing agent instructions: follow the [QA checklist](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/commit/91c26fa94f2b147209f9ff9111b2d66a0c41b1eb/docs/qa/issue-1453/README.md), provision a dedicated disposable QA database, run `make verify-issue-1453`, inspect the migration and pool-versus-hybrid readers, then examine the redacted operational/history receipts. Mark unavailable items SKIP with the attempted prerequisite and concrete reason; overall PASS WITH SKIPS is permitted when runnable checks pass. Leave skipped acceptance unchecked. Executed failures must be repaired and retested, and local PASS cannot establish production deployment or reconstruct missing historical inputs. Followups are deployment of the separately migrated indexer, measured live recovery/latency, #1452 integration, and evidence-supported historical reconciliation if original observations become available. This PR intentionally does not close #1453.
fix(indexer): isolate pool observations and bound provider failover
Some checks failed
ci/woodpecker/pr/woodpecker Pipeline was canceled
b9809df5c3
Publish pool reserves independently of fee and book failures. Preserve pinned hybrid generations, monotonic observations and bounded provider recovery while retrying admission pressure without dropping discovered pairs.
docs: link liquidity feed verification and acceptance evidence
Some checks failed
ci/woodpecker/pr/woodpecker Pipeline failed
91c26fa94f
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
code/cl8y-dex-terraclassic!1454
No description provided.