feat(openvm): add precompile patches#74
Conversation
@jonathanpwang, I see you released v1.3.0 a while ago -- could you rebase so we can consider merging this? I'm quite interested in giving it a spin for benchmarks. Also, we changed to a new MPT from Risc0 and more optimized inputs (here and later here), so I'm curious how this now looks in your flamegraphs if you can re-run them 🙏 |
Will do. Yes I saw the MPT and was interested to try. |
399647d to
66742a1
Compare
|
@jsign I've updated to OpenVM v1.4.0. I wasn't able to test it directly in the repo yet because the readme instructions: gave me error By the way, with OpenVM v1.4.0, the CLI and SDK both come with GPU support if feature |
|
@jonathanpwang, thanks very much! Ah, regarding Reg OpenVM v1.4.0, we just merged the support for I'm OOO until Monday, so I can do this as soon as I come back. |
|
@jonathanpwang Thanks for upgrading the patching, just ran locally and the performance looks nice! But I found that the Not sure how much it affects the performance, but I think we could integrate the current patching first, and upgrade in future PR to get the fully patched performance. |
|
@han0110 yes I noted it in the PR description. I tried to patch to 1.16 but there was some change that requires |
|
Sorry I missed that part about
Got it, sounds good! |
|
The CI job failing is expected since this is an external branch PR, so the GH repo secrets are guarded. Thanks very much again @jonathanpwang. |
@jonathanpwang do you have a link to where this is done in an optimized way? |
The latest is https://github.com/axiom-crypto/openvm-reth-benchmark/tree/main/crates/executor/client which uses a new MPT. Let me update everything to reth 1.7.0 to do a fair comparison. BTW (not really the right place to mention) - if this repo could update reth to 1.7.0, then I will prepare another PR to switch to |
|
@jonathanpwang, I'm updating our fork to latest Reth in #182 -- but found a problem with OpenVM compiler, more see comment https://github.com/eth-act/zkevm-benchmark-workload/pull/182/files#r2337888495. |
This PR adds the necessary guest setup and patches to trigger all OpenVM custom instructions and patches for ETH block validation. Updates to
openvm v1.4.0.We currently patch
revmto handle pre-compiles, but in a subsequent PR we will switch to using the newCryptoProvidertrait to be able to directly use upstreamrevm.I was not able to include the openvm
ruintpatch because it requires version to be fixed tov1.14.0but some other risc0 packages seem to require v1.15^. From previous profiling, the ruint patch is not one of the most significant patches, so it's okay to skip it for now (although performance is still best with it).We note that currently the
stateless_validationfunction has a significant performance degradation because the conversion from execution witness to MPT in the guest program is very unoptimized, compared to our current deserialization approach:Flamegraphs to be updated but we believe the performance degradation remains
deserialization approach (faster) benchmark:

The flamegraph is weighted by number of AIR trace cells, not instructions, per call stack. source
stateless_validationapproach (slower) benchmark run from this branch:Observe the large portion spent on
StatelessTrie::new(). source