Skip to content

docs(oracle): document auth-after-effect ordering for integrators #287

@Troublor

Description

@Troublor

Feature request

Add an integrator-facing advisory in docs/spec/ documenting the intentional auth-after-effect ordering in Oracle.sol and its implications.

Background

Oracle.sol's onlySystemAddress modifier intentionally runs the function body before the auth check (see Oracle.sol:34-41) so that off-chain simulators can observe the trace even when the call ultimately reverts. The contract source captures the why, but it does not surface in the protocol spec.

What to add

Two informational notes that this design implies:

  1. Block-gas-budget consumption by unauthorized callers. A non-system caller can invoke setSlot / setSlots / emitLog / emitLogs with arbitrarily large inputs; the body iterates and SSTOREs before the modifier reverts. The attacker pays the gas, but the block's gas budget is consumed during the futile work. Not differentiable from any other unbounded-loop gas-burn pattern in the EVM, so no contract change is implied — worth surfacing as expected behavior so operators are not surprised.

  2. Trace semantics for integrators. Consumers of debug_traceTransaction that read storage writes out of traces need to know that an SSTORE in an Oracle call's trace does not imply the slot was written — they must filter by final tx status first. Worth an explicit advisory plus a short integration-test-style example showing the expected indexer pattern (filter by tx status, then process trace).

Scope

Documentation only — docs/spec/. No contract or core-crate changes.

Metadata

Metadata

Assignees

Labels

api:unchangedNo change to the public interface or APIcomp:docChanges in the documentationspec:unchangedNo change to any `mega-evm`'s behavior

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions