fix(torn): correct quorum calc + governance-config facts (review follow-up)#2006
Conversation
…ow-up) - TORNClient.calculateQuorum: count forVotes + againstVotes (matches the on-chain Governance.state() quorum rule); update status docstring. - dao-config: proposal threshold 1,000 TORN (was 25,000); voting delay 75s (was ~1 block/12s); changeVote=true (re-voting overwrites the prior receipt on-chain). Refs review on #2002.
|
This PR was not deployed automatically as @Zeugh-eth does not have access to the Railway project. In order to get automatic PR deploys, please add @Zeugh-eth to your workspace on Railway. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2a69466b3d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
- rules.logic: "All Votes Cast" (was "For") to match calculateQuorum now counting forVotes + againstVotes — dashboard no longer explains the opposite quorum rule. - VOTE_MUTABILITY: LOW + copy reflecting that TORN allows changing votes (consistent with rules.changeVote=true); drop stale requirements. - attackExposure GOV_FRONTEND_RESILIENCE: remove the 'immutable votes' claim (votes are mutable) — keeps the unhardened-interface point.
|
Both addressed in
This makes the quickfix PR internally consistent. The deeper items (indexer re-vote tally, Vault custody, per-account voting power, target-verification detector) are tracked for the full implementation. |
|
To use Codex here, create a Codex account and connect to github. |
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
What
Small, factually-verifiable corrections to the TORN integration, split out from my review on #2002 so they're easy to review/merge. Targets
feat/tornado-cash-integrationto fold into #2002.Included (low-risk, verified against the on-chain contract)
apps/api/src/clients/torn/index.ts—calculateQuorum: countforVotes + againstVotes.Governance.state()reaches quorum onforVotes + againstVotes >= QUORUM_VOTES(both sides count), so returningforVotesalone could mislabelNO_QUORUM. Status docstring updated to match.apps/dashboard/shared/dao-config/torn.ts:PROPOSAL_THRESHOLD = 1e21).VOTING_DELAY = 75). Risk rating left HIGH — 75s is still very short.rules.changeVote: true— re-voting is allowed on-chain (_castVoteoverwrites the prior receipt while a proposal is Active).Deliberately NOT included (need your call / testing)
apps/indexer/src/indexer/torn/governor.ts: theonConflictDoNothingon(voter, proposalId)drops genuine re-votes (not just backfill replays), so tallies can drift from chain. A correct fix must stay idempotent on replay (e.g. compare storedtxHash/logIndex) — left to you since it needs an indexer run to verify.VOTE_MUTABILITYrisk field still reads "does not allow changing votes"; withchangeVotenowtrue, that field's copy/rating likely wants updating too — left as a product/risk-scoring call.rules.logic: "For"is now inconsistent with the quorum fix; "All Votes Cast" (for+against, abstain always 0) would match — didn't change it to avoid touching the enum without your confirmation.