feat: Bridge guest program with AppCircuit-based lightweight ZK proof#71
Conversation
Add linux/arm64 platform to multi-arch build so pre-built images work natively on Apple Silicon Macs without amd64 emulation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…roof Bridge guest program uses execute_app_circuit instead of full EVM execution, reducing proof cycles from 22M+ to ~1M (22x faster). Only handles deposits, withdrawals, and ETH transfers via common handlers. Key changes: - bridge/circuit.rs: BridgeCircuit (no app-specific operations) - bridge/analyze.rs: Transaction analysis for needed accounts/storage - bridge/mod.rs: serialize_input converting ProgramInput → AppProgramInput - sp1-bridge/main.rs: Uses execute_app_circuit instead of execution_program - build.rs: Bridge ELF build support via sp1_build - compose-generator: Auto-register bridge programs from programs.toml - prover: Bridge program in registry with typeId=4 Tested: deposit 1 ETH, withdraw 0.1 ETH, SP1 proof in 238s (4 min), L1 batch verification successful. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…benchmarks Add AppCircuit pattern documentation, Cargo.lock sync requirement, analyze pattern rules (witness-safe account collection), and real performance comparison (evm-l2 vs zk-dex vs bridge). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove unused ethrex-vm dependency from sp1-bridge Cargo.toml - Add error propagation for tx.sender() failure in analyze (was silent skip) - Add version() override returning "0.1.0" Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
/gemini review |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a new bridge guest program leveraging AppCircuit-based lightweight ZK proofs, significantly improving performance compared to the existing evm-l2 program. It also enhances the deployment process with new features and options, including ARM64 Docker image support and L1 contract deployment for guest program registration. Several files were modified across different crates to implement these changes, and a comprehensive test plan was executed to verify the functionality. Highlights
Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a new lightweight ZK guest program for the bridge, which significantly improves performance by using a specialized AppCircuit instead of the full EVM execution. The benchmarks show impressive gains in proof generation time, execution cycles, and ELF size. The changes also include support for ARM64 Docker images for local development and a new dynamic loading mechanism for guest programs from the filesystem, which is a great enhancement for extensibility.
My review focuses on a few areas for improvement in the Docker Compose generator script and a minor documentation update. Specifically, I've suggested making the TOML parsing more robust, improving path handling for cross-platform compatibility, and updating a design document to reflect the final benchmarked performance improvements.
Overall, this is a solid pull request with significant performance benefits and valuable new features.
There was a problem hiding this comment.
Code Review
This pull request introduces a new lightweight ZK guest program for the bridge, which significantly improves performance. It also adds support for dynamically loading guest programs from the filesystem and improves Docker support for ARM64. The changes are well-structured and the new functionality is a great addition. My review focuses on improving the robustness and maintainability of the Docker Compose generation script, specifically around configuration parsing and error handling, and addressing code duplication.
- Log TOML parse errors instead of silently swallowing them - Add source-of-truth comment for TYPE_IDS referencing crates/l2/common/src/lib.rs - Use path.join() for cross-platform path construction - Update design doc with actual benchmark results (863KB ELF, 983K cycles)
2d0def3
into
feat/app-customized-framework
Summary
execute_app_circuitinstead of full EVMexecution_programPerformance (benchmarked)
Full flow verified
Files changed
crates/guest-program/src/programs/bridge/— BridgeCircuit, analyze, GuestProgram implcrates/guest-program/bin/sp1-bridge/— SP1 zkVM entry pointcrates/guest-program/build.rs— bridge ELF build supportcrates/l2/prover/— bridge program registrycrates/l2/common/— bridge typeId mapping (4)crates/desktop-app/local-server/lib/compose-generator.js— auto-register from programs.tomlGUEST_PROGRAM_GUIDE.md— full guide for adding new guest programsTest plan
cargo build --release --features l2,sp1withGUEST_PROGRAMS=bridgeanalyze_bridge_transactions🤖 Generated with Claude Code