Skip to content

Fix/oracle hardening 991 994 - #1067

Merged
Mimah97 merged 5 commits into
Vatix-Protocol:devfrom
Mac-5:fix/oracle-hardening-991-994
Aug 31, 2026
Merged

Fix/oracle hardening 991 994#1067
Mimah97 merged 5 commits into
Vatix-Protocol:devfrom
Mac-5:fix/oracle-hardening-991-994

Conversation

@Mac-5

@Mac-5 Mac-5 commented Aug 30, 2026

Copy link
Copy Markdown

Closes #1006
Closes #1007
Closes #1008
Closes #1009

  1. fix(oracle): fail closed on low-confidence resolutions before enqueue — adds ORACLE_MIN_CONFIDENCE_THRESHOLD (default 0.75); results below it are refused, not enqueued.
  2. fix(oracle): fail fast on out-of-range timeouts in production — validateTimeout throws instead of silently clamping in prod; FallbackAdapter uses a named FALLBACK_PROVIDER_TIMEOUT_POLICY_MS matching docs.
  3. fix(oracle): reject legacy passphrase-less signatures in production — adds version to SignedResolutionReport; legacy (v1) signatures throw LegacySignatureRejectedError in production.
  4. fix(price-fetcher): add primary/fallback source attribution — fetchPrice() now returns { price, source, sourceMetadata, fetchedAt } with fail-closed behavior when all providers fail.

Mac-5 and others added 5 commits August 30, 2026 23:18
Partial-success results with confidence below a configurable threshold
(ORACLE_MIN_CONFIDENCE_THRESHOLD, default 0.75) were previously enqueued
for on-chain submission regardless of signal strength. OracleService now
rejects low-confidence primary/fallback results the same way it already
rejects total provider outages: it refuses to enqueue, logs an
oracle.low_confidence_fail_closed event, and increments
oracleFailClosedTotal. Adds unit tests and env-validation docs.
timeout-utils previously clamped out-of-range timeouts to MIN/MAX with
only a console.warn, letting production silently run with a different
effective timeout than configured. validateTimeout() now throws in
NODE_ENV=production instead of clamping (dev/test keep the clamp).
FallbackAdapter now defaults to a named FALLBACK_PROVIDER_TIMEOUT_POLICY_MS
constant matching docs/architecture.md instead of the generic default, and
validates both its configured and per-request timeouts through the same
fail-fast path. Adds tests and a fix writeup under docs/fixes/.
Adds explicit signature envelope versioning to SignedResolutionReport
(version 2 = domain+network separated per Vatix-Protocol#978, version 1/undefined =
legacy domain-only). verifyResolutionReport now throws
LegacySignatureRejectedError for legacy signatures when
NODE_ENV=production instead of silently verifying them with the weaker
(passphrase-less) canonical form, closing the cross-network replay gap.
Outside production, legacy reports still verify (with a warning) to
support a migration window. signResolutionReport always stamps new
reports with version 2. Adds tests and docs/signature-helper.md updates.
PriceFetcher.fetchPrice() previously returned a bare number with no way
to tell whether it came from a primary or fallback provider, making
forensic investigation of a bad price impossible. It now returns a
PriceFetchResult { price, source: "primary" | "fallback", sourceMetadata:
{ provider, requestId }, fetchedAt }, intended to be persisted onto
OracleReport.source. Adds a real primary/fallback provider chain
(PriceProviderConfig), per-fetch correlation ids in all log lines, and
fail-closed behavior: no primaryProvider is required in
NODE_ENV=production (constructor throws instead of using the local
stub), and AllPriceProvidersFailedError is thrown instead of ever
returning a stale/default price. Adds tests and docs/price-fetcher.md
updates.
@Mimah97
Mimah97 merged commit 5eadca5 into Vatix-Protocol:dev Aug 31, 2026
0 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants