Skip to content

fix: DAO penalty consensus and reset flow#459

Merged
saiintbrisson merged 4 commits into
mainfrom
dev
Feb 16, 2026
Merged

fix: DAO penalty consensus and reset flow#459
saiintbrisson merged 4 commits into
mainfrom
dev

Conversation

@functor-flow
Copy link
Copy Markdown
Collaborator

What was wrong

  • Penalty factor selection was wrong: it could return 100 even when pending votes were 20.
  • Penalty processing flip-flopped between apply/reset due to alternating iteration logic.
  • Penalty tx flow didn’t wait for finalization.
  • One lint warning in torus-bridge test (afterEach unused).

What changed

  • Rewrote pendingPenalizations to compute factor from the actual pending vote set (executed=false, deleted_at IS NULL)
    and select nth-highest deterministically.
  • Restored reset-to-0 logic, but made it correct:
    • reset only if on-chain penalty >0 and active vote support is below threshold.
  • Removed odd/even toggle; now apply+reset candidates are computed each cycle and merged once.
  • Updated penalizeAgent to use tx tracker and wait for finalized before success.
  • Removed unused afterEach import in bridge test.

@functor-flow functor-flow requested a review from a team as a code owner February 13, 2026 18:50
@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 13, 2026

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

Project Deployment Actions Updated (UTC)
apostle-swarm Ready Ready Preview, Comment Feb 16, 2026 3:32pm
prediction-swarm Ready Ready Preview, Comment Feb 16, 2026 3:32pm
torus-bridge Ready Ready Preview, Comment Feb 16, 2026 3:32pm
torus-governance Ready Ready Preview, Comment Feb 16, 2026 3:32pm
torus-portal Ready Ready Preview, Comment Feb 16, 2026 3:32pm
torus-wallet Ready Ready Preview, Comment Feb 16, 2026 3:32pm

Request Review

* fix(swarm-api): fix permission scope (#456) (#457)

* fix(swarm-api): local permissions
@saiintbrisson saiintbrisson merged commit cd065a4 into main Feb 16, 2026
43 checks passed
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.

2 participants