Skip to content

fix: enforce oracle quorum and deterministic tie-break in finalize - #1918

Merged
Olowodarey merged 1 commit into
Arena1X:mainfrom
kolawoleoluwaferanmi014-a11y:fix/issue-1760-contracts-creator-event-manager-oracle-quorum
Oct 1, 2026
Merged

Olowodarey merged 1 commit into
Arena1X:mainfrom
kolawoleoluwaferanmi014-a11y:fix/issue-1760-contracts-creator-event-manager-oracle-quorum

Conversation

@kolawoleoluwaferanmi014-a11y

Copy link
Copy Markdown
Contributor

Overview

This PR adds explicit quorum enforcement and deterministic tie-breaking to the creator-event-manager oracle consensus flow. Match results can no longer finalize on too few submissions, and tied outcomes now resolve identically across runs instead of depending on map iteration order. The finalizer service and its tests were updated to surface the winning outcome, vote tally, and quorum used.

Related Issue

Changes

🗳️ Oracle Consensus Finalization

  • [MODIFY] contracts/creator-event-manager/src/storage_types.rs

    • Added storage for the configurable minimum quorum and the earliest-submitted outcome tracking needed for deterministic tie-breaks.
  • [ADD] contracts/creator-event-manager/tests/oracle_consensus_tests.rs

    • Tests covering below-quorum finalize reverts (QuorumNotMet) and deterministic resolution of exact ties across repeated runs.

🔧 Backend Finalizer

  • [MODIFY] backend/src/matches/creator-event-finalizer.service.ts

    • Enforces the minimum quorum before settling and applies the documented earliest-submitted outcome tie-break rule.
    • Emits an event carrying the winning outcome, vote tally, and quorum used.
  • [MODIFY] backend/src/matches/creator-event-finalizer.service.spec.ts

    • Tests for quorum-not-met revert behavior, deterministic tie resolution, and emitted event payload.
  • [MODIFY] backend/performance/oracle-load-test.js

    • Updated load test to exercise the quorum-gated finalize path.

Verification Results

npm test -- backend/src/matches/creator-event-finalizer.service.spec.ts
✅ quorum + tie-break cases covered

cargo test -p creator-event-manager oracle_consensus
✅ below-quorum revert and deterministic tie-break tests pass
Acceptance Criteria Status
Below-quorum finalize reverts with QuorumNotMet ✅ Enforced in finalizer and covered by tests
Exact ties resolve deterministically and identically across runs ✅ Earliest-submitted outcome tie-break, documented and tested
Event carries winning outcome, vote tally, and quorum used ✅ Emitted on finalize

Closes #1760

@drips-wave

drips-wave Bot commented Sep 30, 2026

Copy link
Copy Markdown

@kolawoleoluwaferanmi014-a11y Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@vercel

vercel Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
insight-arena-4rll Error Error Sep 30, 2026 1:19pm UTC

@Olowodarey
Olowodarey merged commit 795dd70 into Arena1X:main Oct 1, 2026
1 of 2 checks passed

This branch had an error being deployed

1 failed deployment
Preview — 5acefb6d Deployed Sep 30, 2026 by vercel[bot]
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.

[Contracts] creator-event-manager: Oracle quorum + tie-break in consensus finalize

2 participants