-
Notifications
You must be signed in to change notification settings - Fork 337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zkVM: split binfmt feature to a new "risc0-binfmt" crate for modularity #725
Conversation
We need to drop risc0-zkvm as a dependency for risc0-build to avoid future circular dependencies. In order to do so, we introduce a new crate, risc0-binfmt that contains all code needed by risc0-build that used to be a part of risc0-zkvm. This crate contains Program, MemoryImage, and SystemState struct definitions along with several functions that operate on it.
This change removes files that implement MemoryImage, Program, SystemState, and the binfmt feature of risc0-zkvm. Instead, it uses the new risc0-binfmt crate.
0fc085a
to
84f432e
Compare
c9bcddf
to
60bd35d
Compare
Benchmark for Linux-cuda 14121a0Click to hide benchmark
Benchmark for Linux-default
Benchmark for macOS-default 14121a0Click to hide benchmark
Benchmark for macOS-metal 14121a0Click to hide benchmark
|
562db4a
to
d418cc8
Compare
Benchmark for Linux-cuda 02c1115Click to hide benchmark
Benchmark for Linux-default
Benchmark for macOS-default 02c1115Click to hide benchmark
Benchmark for macOS-metal 02c1115Click to hide benchmark
|
tracing = { version = "0.1", default-features = false, features = ["attributes"] } | ||
tracing-subscriber = { version = "0.3", features = ["env-filter"] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this related?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, So... oddly enough. This PR made this example fail on cargo test
with the following error and adding this helped the test pass. I'm not sure what exactly changed but it fails to compile without these additional deps now.
% cargo test
Compiling risc0-binfmt v0.16.1 (/Users/erik/risc0/risc0/binfmt)
Compiling risc0-build v0.16.1 (/Users/erik/risc0/risc0/build)
Compiling risc0-zkvm v0.16.1 (/Users/erik/risc0/risc0/zkvm)
Compiling digital-signature-methods v0.1.0 (/Users/erik/risc0/examples/digital-signature/methods)
Compiling digital-signature-core v0.1.0 (/Users/erik/risc0/examples/digital-signature/core)
sign: Starting build for riscv32im-risc0-zkvm-elf digital-signature-methods(build), risc0-zkvm
sign: Updating crates.io index
sign: Finished release [optimized] target(s) in 1.37s-signature-methods(build)
Compiling digital-signature v0.1.0 (/Users/erik/risc0/examples/digital-signature)
error[E0433]: failed to resolve: could not find `tracing_subscriber` in the list of imported crates
--> digital-signature/src/lib.rs:72:5
|
72 | #[test]
| ^^^^^^^ could not find `tracing_subscriber` in the list of imported crates
|
= note: this error originates in the attribute macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0433]: failed to resolve: could not find `tracing` in the list of imported crates
--> digital-signature/src/lib.rs:72:5
|
72 | #[test]
| ^^^^^^^ could not find `tracing` in the list of imported crates
|
= note: this error originates in the attribute macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)
For more information about this error, try `rustc --explain E0433`.
error: could not compile `digital-signature` due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
Benchmark for Linux-cuda 4fb7f17Click to hide benchmark
Benchmark for Linux-default
Benchmark for macOS-default 4fb7f17Click to hide benchmark
Benchmark for macOS-metal 4fb7f17Click to hide benchmark
|
Benchmark for Linux-cuda bf89333Click to hide benchmark
Benchmark for Linux-default
Benchmark for macOS-default
Benchmark for macOS-metal bf89333Click to hide benchmark
|
…ty (#725) * Add a new package risc0-binfmt We need to drop risc0-zkvm as a dependency for risc0-build to avoid future circular dependencies. In order to do so, we introduce a new crate, risc0-binfmt that contains all code needed by risc0-build that used to be a part of risc0-zkvm. This crate contains Program, MemoryImage, and SystemState struct definitions along with several functions that operate on it. * drop binfmt feature and use risc0-binfmt instead This change removes files that implement MemoryImage, Program, SystemState, and the binfmt feature of risc0-zkvm. Instead, it uses the new risc0-binfmt crate.
@@ -12,7 +12,7 @@ | |||
// See the License for the specific language governing permissions and | |||
// limitations under the License. | |||
|
|||
use alloc::collections::BTreeMap; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes risc0_zkvm
and risc0_binfmt
to be no_std
incompatible
This PR splits off the
binfmt
feature to a separate crate in order to avoid a circular dependency with a zkVM capability to be added in the near future. This capability requires risc0-zkvm to be dependent on risc0-build and the zkVM crate will contain guest code used in cases where the executor runs into a fault.