-
Notifications
You must be signed in to change notification settings - Fork 59
feat: GKR LogUp #1565
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
Draft
zlangley
wants to merge
25
commits into
main
Choose a base branch
from
gkr-logup-2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
feat: GKR LogUp #1565
Conversation
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
`cargo openvm build` will use `rustup` to check if the required nightly toolchain and `rust-src` component are installed, and will install them if they are not. If this step fails, then the entire build process errors (I wasn't sure if this was the preferred behavior or if we should let the rest of the cargo build attempt continue, but it felt like for earlier stopping and debugging it's better to fail the process). Updated only the cli workflow because in multithreaded tests, I don't want it to try to install the toolchain in multiple threads simultaneously. closes INT-2911
This fix only affects logging and segmentation logic during execution under certain misconfigured parameter settings. It does not affect any circuit soundness. Fixes two separate issues around segmentation with respect to fixed-size traces: the first being that `constant_trace_height` was not implemented for some wrapper types, and the second being that `VmChipComplex::current_trace_cells` did not check if a chip had constant trace height.
The symbolic expression multiplication unit test was being run with an incorrect expected result. The test became out-of-date after #1473 changed the `max_abs` method. This PR updates the test with the correct expected result and adds the Mod Builder crate's unit tests to the CI workflow. This change has no impact on the functionality of the Mod Builder crate as it only updates the tests.
- use absolute paths for structs used only in the derive macro
This adds the ability to use different engines for proving.
- Not a soundness issue. Just an issue of `RootVerifierLocalProver` implementation in SDK. - In some edge cases, the trace heights of the root verifier circuit are less than the required heights. In this case, `RootVerifierLocalProver` should pad its traces to the required heights. - [Breaking change] Add a new field `internal_heights` into `RootVerifierProvingKey`.
Closes INT-3706 - Moved existing benchmarks to `benchmarks/prove` crate - Added a new `benchmarks/execute` binary crate that runs execution for a list of guest programs - Added programs for benchmarking in `benchmarks/guest` - Added a ci workflow to run execution benchmarks - Note: Timing metrics for summary are currently being parsed from logs. I'll change it to use proper metrics in a follow up
This PR adds a new verifier contract generation that wraps the original `snark-verifier` output (via inheritance). The goal of this wrapper `OpenVmHalo2Verifier` is to expose a more friendly interface to users that cleanly separates out the guest program public values. `OpenVmHalo2Verifier` exposes the following interface: ```solidity interface IOpenVmHalo2Verifier { function verify(bytes calldata publicValues, bytes calldata proofData, bytes32 appExeCommit, bytes32 appVmCommit) external view; } ``` - `publicValues`: The bytes revealed in the OpenVM guest program packed together. - `proofData`: Defined as `abi.encodePacked(KZG accumulators, publicValuesSuffix)` - `appExeCommit`: The commitment to the OpenVM application executable whose execution is being verified. - `appVmCommit`: The commitment to the VM configuration (aka `leaf_exe_commit`) Once received, the proof is constructed into the format expected by `snark-verifier`. The expected format is `abi.encodePacked(proofData[0:0x180], appExeCommit, appVmExeCommit, publicValuesPayload, proofData[0x180:])` where `publicValuesPayload` is a memory payload with each byte in `publicValues` separated into its own `bytes32` word. Since `OpenVmHalo2Verifier` inherits the `snark-verifier` output, the proof is forwarded via self-call. ## Verifier Generation The smart contract is written as a template that does not compile in isolation. During generation, the OpenVM SDK will fill out the maximum amount of public values and the OpenVM version with which the generation happened. Given an output folder, the relevant contracts are written into the following folder structure: ``` halo2/ ├── interfaces/ │ └── IOpenVmHalo2Verifier.sol ├── OpenVmHalo2Verifier.sol ├── Halo2Verifier.sol ``` `cargo openvm setup` will now generate this output directly into the `~/.openvm/` dir. Closes INT-3710
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.43.0 to 1.43.1. <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/tokio-rs/tokio/commit/a7b658c35bd40f6811e557aeb97cbb361b612c56"><code>a7b658c</code></a> chore: prepare Tokio v1.43.1 release</li> <li><a href="https://github.com/tokio-rs/tokio/commit/c1c8d1033d637d7027fdc137ec8008c5801cbc0d"><code>c1c8d10</code></a> Merge remote-tracking branch 'origin/tokio-1.38.x' into forward-port-1.38.x</li> <li><a href="https://github.com/tokio-rs/tokio/commit/aa303bc2051f7c21b48bb7bfcafe8fd4f39afd21"><code>aa303bc</code></a> chore: prepare Tokio v1.38.2 release</li> <li><a href="https://github.com/tokio-rs/tokio/commit/7b6ccb515ff067151ed62db835f735e5653f8784"><code>7b6ccb5</code></a> chore: backport CI fixes</li> <li><a href="https://github.com/tokio-rs/tokio/commit/4b174ce2c95fe1d1a217917db93fcc935e17e0da"><code>4b174ce</code></a> sync: fix cloning value when receiving from broadcast channel</li> <li>See full diff in <a href="https://github.com/tokio-rs/tokio/compare/tokio-1.43.0...tokio-1.43.1">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/openvm-org/openvm/network/alerts). </details> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
cc2b56a
to
87e76b4
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Bumps [crossbeam-channel](https://github.com/crossbeam-rs/crossbeam) from 0.5.14 to 0.5.15. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/crossbeam-rs/crossbeam/releases">crossbeam-channel's releases</a>.</em></p> <blockquote> <h2>crossbeam-channel 0.5.15</h2> <ul> <li>Fix regression introduced in 0.5.12 that can lead to a double free when dropping unbounded channel. (<a href="https://redirect.github.com/crossbeam-rs/crossbeam/issues/1187">#1187</a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/crossbeam-rs/crossbeam/commit/d35ffde18a76ae9667f602d8c0127ff89ac2e4d4"><code>d35ffde</code></a> Prepare for the next release</li> <li><a href="https://github.com/crossbeam-rs/crossbeam/commit/6ec74ecae896df5fc239518b45a1bfd258c9db68"><code>6ec74ec</code></a> crossbeam-channel: prevent double free on Drop (<a href="https://redirect.github.com/crossbeam-rs/crossbeam/issues/1187">#1187</a>)</li> <li>See full diff in <a href="https://github.com/crossbeam-rs/crossbeam/compare/crossbeam-channel-0.5.14...crossbeam-channel-0.5.15">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/openvm-org/openvm/network/alerts). </details> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
91e28f3
to
a60d2e9
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
e2811c7
to
904d2f5
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Introduce `AggregationTreeConfig` struct for simple configuration of aggregation tree. These were already in the provers, but not exposed to be changeable. Breaking API changes in SDK: - `AggStarkProver::new` - `ContinuationProver::new` - `Sdk` now internally contains `AggregationTreeConfig`, although `Sdk::new()` is unchanged and just sets a default Towards INT-3302
The total proving time of `num_children_internal=4` vs 3 is about the same, but 4 leads to the `internal.0` verifier circuit's size being larger than the leaf verifier, so for the sake of having smaller circuits, we switch to `3` as the default. This is configurable via CLI and SDK, so it's just a default for convenience.
aa48188
to
a6845ba
Compare
This comment has been minimized.
This comment has been minimized.
Previously we were very sloppy with enabling of features: `openvm-native-recursion` was always enabling the `snark-verifier` feature "revm" which imports a fixed version of revm only used for testing purposes. Since revm version changes rather frequently, this can cause Cargo dependency conflicts if someone wants to use the SDK with another version of revm. I've added new features "evm-prove" and "evm-verify" to `openvm-native-recursion`, `openvm-sdk`, `cargo-openvm` so that - "evm-prove" allows for generation of EVM halo2 proofs, which just enables some additional features in `snark-verifier` but no additional other dependencies. - "evm-verify" allows for revm simulation of EVM contract calls to verify halo2 proofs. This includes imports of `revm` and some `alloy` crates, with fixed versions. If you enable this feature (on by default), the revm and alloy versions will be fixed in the cargo tree. Also added some re-exported features to SDK and CLI, and switched default memory allocator to `jemalloc` since that's what we mostly use.
The circuit flamegraphs being generated were incorrect due to a bug in the multi-segment execution logic. In particular, each segment takes the metric data from the previous segment, but the first segment was using an empty metrics struct instead of being initialized with the correct `fn_bounds` data.
This comment has been minimized.
This comment has been minimized.
Commit: 2958db1 |
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.
No description provided.