feat(oracle-service): heartbeat same-rate refresh + confirm UpdateRate from DeliverTx wasm events #46

Merged
PlasticDigits merged 1 commit from feat/oracle-heartbeat-event-confirm into main 2026-08-16 13:31:31 +00:00
PlasticDigits commented 2026-08-16 13:26:56 +00:00 (Migrated from gitlab.com)

Summary

Implements ust1-window#32: two oracle-service production fixes observed on columbus-5 after /ust1 reported Oracle stale while the bot was still polling Venus.

  • Heartbeat: when Venus proposed == on-chain rate, still submit UpdateRate with this tick's multi-RPC consensus rate once INV-ORACLE-THROTTLE-001 allows (4h). Logs event=oracle_heartbeat / tick_kind=heartbeat. Equal-rate inside the throttle window stays a cheap no-op.
  • Confirm from DeliverTx wasm events: record liveness when the included tx emits action=update_rate + matching rate on ORACLE_CONTRACT. Lagged LCD State is oracle_state_lag_after_event_ok (warn only). If wasm attrs are stripped, fall back to retried State, then fail-closed.

No contract migrate. Window max_oracle_age_sec unchanged. CheckTx / SYNC still does not count as success.

Closes #32. Related: #31 (leave open until mainnet age stays inside 6h), #23, #24. DEX O2 runbook pointers are a follow-up on cl8y-dex-terraclassic#503.

Test plan

  • cargo test -p ust1-oracle-service (106 tests) — heartbeat routing, event-confirm vs lagged State, wrong contract, rate mismatch, throttle skip, paused, EVM disagreement
  • cargo test -p ust1-common / ust1-oracle — same-rate after 4h is Ok; multitest advances last_update_sec and emits update_rate
  • cargo clippy -p ust1-oracle-service -- -D warnings
  • After Coolify deploy: ≥4h Venus-flat period shows heartbeat UpdateRate, Finder wasm action=update_rate, window last_update_sec advances, /ust1 stays Fresh
  • Observe LCD State lag: tick is not tick failed when events match; LIVENESS_ORACLE_NO_BROADCAST silence resets
  • No heartbeat txs inside 4h of the previous include
  • DEX UST1_OPS_STRICT_STALE=1 ./scripts/check-ust1-wrap-ops-health.sh PASS while healthy (DEX repo)
## Summary Implements [ust1-window#32](https://gitlab.com/PlasticDigits/ust1-window/-/issues/32): two oracle-service production fixes observed on columbus-5 after `/ust1` reported Oracle stale while the bot was still polling Venus. - **Heartbeat:** when Venus `proposed ==` on-chain rate, still submit `UpdateRate` with this tick's multi-RPC consensus rate once **INV-ORACLE-THROTTLE-001** allows (4h). Logs `event=oracle_heartbeat` / `tick_kind=heartbeat`. Equal-rate inside the throttle window stays a cheap no-op. - **Confirm from DeliverTx wasm events:** record liveness when the included tx emits `action=update_rate` + matching `rate` on `ORACLE_CONTRACT`. Lagged LCD `State` is `oracle_state_lag_after_event_ok` (warn only). If wasm attrs are stripped, fall back to retried `State`, then fail-closed. No contract migrate. Window `max_oracle_age_sec` unchanged. CheckTx / SYNC still does not count as success. Closes #32. Related: #31 (leave open until mainnet age stays inside 6h), #23, #24. DEX **O2** runbook pointers are a follow-up on [cl8y-dex-terraclassic#503](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/issues/503). ## Test plan - [x] `cargo test -p ust1-oracle-service` (106 tests) — heartbeat routing, event-confirm vs lagged State, wrong contract, rate mismatch, throttle skip, paused, EVM disagreement - [x] `cargo test -p ust1-common` / `ust1-oracle` — same-rate after 4h is Ok; multitest advances `last_update_sec` and emits `update_rate` - [x] `cargo clippy -p ust1-oracle-service -- -D warnings` - [ ] After Coolify deploy: ≥4h Venus-flat period shows heartbeat `UpdateRate`, Finder wasm `action=update_rate`, window `last_update_sec` advances, `/ust1` stays Fresh - [ ] Observe LCD State lag: tick is not `tick failed` when events match; `LIVENESS_ORACLE_NO_BROADCAST` silence resets - [ ] No heartbeat txs inside 4h of the previous include - [ ] DEX `UST1_OPS_STRICT_STALE=1 ./scripts/check-ust1-wrap-ops-health.sh` PASS while healthy (DEX repo)
PlasticDigits commented 2026-08-16 13:31:31 +00:00 (Migrated from gitlab.com)

mentioned in commit de0e8f01ca

mentioned in commit de0e8f01ca3948e46457ddc43f778b5f0a0a1443
PlasticDigits (Migrated from gitlab.com) merged commit de0e8f01ca into main 2026-08-16 13:31:31 +00:00
PlasticDigits commented 2026-08-16 13:32:55 +00:00 (Migrated from gitlab.com)

mentioned in issue #32

mentioned in issue #32
PlasticDigits commented 2026-08-16 13:42:04 +00:00 (Migrated from gitlab.com)

mentioned in issue #31

mentioned in issue #31
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/ust1-window!46
No description provided.