[staging] Tornado Cash integration — validate before dev (reindex required)#2008
Closed
Zeugh-eth wants to merge 17 commits into
Closed
[staging] Tornado Cash integration — validate before dev (reindex required)#2008Zeugh-eth wants to merge 17 commits into
Zeugh-eth wants to merge 17 commits into
Conversation
…p roadmap Companion to INTEGRATION.md. Documents the Tornado Cash custom-governor anatomy, the indexer->API->dashboard data funnel, on-chain parameter verification, and a prioritized next-steps roadmap (proposal-target verification for the 2026-06-25 Proposal 67 attack, per-account voting power, and correctness fixes raised in review).
- Tech funnel: correct to API -> Gateful -> @anticapture/client -> Dashboard
(Kubb reads Gateful's live OpenAPI; kubb.config.ts:29-55).
- White-label: require whitelabel:{} in addition to hostnames, or the
/whitelabel/[daoId] route 404s via isWhitelabelDao (whitelabel.ts:37-41).
…kfill - delegatedSupply: note locks route to TornadoVault post-v2; indexer watches governor only (erc20.ts:150-159) -> add gap #6 (watch Vault too). - Date-scope the March 2026 backfill counts; flag proposals 66-67 (incl. the June 2026 attack) need a re-run.
- Frame Proposal 67 as a vanity-prefix spoof (shared first 15 hex chars, diverges at 16th); detector in §5 must match leading prefixes, not typos. - Funnel: state governor-only delegatedSupply today (erc20.ts:150-159) and mark TornadoVault transfer tracking as TODO (consistent with §4 gap #6).
P2 voting-power roadmap: trigger lockedBalance snapshot on BOTH RewardUpdateSuccessful and RewardUpdateFailed (updateRewards modifier emits one or the other via try/catch, but lock/unlock changes balance either way); reconcile with governor+Vault transfers for pre-v3 history.
…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.
- 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.
Tornado voting power = lockedBalance (no DelegateVotesChanged). Derive it from lock/unlock TORN Transfers in erc20.ts: - Treat governor (pre-v2) AND TornadoVault (post-v2) as lock sinks; the non-sink side is the user whose voting power changes. Fixes delegatedSupply which previously tracked governor-only and missed ~2.6M TORN in the Vault. - New lockedVotingPowerChanged handler populates accountPower.votingPower + votingPowerHistory (mirrors delegatedVotesChanged); deterministic, no hot-path RPC calls (indexer-skill safe). Requires a full reindex. Re-vote tally fix deferred (needs indexer test) — see INTEGRATION.md. Verify with the reconciliation smoke test.
TreasuryAddresses[TORN] is empty; governor commingles DAO treasury with pre-v2 user locks so its balance isn't a clean treasury figure. Document the correct approach + flag to confirm attack-profitability uses the on-chain liquid-treasury call vs the indexed metric.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
|
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. |
scripts/torn-reconcile.ts diffs each TORN datapoint against on-chain truth (params, quorum semantics, custody, per-account voting power). On-chain-only by default; full reconciliation with API_BASE set. Exit 1 on any mismatch — use as the deploy gate after reindex.
Member
Author
🔍 Proposal 67 — independent security verification (supports the launch)The attack that motivates this integration is now verified with Foundry fork tests in blockful/dao-proposals#89 (
→ Confirms protocol attack, not treasury — on-chain-verified, backing the article/thread claims. A human-readable report ( 7 fork tests, all green ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ponder.schema.tsaccountPower+votingPowerHistorytables. No new tables/columns.ponder.config.ts/config/torn.config.tssrc/indexer/torn/erc20.tsTransfer handler + neweventHandlers/delegation.tshelper)delegatedSupplynow includes the Vault and per-account voting power is derived from lock/unlock Transfers.No hot-path RPC calls were added (per the
anticapture-indexerskill).What's bundled
RESEARCH.md(anatomy, tech funnel, roadmap)Validation checklist (gate before →
dev)pnpm --filter=@anticapture/indexer typecheck && pnpm --filter=@anticapture/indexer linttorn-reconcile.tsin full mode (API_BASE=...) → 0 FAIL (esp.delegatedSupply ≈ Σ lockedBalance, sampledaccountPower.votingPower == lockedBalance(account))Deferred (notes in
apps/indexer/src/indexer/torn/INTEGRATION.md)Re-vote tally drift (needs indexer test) · treasury accounting · staking rewards · vote-extension tracking · proposal-target detector (#2005).
Whitelabel
Intended to be served via its own whitelabel frontend — requires
whitelabel: {}+hostnamesinshared/dao-config/torn.ts(see RESEARCH.md §2;hostnamesalone 404s viaisWhitelabelDao).