This repository was archived by the owner on Oct 25, 2025. It is now read-only.
feat: add crate sdk-prover, and add functionality to get self_prog_id within #1701
Open
codeblooded1729 wants to merge 11 commits intomainfrom
Open
feat: add crate sdk-prover, and add functionality to get self_prog_id within #1701codeblooded1729 wants to merge 11 commits intomainfrom
sdk-prover, and add functionality to get self_prog_id within #1701codeblooded1729 wants to merge 11 commits intomainfrom
Conversation
3 tasks
codeblooded1729
commented
May 14, 2024
Comment on lines
+7
to
+12
| cd examples/token && \ | ||
| cargo build --bin tokenbin --release && \ | ||
| cargo run --release \ | ||
| --features="native" \ | ||
| --bin token-native \ | ||
| --target "$(rustc --verbose --version | grep host | awk '{ print $2; }')" && | ||
| cargo build --bin tokenbin --release | ||
| --target "$(rustc --verbose --version | grep host | awk '{ print $2; }')" |
Contributor
Author
There was a problem hiding this comment.
We need to build the ELF first, since we require their ProgramIdenitifier in native execution.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The PR introduces the crate
sdk-prover. The need for this crate arose from native programs requiring access to theself_prog_idof their guest programs.sdkwas insufficient in this regard, since it was hard to have it depend oncircuitsandrunner(since they themselves depend onsdk). Also, a need for a version ofsdkwas felt, which would have access to proving system (in the case ofself_prog_id, we need to have a dry run ofProgram, and tools to compute merkle caps of certain tables). Hence the crate, and its first module,prog_id_bytes.Since an
implofProgramidentifier, which createsself_prog_idout of its ELF, would create a cyclic dependency, we implement the above for a similar structProgIdinsidesdk-proverinstead, and further implement traitFrom<ProgId> for ProgramIdentifier. Now, a native program, for say token example, can getProgramIdentifierof its guest program by the following line of codeThis PR also introduces a new CLI command
self-prog-idwhich dumps the the same for givenELF. We also update theexample_prog_idfor core examples, with their correct version.First part of tracking issue #1703