-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
perf: update risc0 prover to use k256 and keccak acceleration #450
Open
austinabell
wants to merge
12
commits into
taikoxyz:main
Choose a base branch
from
risc0-labs:risc0/1.2precompiles
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.
Conversation
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
Note: We've released |
Done in |
keroro520
approved these changes
Feb 19, 2025
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.
LGTM 👍
The cycles have been reduced by ~65% in the worst-case mainnet blocks.
keroro520
added a commit
that referenced
this pull request
Feb 19, 2025
keroro520
added a commit
that referenced
this pull request
Feb 19, 2025
* config(Cargo.toml): bump taiko-reth * config(provers/risc0/guest/): bump taiko-reth * perf(provers/sp1/guest): accelerate Secp256k1 by using k256 See also: - https://docs.succinct.xyz/docs/sp1/writing-programs/patched-crates#secp256k1-acceleration - #450 * chore(provers/sp1/guest): replace harness::entrypoint! with sp1_zkvm::entrypoint! * feat(provers/{risc0,sp1}/guest): bump guest image
keroro520
added a commit
that referenced
this pull request
Feb 19, 2025
github-merge-queue bot
pushed a commit
that referenced
this pull request
Feb 19, 2025
* update raiko to use k256 signature verification * update to use new precompiles * update to 1.2.1-rc.1 to enable keccak acceleration * consolidate keccak hashing fns to just use alloy-primitives -> tiny-keccak * remove commented out deps * update to 1.2.1 stable from rc * swap to tagged release (same commit as before) * update lockfile * update po2 for testing * bump version to 1.2.3 for paging cycle reduction * feat: support ballot (#460) * feat(host): apply reqactor,reqpool * feat(ballot): support ballot * refactor(host): remove duplicate types * feat(host): embed proof_type into response * docs(api.md): desc v2/proof * feat(core): add HostError::ZkAnyNotDrawn * feat: flag --enable-redis-pool * feat(host): serialize proof_type into lowercase * feat(host): add zk_any prover opts * feat(script): prove-block.sh zk_any * chore(reqactor): twink logs * config(host): default zk prover is network * config(host): update devnet info * feat(taskdb): add TaskStatus::ZKAnyNotDrawn * provers: update guest image * chore: apply review suggestion * chore(host): jq format config files * config: revert ethereum rpc endpoint * config(Cargo.toml): bump taiko-reth * config(provers/risc0/guest/): bump taiko-reth * perf(provers/sp1/guest): accelerate Secp256k1 by using k256 See also: - https://docs.succinct.xyz/docs/sp1/writing-programs/patched-crates#secp256k1-acceleration - #450 * chore(provers/sp1/guest): replace harness::entrypoint! with sp1_zkvm::entrypoint! * feat(provers/{risc0,sp1}/guest): bump guest image --------- Co-authored-by: Austin Abell <austinabell8@gmail.com>
# for free
to join this conversation on GitHub.
Already have an account?
# 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.
Haven't extensively benchmarked against a lot of blocks, but shaves off most cycles in the ones I have.
A subtle change that might be missed is that I switched the keccak impl in this repo to use alloy-primitives (which internally is k256) from sha3 to optimize for our use case. It is the only change that might have some impact on other provers, but also didn't make sense to me why three different implementations of secp256k1 were being used. Happy to revert that or put it behind a feature flag/cfg that's only used in our prover impl if preferred.
Pointing at this PR of reth to enable k256 taikoxyz/taiko-reth#62