research: on-chain gas per entry point - #51
Open
alexandre-mrt wants to merge 2 commits into
Open
Conversation
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
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.
Summary
Queue item #1 from
docs/research/EXPERIMENTS.md: on-chain gas per entry point, the one axisdocs/research/BASELINE.mdleft BLOCKED on 2026-07-22.suiCLI 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 — butgit+crates.ioaccess was never actually tried until now. First build failed on system rustc 1.94.1 with a real compile error inconsensus-core; rebuilding with the branch's own pinned rustc 1.96.1 (rust-toolchain.toml) fixed it cleanly.effects.gasUsedfor 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 unmodifiedcontracts/package and drives every pool/compliance call with a real Groth16 proof.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 undersingleThread,sui client publishrefuses alocalclient env) are indocs/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), anddocs/threat-model.mdD3 (real griefing-cost gas number) are all updated.Test plan
cd contracts && sui move test --build-env testnet— 124/124 passnode --experimental-vm-modules test/{transfer,compliance,withdraw}.test.mjs— 108/108 passcd scripts && bun run src/test-converter.ts— 109/109 passcd scripts && bun run src/test-compliance-utils.ts— 67/67 passcd frontend && bunx vitest run— 19/19 passcd scripts && bun run src/fuzz-tests.ts— 6/6 properties passnode scripts/bench/onchain-gas.mjsagainst 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