Skip to content

feat(settlement): optionally block settlement on unhealthy oracle heartbeat#233

Open
Oyinkans0la12 wants to merge 14 commits into
TevaLabs:mainfrom
Oyinkans0la12:feat/oracle-heartbeat-settlement-policy
Open

feat(settlement): optionally block settlement on unhealthy oracle heartbeat#233
Oyinkans0la12 wants to merge 14 commits into
TevaLabs:mainfrom
Oyinkans0la12:feat/oracle-heartbeat-settlement-policy

Conversation

@Oyinkans0la12

Copy link
Copy Markdown
Contributor

Closes #188

Summary

Add an optional heartbeat-based settlement policy that allows administrators to prevent resolve_round from executing when the oracle heartbeat reports a degraded or unhealthy state.

Changes

  • Added heartbeat status policy evaluation to resolve_round

  • Added administrator-configurable strict/lenient enforcement

  • Added blocked-settlement event with reason

  • Added test coverage for all heartbeat status branches

Policy

Heartbeat Status | Lenient Mode | Strict Mode -- | -- | -- Healthy | ✅ Allow | ✅ Allow Degraded | ✅ Allow | ❌ Block Unhealthy | ✅ Allow | ❌ Block

Why

Settlement quality depends on the health of the oracle. This change allows deployments that require stronger guarantees to block settlement whenever the oracle heartbeat indicates degraded or unhealthy service, while preserving existing behavior in lenient mode.

Testing

Covered:

  • Healthy heartbeat

  • Degraded heartbeat (strict and lenient)

  • Unhealthy heartbeat (strict and lenient)

  • Blocked-settlement event emission

  • Admin policy toggle behavior

Validation

Executed:

cargo test -p <affected-crate>
cargo clippy --workspace --all-targets -- -D warnings
cargo build --target wasm32-unknown-unknown --release

Scope

This PR intentionally focuses only on optional heartbeat-based settlement enforcement. It does not redesign the oracle subsystem, heartbeat implementation, settlement architecture, or event framework.

@Oyinkans0la12

Copy link
Copy Markdown
Contributor Author

Conflicts resolved, please merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Oracle: block settlement when heartbeat indicates degraded status

1 participant