Skip to main contentA-REX Foundation

سجلات القرارات · ADR-015

ADR-015: Oracle rounds keyed by round number, not wall clock

Commodity prices are agreed in numbered rounds per commodity, finalized at quorum with the median, so results do not depend on when submissions fall relative to a time bucket.

Accepted
معرّف المستند
ADR-015
التاريخ
2026-09-21
متوفر بالإنجليزية فقط
هذه الصفحة بالإنجليزية. فصول الورقة البيضاء والمخططات مترجمة. يبقى المعيار المعياري في المستودع؛ استخدم طلب وصول مبكر لذلك النص. وتبقى أدلة تصميم النظام وسجلات القرارات بالإنجليزية.
FieldValue
IDADR-015
Subject areaData integration
StatusAccepted
Date2026-09-21
OwnersA-REX Contributors
Related requirementsFR-13, NFR-05 (SDD §3)
Supersedes / superseded by—

Context

The earlier oracle module grouped submissions by block.timestamp / 300. The same set of submissions produced different rounds depending on when they landed relative to the five-minute edges, and its tests failed intermittently for that reason.

Issue

How should a small set of reporters agree on a commodity price deterministically?

Assumptions

  • Reporters are a small, known set.
  • Consumers decide how old a price may be.

Constraints

  • Deterministic, testable behaviour (NFR-05).

Alternatives considered

AlternativeForAgainstOutcome
Time bucketsImplicit roundsNon-deterministic results and testsRejected
Monotonic round ids per commodity; finalize at quorum; manual finalize at a minimum; medianDeterministic; manipulation needs a majorityStaleness is checked by the callerAccepted

Decision

CommodityPriceOracle numbers rounds per commodity, finalizes automatically when quorum reporters have submitted and manually once minSubmissions is reached, and publishes the median. Weather, quality and IoT data are attestations or metadata, not oracle rounds.

Argument

Numbering rounds removes time from the consensus rule; the median tolerates a minority of bad reports.

Consequences

Positive

  • Deterministic results and tests.
  • Clear separation between prices and evidence.

Negative

  • Callers must check staleness with isStale(commodity, maxAge).

Obligations it creates

  • Consumers set a maximum age appropriate to their use.

Implementation and evidence

WhatWhere
Contractcontracts/reference/extensions/CommodityPriceOracle.sol
Testtest/standard/Extensions.test.js: finalizes rounds by quorum with the median, independent of wall-clock buckets
  • ADR-014: Carbon as a registry-immobilised wrapper plus attestations; no primary issuance
  • ADR-016: UUPS upgradeability with ERC-7201 storage and a per-file optimizer setting