Open CeciliaZ030 opened 3 weeks ago
rust-kzg compiled with modification in this crate: https://github.com/CeciliaZ030/rust-kzg
performance not looking great
2024-06-12T20:25:45.908283Z DEBUG execute: ┌╴load kzg_setting
2024-06-12T20:25:46.496903Z INFO execute: └╴7,783,656 cycles
2024-06-12T20:25:46.496969Z DEBUG execute: ┌╴read blob
2024-06-12T20:25:46.557434Z INFO execute: └╴815,690 cycles
2024-06-12T20:25:46.557497Z DEBUG execute: ┌╴blob_to_kzg_commitment_rust
2024-06-12T20:25:46.689752Z INFO execute: clk = 10000000 pc = 0x2060ac
2024-06-12T20:25:47.353332Z INFO execute: clk = 20000000 pc = 0x218b3c
2024-06-12T20:25:48.019065Z INFO execute: clk = 30000000 pc = 0x20ae70
......
024-06-12T20:34:17.819632Z INFO execute: clk = 7700000000 pc = 0x20d8cc
2024-06-12T20:34:17.902761Z INFO execute: └╴7,692,653,487 cycles
compiled scep256k1 to replace k256 https://github.com/CeciliaZ030/rust-secp256k1
sp1_zkvm::unconstrained!
to unconstraint the recovering of public key performance
2024-06-11T17:27:46.877028Z INFO execute: loading memory image
2024-06-11T17:27:46.899079Z INFO execute: starting execution
2024-06-11T17:27:46.899124Z INFO execute: clk = 0 pc = 0x202508
2024-06-11T17:27:46.899215Z DEBUG execute: ┌╴sign_recover
2024-06-11T17:27:46.926345Z DEBUG execute: │ ┌╴sign
2024-06-11T17:27:47.066870Z INFO execute: │ └╴1,101,016 cycles
2024-06-11T17:27:47.066959Z DEBUG execute: │ ┌╴recover
2024-06-11T17:27:47.372553Z INFO execute: │ └╴379,598 cycles
2024-06-11T17:27:47.372628Z INFO execute: └╴1,691,304 cycles
2024-06-11T17:27:47.373276Z INFO execute: finished execution clk = 1696694 pc = 0x0
recovering takes less than a million which is good :)
The ongoing effort of optimizing sp1 cycles: https://github.com/CeciliaZ030/block-cycles/tree/master
Latest results
Before Txs
Typical Transfer: https://etherscan.io/tx/0x61d554e035af9bcf615818c14c725c7d0b424b806e9c7b2220380b5cf7a51b5b
Swap Router https://etherscan.io/tx/0x85522ad7366e195340be6c97a036d2660e0c8b87794fc7e80176ebfa37ba63b9
Bridge Approval https://etherscan.io/tx/0x0cc57a28fb31e03a2d12b07ada3efe5bfe91aaf7dc4b4f7ffa15e51c386a7428
Dependency Changes
Unconstraint the
recover_address_from_prehash
results in 218,247 cyclesAdded ZkOp, see https://github.com/taikoxyz/raiko/pull/85
Modifications for Cycle Tracking
Some code need to be modified for printing cycles: https://succinctlabs.github.io/sp1/writing-programs/cycle-tracking.html?highlight=cycle#tracking-cycles
In raiko, need to change alloy related crates:
Also in raiko, swap revm as well:
Spam policy