Skip to content

fix(escrow): only emit match/ora_dead event when consensus is unreachable - #1891

Open
Shackole wants to merge 1 commit into
StellarCheckMate:mainfrom
Shackole:fix/1821-check-oracle-deadlock-event
Open

Shackole wants to merge 1 commit into
StellarCheckMate:mainfrom
Shackole:fix/1821-check-oracle-deadlock-event

Conversation

@Shackole

Copy link
Copy Markdown

Summary

Fixes check_oracle_deadlock in the escrow contract so that the match/ora_dead event is only emitted when current_confirmations < required and no further unvoted approved oracle can tip the balance to reach the required confirmation threshold. Previously, false-positive deadlock signals could be emitted even when consensus was already reached or still reachable.

Related Issue

Closes #1821

What Changed

  • Contracts: Updated check_oracle_deadlock in contracts/escrow/src/lib.rs to return early when current_confirmations >= required, compute remaining possible confirmations from unvoted approved oracles, and only mark deadlock / emit match/ora_dead when current_confirmations < required && max_possible_confirmations < required.
  • Tests: Added test_no_deadlock_event_emitted_when_consensus_reachable in contracts/escrow/src/tests/consensus.rs verifying that match/ora_dead is not emitted when consensus is still reachable.
  • Docs: Updated docs/architecture.md to clarify the deadlock condition.

Checklist

  • cargo test passes locally
  • cargo clippy is clean
  • Tests added or updated for this change
  • Documentation updated (or no update needed)

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.

Fix: check_oracle_deadlock emits an event even when there is no deadlock

1 participant