Repository navigation
research: poseidon-constraint-attribution - #77
alexandre-mrt wants to merge 1 commit into
Conversation
…seidon calls Measures where transfer.circom's and compliance.circom's non-linear constraints actually come from, gadget by gadget, instead of relying on README's "four Poseidon instances dominate" claim. The depth-20 Merkle membership proof (20x Poseidon(2), not counted among the "four") turns out to be responsible for 76.0% / 81.2% of non-linear constraints respectively - the named domain-tagged Poseidon calls are only 18.0% / 14.1%. Isolated single-gadget probe circuits (scripts/bench/circuit-probes/) sum against each circuit's real recipe to reconcile exactly (0/3/0-constraint deltas) with a fresh compile, via circom2 (npm-bundled WASM circom), which this sandbox's github.com/cargo egress block made necessary and which reproduces the 2026-07-22 native-circom baseline numbers exactly. Corrects README.md and BASELINE.md, re-ranks EXPERIMENTS.md (Merkle-depth work promoted ahead of a Poseidon2 swap, which should now target the Merkle-path arity, not the named hashes), and re-confirms on-chain gas (queue item 1) still BLOCKED - now precisely, both github.com and the Sui RPC host return 403 from the sandbox's egress allowlist. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016Kg1ZFhKEHbxyx3JwiqEh5
|
CI is red on this PR (3 of 4 jobs), but both failures are pre-existing and unrelated to this PR's diff — this PR touches only 1. Confirmed this is not caused by this PR: the exact same failure, on the exact same two jobs, reproduces on 2. This same URL also returns 403 from my own sandbox tonight (see this PR's report, No production code, circuit, or CI config was touched by this PR, so I'm not pushing a fix for either — both are infrastructure/CI-config issues that predate and are independent of this change. Will keep watching this PR. Generated by Claude Code |
Summary
Tonight's nightly research-loop run. Queue item #1 (on-chain gas per entry point) was re-attempted first and re-confirmed BLOCKED — this sandbox's egress proxy returns 403 for both
github.com(needed for asuiCLI release) andfullnode.testnet.sui.io(a fallback JSON-RPC read), an org-level allowlist denial rather than a per-tool prompt this time. Per the sandbox's own proxy docs, that's not retried or routed around, so the run moved to the next un-settled queue item.That turned into this experiment: the depth-20 Merkle membership proof, not the "four named Poseidon instances" README credits, is the dominant non-linear-constraint cost in
transfer.circomandcompliance.circom.scripts/bench/circuit-probes/*.circom) and a reusable script (scripts/bench/constraint-attribution.mjs) that compiles each probe plus fresh copies of all three production circuits, then reconciles a hand-written per-circuit "recipe" against the real compiled total.transfer.circom's and 81.2% ofcompliance.circom's non-linear constraints, vs. only 18.0%/14.1% for the named domain-tagged Poseidon calls.withdraw.circom(no Merkle path) is the one place the README's original claim holds (78.0%).Poseidon(2)+ 2 forMultiMux1(2)'s selection + 1 boolean check), architecture-fixed — a real number for the queue's Merkle-depth-vs-anonymity-set item to compute against instead of guessing.circom2(npm-bundled WASM build of the real Rust circom compiler) sincegithub.com/cargo's crate host are blocked here — it reproduces the 2026-07-22 baseline's native-circomconstraint counts exactly, a useful fallback for future nights hitting the same block.Docs updated:
README.mdanddocs/research/BASELINE.mdcorrected (the "four Poseidon instances dominate" claim was materially misleading for two of the three circuits),docs/research/EXPERIMENTS.mdre-ranked (Merkle-depth work promoted ahead of a Poseidon2 swap; Poseidon2 re-targeted at the Merkle-path arity, not the named hashes),docs/research/LEDGER.mdappended, full write-up indocs/research/2026-09-27-poseidon-constraint-attribution.md.No circuit, Move module, or frontend proving code was modified — this is a measurement/attribution night only.
Test plan
node --experimental-vm-modules test/{transfer,compliance,withdraw}.test.mjs— 108/108 pass (fallback/simulated mode — real-proof mode needs the pot15 ptau file, andstorage.googleapis.comis also blocked in this sandbox; a new, previously-unseen blocked host, recorded honestly inBASELINE.md)cd scripts && bun run src/test-converter.ts— 109/109 passcd scripts && bun run src/test-compliance-utils.ts— 67/67 passcd frontend && bun run test— 19/19 passcd contracts && sui move test— NOT RUN,suiCLI unavailable (same blocker as queue item feat: Veil privacy payment protocol — full stack MVP #1); no contract code changedcd scripts/bench && npm install && node constraint-attribution.mjs— reproduces the numbers in this PR's report exactly🤖 Generated with Claude Code
https://claude.ai/code/session_016Kg1ZFhKEHbxyx3JwiqEh5
Generated by Claude Code