Skip to content

feat: Generate flamegraph with metrics from Prometheus server #1602

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
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

manh9203
Copy link
Contributor

Add a Python script to generate flamegraph from metrics scraped by Prometheus server

This comment has been minimized.

This comment has been minimized.

HrikB and others added 7 commits May 7, 2025 14:24
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
@manh9203 manh9203 force-pushed the feat/metrics-export-prometheus branch from 8a65ed8 to 5f2e75d Compare May 7, 2025 18:29

This comment has been minimized.

Copy link

github-actions bot commented May 7, 2025

group app.proof_time_ms app.cycles app.cells_used leaf.proof_time_ms leaf.cycles leaf.cells_used
verify_fibair (-38 [-3.2%]) 1,164 334,142 17,677,298 - - -
fibonacci (-62 [-2.5%]) 2,456 1,500,277 50,589,503 - - -
regex (-47 [-0.6%]) 7,450 4,165,226 166,511,152 - - -
ecrecover (-24 [-1.7%]) 1,381 289,447 14,470,186 - - -
pairing (+50 [+1.1%]) 4,538 1,820,436 95,832,407 - - -

Commit: 8db0db2

Benchmark Workflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants