fix(oracle): validate fresh quorum and contain hub spot manipulation (#1391) #1412

Merged
PlasticDigits merged 3 commits from fix/1391-oracle-integrity into main 2026-10-06 02:13:05 +00:00
Owner

Invalid CEX prices and expired historical averages could affect public USD marks and script sizing. This change rejects invalid inputs, requires a named two-source quorum, expires current prices, and bounds canonical hub spots with independent priced-leg depth and persistent references. Financial scripts validate source, age and quality again before transaction preparation; live numeric price overrides are rejected.

Implements #1391. Hub spots remain explicitly non-oracle-grade. Fresh CEX observations mean recent local fetches and agreement, not authenticated market timestamps. Fixed references cannot prove fair value or prevent manipulated bootstrap/within-bound changes.

Acceptance and verification:

  • Invalid prices cannot enter new source storage or certified aggregates; no quorum/expired/future current observations produce unavailable/degraded results.
  • Canonical UST1 reserve shifts and USTR candidate switching are bounded under documented policy; source confidence and provenance reach USD APIs/adapters.
  • All six indexer-fed financial scripts validate exact source identity, age and quality before preparation and abort >1% plan movement; mocks verify no transaction helper runs on unsafe input.
  • Canonical identity, decimals and coverage regressions; API documentation and O1391-1–O1391-10 invariants crosslinked with third-party agent playbooks.
  • Real LocalTerra reserve-manipulation/LP-withdrawal execution: prerequisite attempts reached a slow shared chain and a private chain without a usable first block. Remains explicitly unverified.
  • Production deployment acceptance: PR scope; no deployment or production manipulation performed.

Validation: full aggregate PASS twice (372 Rust test executions, 38 Python test cases), followed by final mixed-flag historical repair regression 11/11 twice (394 Rust executions total); Node 24 types and all commit hooks pass. Overall PASS with explicit chain/deployment skips; no executed assertion failure was waived.

Commands/outcomes, revision and UTC scope are in the verification receipt. Review/reproduction and explicit agent skip permission are in the checklist and the agent playbook. Every runnable assertion must pass; unavailable checks may be recorded as SKIP and implementation verification may report overall PASS with skips. A skip never proves deployment and an executed failure stays FAIL until fixed and retested.

SQLx migrations add certified oracle state/history and durable hub references. Legacy history stays uncertified; old hub/economic marks lacking provenance are unavailable. Deploy the new indexer API before updated scripts: old price-only payloads fail closed. Intentional repricing needs reviewed reference maintenance, never automatic reanchoring. No contract migration is required.

Invalid CEX prices and expired historical averages could affect public USD marks and script sizing. This change rejects invalid inputs, requires a named two-source quorum, expires current prices, and bounds canonical hub spots with independent priced-leg depth and persistent references. Financial scripts validate source, age and quality again before transaction preparation; live numeric price overrides are rejected. Implements #1391. Hub spots remain explicitly non-oracle-grade. Fresh CEX observations mean recent local fetches and agreement, not authenticated market timestamps. Fixed references cannot prove fair value or prevent manipulated bootstrap/within-bound changes. Acceptance and verification: - [x] Invalid prices cannot enter new source storage or certified aggregates; no quorum/expired/future current observations produce unavailable/degraded results. - [x] Canonical UST1 reserve shifts and USTR candidate switching are bounded under documented policy; source confidence and provenance reach USD APIs/adapters. - [x] All six indexer-fed financial scripts validate exact source identity, age and quality before preparation and abort >1% plan movement; mocks verify no transaction helper runs on unsafe input. - [x] Canonical identity, decimals and coverage regressions; API documentation and O1391-1–O1391-10 invariants crosslinked with third-party agent playbooks. - [ ] Real LocalTerra reserve-manipulation/LP-withdrawal execution: prerequisite attempts reached a slow shared chain and a private chain without a usable first block. Remains explicitly unverified. - [ ] Production deployment acceptance: PR scope; no deployment or production manipulation performed. Validation: full aggregate PASS twice (372 Rust test executions, 38 Python test cases), followed by final mixed-flag historical repair regression 11/11 twice (394 Rust executions total); Node 24 types and all commit hooks pass. Overall PASS with explicit chain/deployment skips; no executed assertion failure was waived. Commands/outcomes, revision and UTC scope are in [the verification receipt](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/commit/16304203218ce10a36e4072835cfa3879f4e6958/docs/qa/issue-1391/verification.md). Review/reproduction and explicit agent skip permission are in [the checklist](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/commit/16304203218ce10a36e4072835cfa3879f4e6958/docs/qa/issue-1391/README.md) and [the agent playbook](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/commit/16304203218ce10a36e4072835cfa3879f4e6958/skills/AGENTS_ORACLE_SAFETY.md). Every runnable assertion must pass; unavailable checks may be recorded as SKIP and implementation verification may report overall PASS with skips. A skip never proves deployment and an executed failure stays FAIL until fixed and retested. SQLx migrations add certified oracle state/history and durable hub references. Legacy history stays uncertified; old hub/economic marks lacking provenance are unavailable. Deploy the new indexer API before updated scripts: old price-only payloads fail closed. Intentional repricing needs reviewed reference maintenance, never automatic reanchoring. No contract migration is required.
fix: certify oracle inputs and contain hub spot manipulation (#1391)
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
421ef59f3a
Require source quorum and bounded observation age for current and historical USD marks. Persist fixed hub references, propagate advisory provenance, and validate financial inputs before transaction preparation.
docs: link oracle safety verification to PR #1412
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
1630420321
Integrate oracle integrity with security remediation [skip ci]
Some checks failed
ci/woodpecker/pr/woodpecker Pipeline failed
67ce1deb1a
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!1412
No description provided.