Skip to content

research: on-chain gas per entry point - #51

Open
alexandre-mrt wants to merge 2 commits into
mainfrom
claude/intelligent-cannon-16r6eb
Open

research: on-chain gas per entry point#51
alexandre-mrt wants to merge 2 commits into
mainfrom
claude/intelligent-cannon-16r6eb

Conversation

@alexandre-mrt

Copy link
Copy Markdown
Owner

Summary

Queue item #1 from docs/research/EXPERIMENTS.md: on-chain gas per entry point, the one axis docs/research/BASELINE.md left BLOCKED on 2026-07-22.

  • Unblocked the sui CLI by building it from source. The network path that blocked this twice before (fullnode.testnet.sui.io) is still policy-denied in this sandbox — confirmed again tonight — but git+crates.io access was never actually tried until now. First build failed on system rustc 1.94.1 with a real compile error in consensus-core; rebuilding with the branch's own pinned rustc 1.96.1 (rust-toolchain.toml) fixed it cleanly.
  • Measured real effects.gasUsed for all 15 distinct Veil entry points against a real local Sui validator (sui start), not testnet: scripts/bench/onchain-gas.mjs, a reusable script that publishes the unmodified contracts/ package and drives every pool/compliance call with a real Groth16 proof.
  • As a side effect of having a working CLI, also ran the 124-test Move suite (BLOCKED for the same reason since 2026-07-22): 124/124 pass.
  • Full suite run clean tonight: Move 124/124, circuits (transfer/withdraw/compliance) 108/108, proof converter 109/109, compliance-utils 67/67, frontend vitest 19/19, fuzz-tests 6/6 properties.

No circuit, Move module, or proof format changed — this is a measurement night, so no new soundness/leakage analysis or negative test was needed for a circuit change (none was made).

Full writeup, raw command output, and the two toolchain-unblock rejections (bun crashes on circomlibjs's worker under singleThread, sui client publish refuses a local client env) are in docs/research/2026-09-02-onchain-gas.md.

Verdict: KEEP. docs/research/BASELINE.md, docs/research/LEDGER.md, docs/research/EXPERIMENTS.md (re-ranked — item #2, batched proof verification, was blocked on this and is now actionable), and docs/threat-model.md D3 (real griefing-cost gas number) are all updated.

Test plan

  • cd contracts && sui move test --build-env testnet — 124/124 pass
  • node --experimental-vm-modules test/{transfer,compliance,withdraw}.test.mjs — 108/108 pass
  • cd scripts && bun run src/test-converter.ts — 109/109 pass
  • cd scripts && bun run src/test-compliance-utils.ts — 67/67 pass
  • cd frontend && bunx vitest run — 19/19 pass
  • cd scripts && bun run src/fuzz-tests.ts — 6/6 properties pass
  • node scripts/bench/onchain-gas.mjs against a local Sui network — all 15 entry points recorded real gas, no failures on the final run

🤖 Generated with Claude Code

https://claude.ai/code/session_01WsuLTxuU4uGUU4vfhw3PU4


Generated by Claude Code

In progress: docs/research/2026-09-02-onchain-gas.md (queue item #1, on-chain
gas per entry point). Building the `sui` CLI from source in the background
(git+cargo reach github.com/crates.io; the sandbox's network policy still
blocks fullnode.testnet.sui.io, same as 2026-07-22) to measure real gas
against a local Sui validator instead of testnet.

scripts/bench/onchain-gas.ts drives every pool/compliance entry point with
real Groth16 proofs and records effects.gasUsed per call.

frontend/public/circuits/withdraw_vk.json was never committed alongside its
compliance/transfer siblings — a pre-existing gap, fixed in passing.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WsuLTxuU4uGUU4vfhw3PU4
Unblocks BASELINE.md's last missing axis. Built the sui CLI from source
(cargo install --git .../sui.git --branch testnet; the network path that
blocked this twice on 2026-07-22, fullnode.testnet.sui.io, is still
policy-denied, but git+crates.io access was never actually tried). First
build failed on system rustc 1.94.1 with a real consensus-core compile
error; rebuilding with the branch's own pinned rustc 1.96.1 fixed it.

scripts/bench/onchain-gas.mjs measures real effects.gasUsed for all 15
Veil entry points against a local Sui validator (test-publish
--build-env testnet, no Move.toml changes). Plain node, not bun/TS like
scripts/src/*.ts: circomlibjs's buildPoseidon() crashes bun's
worker_threads polyfill.

As a side effect of a working CLI, also ran the 124-test Move suite
(BLOCKED since 2026-07-22): 124/124 pass.

Updates docs/research/{LEDGER,EXPERIMENTS,BASELINE}.md and
docs/threat-model.md D3 with the real griefing-cost gas number. Full
writeup in docs/research/2026-09-02-onchain-gas.md.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WsuLTxuU4uGUU4vfhw3PU4
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