build(examples): standardize example workflow around ELF binaries, remove unused .bin artifacts#24
Merged
this-vishalsingh merged 1 commit intoMay 1, 2026
Conversation
There was a problem hiding this comment.
Pull request overview
This PR standardizes the examples workflow to use ELF binaries end-to-end (aligning with ElfLoader requirements), removes the unused .bin artifacts, and updates CLI/docs so examples can be proved by name instead of requiring a pre-stripped raw binary.
Changes:
- Remove
objcopy/raw.bingeneration from example build workflow and delete committed.binartifacts. - Add CLI path fallback to resolve
--bin <example-name>to the corresponding compiled ELF underexamples/target/.../release/. - Update example documentation and
.gitignoreto reflect the ELF-only flow and ignore generated proofs.
Reviewed changes
Copilot reviewed 9 out of 35 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
crates/cli/src/main.rs |
Adds fallback resolution for prove --bin <name> into the examples ELF output directory. |
examples/build_all.sh |
Stops generating .bin files; now builds ELF artifacts only and prints ELF sizes. |
examples/README.md |
Updates example commands to remove objcopy and use prove --bin <name> (but needs follow-up consistency fixes). |
examples/fibonacci/README.md |
Updates build/run instructions to use ELF-only proving flow. |
examples/keccak/README.md |
Updates build/run instructions to use ELF-only proving flow. |
examples/sha256/README.md |
Updates build/run instructions to use ELF-only proving flow. |
examples/memory-test/README.md |
Updates build/run instructions to use ELF-only proving flow. |
examples/ecrecover/README.md |
Updates build/run instructions to use ELF-only proving flow. |
.gitignore |
Ignores /proofs output directory. |
.vscode/settings.json |
Removes editor-specific settings file from the repo. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Motivation
The example docs and
build_all.shinstructed users to strip ELF headers withobjcopy, producing raw.binfiles. However,zp1-executor'sElfLoaderrequires ELF headers to load memory segments — passing a stripped binary causes anInvalid ELF file: Invalid magicerror.More importantly, no code in the repository ever consumed these
.binfiles. They were being generated, committed, and maintained purely as a side-effect of a build step that served no purpose. This PR removes theobjcopystep, the.binfiles it generated, and the documentation referencing both.Key Changes
CLI & Execution
crates/cli/src/main.rsnow resolves bare example names to their compiled ELF artifacts attarget/riscv32im-unknown-none-elf/release/<name>, socargo run --release -- prove --bin fibonacciworks without specifying the full path.Build Tooling
objcopyrequirement:examples/build_all.shno longer requires LLVM/binutils. It builds and verifies ELF binaries only.Cleanup & Documentation
.binfiles from example directories — these were unused artifacts with no consumers anywhere in the codebase.README.mdand individual example docs to reflect the simplified CLI usage..gitignoreto excludeproofs/and other transient build artifacts.Verification
build_all.shforriscv32im-unknown-none-elf.ElfLoadercorrectly parses headers and memory segments from unstripped ELF files.cargo run --release -- prove --bin fibonacciresolves the ELF path and proves successfully end-to-end.cargo test --workspace(162 prover tests + 16 integration tests).