feat(ops): H-3 — align oracle poll interval and silence alert with window staleness budget #24
Labels
No labels
enhancement
governance
QA
testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
code/ust1-window#24
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Close H-3 from
audits/INTERNAL_KIMIK3_1786162831.md: fix oracle poll / window staleness / silence-alert misalignment so one missed tick cannot immediately halt swaps, and so liveness alerts fire before (or with) the window staleness cutoff — not hours later.Audit ref: H-3
Related: C-3 (confirm-before-liveness — silence should key off confirmed updates once C-3 lands)
Current codebase
ust1-commonDEFAULT_MAX_ORACLE_AGE_SECSoracle-servicePOLL_INTERVAL_SECSORACLE_MAX_SILENCE_SECSust1-commonmin update intervalProblem: Poll interval equals the entire staleness budget ⇒ zero margin for a failed tick. Silence alert default is 2h after the window already rejects swaps. Combined with C-3 false success, “silence” is also semantically muddy until confirmations exist.
Why this is needed
Constraints / guardrails
POLL_INTERVAL_SECS≤ 1 hour (recommend 3600 or less); still respect on-chain throttle / policy skips.ORACLE_MAX_SILENCE_SECS≤max_oracle_age + poll(e.g. 21600+3600) — alert must not be looser than “window already dead + one poll”.max_oracle_ageso ops are paged at or before user impact (document chosen formula).Relevant files
oracle-service/src/config.rs— defaults + validation if neededoracle-service/src/main.rs— alert text if thresholds change meaningsmartcontracts-terraclassic/packages/ust1-common/src/lib.rs—DEFAULT_MAX_ORACLE_AGE_SECS(usually leave; document relationship)README.md(oracle-service liveness section)docs/DEPLOYMENT.md— env table / recommended production valuesoracle-serviceRecommended direction
ORACLE_MAX_SILENCE_SECSto a value ≤ window max age (recommend 21600) ormax_age + pollper product choice — must be ≤ current 28800 and not later than user impact.poll < max_oracle_ageandsilence ≤ max_oracle_age (+ small grace)in DEPLOYMENT.poll_interval >= max_oracle_ageequivalent is mis-set when both are known (service may not know on-chain max age — document operator responsibility).Acceptance criteria
max_age+pollwith poll≪max_age).Test plan (all paths)
POLL_INTERVAL_SECS/ORACLE_MAX_SILENCE_SECSstill honored.should_alertat new threshold (existing unit tests adjusted).Test plan (attack / hack / abuse vectors)
silence > poll * Nor silence absurdly high.Verification criteria
mentioned in commit
fae6e8aebementioned in merge request !36
mentioned in merge request !37
Implemented in !37 (
fix/issue-24-oracle-poll-silence).Acceptance criteria
DEFAULT_POLL_INTERVAL_SECS = 3600DEFAULT_ORACLE_MAX_SILENCE_SECS = 21600poll < max_age,silence ≤ max_age, grace ≤max_age+poll)cargo test -p ust1-oracle-service— 19 passed, twice); no on-chain contract logic changesAlso done
ORACLE_OPS_TIMING_MISCONFIG+verify_oracle_operator_env.shadvisoriesskills/oracle-ops-poll-silence+ cross-linksNot done here (by design / ops)
MR: https://gitlab.com/PlasticDigits/ust1-window/-/merge_requests/4
mentioned in merge request !44
MR !37 verification (H-3 / #24)
Verdict: PASS_WITH_NOTES — merging (prefer before !35).
AC
Tests (local)
cargo test -p ust1-oracle-service— 19/19 passedverify_oracle_operator_env.sh— clean on defaults; advisories on legacy 21600/28800Problems / follow-ups
poll_interval_secs=3600/ silence21600).secret_detection.mentioned in commit
6ffa7324aementioned in issue #27
mentioned in issue #32
mentioned in merge request !46