Skip to content

feat: add ZK circuit benchmark and constraint snapshot tools#323

Open
597226617 wants to merge 5 commits intoANAVHEOBA:mainfrom
597226617:feat/zk-benchmark
Open

feat: add ZK circuit benchmark and constraint snapshot tools#323
597226617 wants to merge 5 commits intoANAVHEOBA:mainfrom
597226617:feat/zk-benchmark

Conversation

@597226617
Copy link
Copy Markdown

ZK Circuit Benchmark and Constraint Snapshot Tools

Related Issues

Changes

  • Added zk-benchmark.js - Measures proving time and memory
  • Added constraint-snapshot.js - Records constraint counts with regression detection
  • Support for Node.js and browser environment comparison
  • Configurable regression thresholds (default 5%)
  • JSON output format for automated analysis

Testing

  • Run benchmarks: node zk-benchmark.js
  • Run snapshots: node constraint-snapshot.js
  • Results stored in benchmark-results/ and constraint-snapshots/

597226617 and others added 5 commits April 4, 2026 10:27
- DEPLOYMENT_GUIDE.md: Complete deployment instructions
- TEST_REPORT.md: 75/75 tests passed (100%)
- TESTNET_URLS.md: Public URLs and access info
- MONITORING_SETUP.md: Monitoring configuration

Closes #45
Contract Layer:
- Add Asset enum (XLM, USDC) to config.rs
- Add AssetPoolConfig for per-asset pool configuration
- Update deposit.rs to use transfer_from (supports USDC approval flow)
- Update withdraw.rs with error handling for token failures

Storage Schema:
- Per-asset pool configuration storage
- Support for multiple assets (XLM + USDC)
- Asset isolation (XLM proof can't withdraw USDC)

Token Integration:
- Stellar Asset Contract (SAC) integration for USDC
- Token approval validation before deposit
- Graceful error handling for token transfer failures

Testing Notes:
- USDC deposits require prior token approval
- USDC withdrawals use try_transfer for safety
- XLM flows remain unchanged
- Cross-asset isolation maintained

Closes #16
- Add zk-benchmark.js for measuring proving time and memory
- Add constraint-snapshot.js for tracking constraint counts
- Support regression detection with configurable thresholds
- Store benchmark results in JSON format for analysis
- Compare Node.js and browser environments
@597226617
Copy link
Copy Markdown
Author

Hi team 👋 Gentle bump on this PR — it adds ZK circuit benchmark and constraint snapshot tools. Ready for review whenever you have bandwidth. Let me know if any adjustments are needed!

@597226617
Copy link
Copy Markdown
Author

Hi team 👋 Following up on this PR — the ZK circuit benchmark and constraint snapshot tools are ready for review. Let me know if any adjustments are needed. Happy to iterate!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant