forked from risc0/risc0
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reorg to support client/server architecture (risc0#808)
## Why The zkVM is moving towards a client/server architecture for two main reasons: 1. Streamline the installation of the zkVM for most users. 2. Allow multiple versions of the zkVM (and hence circuits) to be used by clients The first is achieved by using prebuilt binaries that include HW acceleration which is usually expensive to build from source. The second is to rely on a stable interface between client and server, so that newer clients can work with older servers. Both are supported by decoupling the expensive zkVM bits from the user bits so that the dependency graph of the client is minimized. It's also possible in the future to support clients written in other languages. ## Reorg The biggest change is a reorganization of the code: * zkvm * guest * host * client * server * exec * prove ## Prover Traits The `Prover` trait has been split into `Prover` and `DynProverImpl`. There is now a distinction among client-side `Prover`s, and server-side `ProverImpl`s. A `Prover` is a higher-level interface which includes execution. A `ProverImpl` is only concerned with the proving phase. A `ProverOpts` is added to the prove functions so that users can configure the prover. Right now it only supports setting the hashing function. There are three client `Trait` impls: * Bonsai * External (calls `r0vm`, not yet complete) * Local (only available when `prove` feature is enabled). ## Feature Flags Currently the `prove` feature is enabled by default. In the future, once the `ExternalProver` is complete and it's easy for users to install the prebuilt `r0vm` via `cargo risczero install`, the `prove` feature will not be enabled by default and should only be used by `r0vm`. A new `client` feature is added to toggle support for the client-side. The intention is for `default = ["client"]` once client/server is complete. Pure verify (useful for WASM) is supported with `default-features = false`. ## Changes * `RISC0_DEV_MODE` now requires the value to be one of `["1", "true", "yes"]` to be considered enabled. * The `provers()` registry is dropped, along with `get_prover()`. Use `get_prover_impl()` to select a `ProverImpl` based on `ProverOpts`. * Drop support for low-level custom syscalls on the `ExecutorEnv`. It's difficult and potentially dangerous to expose this across the client/server interface. * Dev mode is implemented as a `ProverImpl` rather than a `Prover` so that it works independent of the hash function (or other `ProverOpts`) that are selected.
- Loading branch information
Showing
61 changed files
with
1,453 additions
and
1,347 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,4 +42,4 @@ | |
"risc0/zkvm/methods/guest/Cargo.toml", | ||
"risc0/zkvm/methods/std/Cargo.toml" | ||
] | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.