From 9eb6e1f38d898ce024decd0b5ec2bf5a630451a7 Mon Sep 17 00:00:00 2001 From: Steven Gu Date: Thu, 31 Aug 2023 19:22:28 +0800 Subject: [PATCH] Read VKs from files when init. --- bin/src/zkevm_prove.rs | 7 +- prover/configs/simple_trace.json | 264 ------------------------------ prover/src/aggregator/prover.rs | 28 ++-- prover/src/aggregator/verifier.rs | 22 +-- prover/src/consts.rs | 11 ++ prover/src/io.rs | 15 ++ prover/src/lib.rs | 1 + prover/src/test_util.rs | 4 +- prover/src/zkevm/prover.rs | 34 ++-- prover/src/zkevm/verifier.rs | 17 +- prover/tests/aggregation_tests.rs | 7 +- prover/tests/chunk_tests.rs | 12 +- 12 files changed, 79 insertions(+), 343 deletions(-) delete mode 100644 prover/configs/simple_trace.json create mode 100644 prover/src/consts.rs diff --git a/bin/src/zkevm_prove.rs b/bin/src/zkevm_prove.rs index cb86950a4..c1e09f611 100644 --- a/bin/src/zkevm_prove.rs +++ b/bin/src/zkevm_prove.rs @@ -8,9 +8,12 @@ use std::{env, fs, path::PathBuf, time::Instant}; #[derive(Parser, Debug)] #[clap(author, version, about, long_about = None)] struct Args { - /// Get params and write into file. + /// Get params dir path. #[clap(short, long = "params", default_value = "test_params")] params_path: String, + /// Get asserts dir path. + #[clap(short, long = "assets", default_value = "test_assets")] + assets_path: String, /// Get BlockTrace from file or dir. #[clap( short, @@ -27,7 +30,7 @@ fn main() { log::info!("Initialized ENV and created output-dir {output_dir}"); let args = Args::parse(); - let mut prover = Prover::from_params_dir(&args.params_path, false, None); + let mut prover = Prover::from_dirs(&args.params_path, &args.assets_path); let mut traces = Vec::new(); let trace_path = PathBuf::from(&args.trace_path); diff --git a/prover/configs/simple_trace.json b/prover/configs/simple_trace.json deleted file mode 100644 index e59aa1a3b..000000000 --- a/prover/configs/simple_trace.json +++ /dev/null @@ -1,264 +0,0 @@ -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "chainID": 534351, - "version": "4.3.36-sepolia-30271119", - "coinbase": { - "address": "0x5300000000000000000000000000000000000005", - "nonce": 0, - "balance": "0x11027e6d744fffec5", - "keccakCodeHash": "0xc6302b4e19ce255ee20c79a805220d586dd47ed32dc0ee3912a4876e98632821", - "poseidonCodeHash": "0x263ce5f9c3abbbeafc527b525a0b9f7dae7c00dccc0cb0c1621690ab13ae0ed4", - "codeSize": 1804 - }, - "header": { - "parentHash": "0xd15ed261b182478bcf25567355f83cf051af65af5b28897401e9b686daa6f5fc", - "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", - "miner": "0x0000000000000000000000000000000000000000", - "stateRoot": "0x25b5dbd18aa970c7856935b986e1e03299fb1a1c9d34067a31c1c73a6249eafa", - "transactionsRoot": "0xcc6733003bb3a6d4753a48fecf24c5e38d1fc78b6b9e0ad9f25020afee0e452a", - "receiptsRoot": "0x056b23fbba480696b65fe5a59b8f2148a1299103c4f57df839233af2cf4ca2d2", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "difficulty": "0x2", - "number": "0x3395", - "gasLimit": "0x7a1200", - "gasUsed": "0x5208", - "timestamp": "0x64de5778", - "extraData": "0xd883040325846765746888676f312e31392e31856c696e757800000000000000ba91f0020465b11c300cb78232891ce0866b3fa905b0757637e2a9d4cb578107411ebec1a31b6deafdb8b27243bcd962cde8cbf5d7e285fb26d39a78e8bd69be00", - "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "nonce": "0x0000000000000000", - "baseFeePerGas": null, - "withdrawalsRoot": null, - "hash": "0x41bec692d83b9c8c8cf35c6cb7ebcdc4d0ff04263fc41fb68981b532287643e2" - }, - "transactions": [ - { - "type": 0, - "nonce": 0, - "txHash": "0xf5f9de06fdb55c52e55f686b4222db84d769274c7a79dd6bc442953f4eedef4b", - "gas": 21000, - "gasPrice": "0x249f00", - "from": "0x293f9587ba6d3624abd648672428e608a36786ea", - "to": "0x293f9587ba6d3624abd648672428e608a36786ea", - "chainId": "0x8274f", - "value": "0x16345785d8a0000", - "data": "0x", - "isCreate": false, - "v": "0x104ec2", - "r": "0x8961c89cfe5aec652e2454f887519b5bca2807f299d93752f6b5ebdbec61e928", - "s": "0x66b17cdf9e8839559595f32134a1db01bbbc706b5f4a34eb487efab8fe58546" - } - ], - "storageTrace": { - "rootBefore": "0x145fe57cdfe23c4c0c912336ab50f5e4c1f81937119012bfbb03c4f43e3a2b72", - "rootAfter": "0x25b5dbd18aa970c7856935b986e1e03299fb1a1c9d34067a31c1c73a6249eafa", - "proofs": { - "0x293F9587bA6d3624Abd648672428E608a36786EA": [ - "0x09231c47ddb0c053568721f6c0353242bc7b5a1c0df10313177dc1e74b276faa2c04d2e91730f5101800189436ff5787024849f2793530b45b90924bcf983ff0e6", - "0x091d7fb902c5eb4ff3260d063e26bc3c5ce2be1047b76d934b3b7fd70507b2e3f42b0ca7927cb12208703d723c3cab6d521471ce72b3b8905d7f4a25758dbeda1e", - "0x090131b1d02490bea65fd01440883f72d5cba9b65f9afd2c7ae8184f404611728d0cc00d34005bc36fdbc6d0b8c297535a18d333aee233a64301090d0cedb9c794", - "0x09116db93cd66e4cf635ed53210c9c7ceb3f341836ec2decca7f6c0095f001eb8d2d26ad5edb662cc7025becc95e28649147936b9d3d12ae631009a01cfbde5a5a", - "0x0900c93c6fdfd6c9edefb96e3d2759b63f850a6b5423ab5d490f8c720e94b033532b21eceb6a06e349cd5d02209b3eccd298861b76779287367170fbc9fb8f6349", - "0x091db20b80f4a409a9d96302f7100949680fb9c572197bc0a3022d51c8498f9fcc1af3c9b2d2de3c443a00109be8b97e9c87bb02b9c74fbd3ae6106a001c186093", - "0x092dc75dd7870f92d804744b0df533a75c1895ccf84a19fe9225ff95d116ecbb381f83830f17b2249e0f8d46e1e22ac652118e14cf6aaf24a3a89cb678b92001f8", - "0x09123616c275b1ac501d982980203896ac42498d3a84d6ce0df1b8a0cdc4d8fefe1008609545ae3b201d087150e37ebb0d3370133210f38fae6342c37091db314f", - "0x092679d3397599592c376b92c4af4ac03233f171e39cf57a272eac3ca77e01659d1bc186f896d23c28d459effa0ff9864bc3679fc99548eeaffb1be24a2a7ac150", - "0x092b03449c2bbab44fae2afb43164f1656c3219dfb06cf68623baa2ff3b3d991130d86b432c7ef866156dcc2fba01e96e5adc83a185002afc8f30642a88e924367", - "0x092496edc7b81f67e73e674640db77ce7255bfd6b26a27227f322955fa5ec3e3730f8d392b02a8ec5896e486ee7780bd56d31caba345df529bec7245b62cdc57fb", - "0x0617d3eb0986210134ee7c9197f3a6b0fdbde6f08f73205e669c74251f5e7749cf0f7e226e94a06aefc5a74feda6f077e57d3b83a7c76d6b8f32dc6533049cbae8", - "0x040c6edd4d48b61c0114d3f3d41f63f6955acc21ea4a283158ff9373012456c8cd0508000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000000000000000000c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4702098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b6486420293f9587ba6d3624abd648672428e608a36786ea000000000000000000000000", - "0x5448495320495320534f4d45204d4147494320425954455320464f5220534d54206d3172525867503278704449" - ], - "0x5300000000000000000000000000000000000000": [ - "0x09231c47ddb0c053568721f6c0353242bc7b5a1c0df10313177dc1e74b276faa2c04d2e91730f5101800189436ff5787024849f2793530b45b90924bcf983ff0e6", - "0x092b705ddc8d291758aae9e5bcf2c75c974d7ea4139404dc24f2b21c5da0c1b86516678e0d975396177fbd0bb1f57bd1d469367e62ac0f36d546a8e26e14ec2425", - "0x090b8c84c32278fe3ca11eb30efbf8737861666e7fdfe7e07a24169b9a0b87e59727ae16e85f2a5ab7ad40d82f114ac8c12eab9ff3ba8885be15ffdfe9a4d234c4", - "0x0926c225e2fd0876f9d93c4ad5bbd8d506eca0306098f0ff84bfa50f0769d7e088275e3ec0040c73736a668d31c136ed6d2c54f20db4a7daecc91ae25510f30ace", - "0x090ab58a98d18ce61d398a8e81d208bab7154e268abef091801bb33c3dd66c9e032a1268099ccbdeea8d639a3b077c08506b36f932440e797e3b9439eff792fd11", - "0x09132cf1c5477a3c4c9e476661de966f9e7ec379f1900268e2ab7aeda04df54ccd14de7b3530c8ac139c4b540ed4bdec35f27bd5a417224b0081995c14b49de15c", - "0x0927b3f4fa9bfcd6fcf740b1919b5f7c9c67a36262b52e4be2ab298fc18a795281186e7507a255142ffa77839db402955bceee8961ee960cc36abc436a1616be05", - "0x0904057c45fff290477bd1ac2493191e9a49929dfb81c3054e52ce0f1f6e236c0f099aeb646b7a057ea2c3c395880e76de9bb27f265852ee43a3ea059872077323", - "0x090cc100d5a1a3678b4fef57ae9ac0b0fc51655a5bd71373188c7a441ad0f0b48617edebafcefe92f1edd7b08fdd65ea1599b243949281b604e9931452ed455c2d", - "0x09182b529a26eba5c7b1e6766ad7e16423353b2d2d1bb8ddb81d51c8e66a4652701456faacd8f287271e4338ac92d2a50df2203e63e635c6e52cd0685dae4de9b9", - "0x0920c23d5996f7115eaf3a04acfe212be7a45b44b63aeaed47c246410d56f808681b00a0ded27e61b38b40665714db557e38c15b21df2b705d778687c0f3ab78d0", - "0x0815bba87bb49ba3916b436c0145f45f0958675fabb6525310cc2cd7f7c9af91080000000000000000000000000000000000000000000000000000000000000000", - "0x081a4b03c8bb6de7f4cd23186fb462656cca3c7294f2c603e82de7ac3316f0245a0fc45a8b3062cc8487114a053fed7dffa298bebce35198f3e6e71ec4ab636d45", - "0x07000000000000000000000000000000000000000000000000000000000000000013022b27d13ab3372d977dff2442dd20559d81413df7360c60b4cff57feb1de7", - "0x0629991362ca3fe9b2d8828e4ffb4ebb3f2eb8ba66f869f88ff81d474e77b67e850ef0b76af5cc11634f7b3fd495340ba8d216133d68d5efff6b547f4e55ab7fa1", - "0x0408389bdcf35fead34d26ac16f4638b31e82714ffb6d7c083a1afda53ed6d240e0508000000000000000000000000000000000000000000000000068000000000000000000000000000000000000000000000000000000000000000000000000000000000273ccbec6cfb95753eb132efa09bc7ed3590ce546d390bfad84a86b5e9c603157f6f0daf66a63b4d504fabde8e9fa491ff678bf22082d8fee03ac3064fcf7de9083c136cb0e27c3434a6f2b4839eac2167e39fd4c47a0a83923668e3abcf3b08205300000000000000000000000000000000000000000000000000000000000000", - "0x5448495320495320534f4d45204d4147494320425954455320464f5220534d54206d3172525867503278704449" - ], - "0x5300000000000000000000000000000000000002": [ - "0x09231c47ddb0c053568721f6c0353242bc7b5a1c0df10313177dc1e74b276faa2c04d2e91730f5101800189436ff5787024849f2793530b45b90924bcf983ff0e6", - "0x091d7fb902c5eb4ff3260d063e26bc3c5ce2be1047b76d934b3b7fd70507b2e3f42b0ca7927cb12208703d723c3cab6d521471ce72b3b8905d7f4a25758dbeda1e", - "0x090131b1d02490bea65fd01440883f72d5cba9b65f9afd2c7ae8184f404611728d0cc00d34005bc36fdbc6d0b8c297535a18d333aee233a64301090d0cedb9c794", - "0x092c088d21dad04812c5d11f3657413417fc9178c80956b3607e0ed38cad10113222f1e06cf539cdf8d5fc53ffdc0b80241aec7d0224228e13281a2af96b130175", - "0x091f1bccd0f48799d08563e57d0c425d2830331f67ad8a0cd99bf6d60b381fb66300f05e85569295edb6e2e4c6c2f5cf2300afa117aa373ecf28233e121c3deaa4", - "0x0903c81689ca46451e499162a4826b500048d798de09542b2bf1c920fd0f5d0cb61d22bb1351176d9a34d541f4a0fbfd1e542df9cb8b93117cdd8448a5ead900c3", - "0x091ce888b4114b3a3dc507e8c2dcac6fe7611715696f1e2abcf7308b25770059282a756a2c457e7adab09717588523c6afad33996c92227279daeb7a2350c1bd8a", - "0x092a357f544966df20d487e6a9137baba7c9f4f2cbbc9c6504f91e9b05a097cd272caa2eccaec539ebb27c02f02f9c5fa294e6eea85840ad64aeb295a3d08de6a1", - "0x0929eff3e3324a526fef7f6001d4b432a7e14f7f1526884fa98c2c095deec2771c0fe9042465cc556759078ea7599257261b9b34b09a997729224cc37a4be21b3b", - "0x070e49ad92ff0fde4a94814c096c2fcc9f70739ac4623faa6ccc658655b6c7cc842c43fe857ecd7adfc3a30029bb9108ba43723610875e634eacb10dedec5313b7", - "0x04139a6815e4d1fb05c969e6a8036aa5cc06b88751d713326d681bd90448ea64c9050800000000000000000000000000000000000000000000000008750000000000000000000000000000000000000000000000000000000000000000000000000000000008d37dc1afc59c05a46c865e00e680ef5d1fda7e569b49b7e7083c7d8aa4a2b138e66819fc6ce53c2e63f85399df2b2923de67d65d7111243d96d72598dfc7b40b6636ddc9b66ff9d1b34b9eed57f652be4f18f3469c686fb80c513c99b31269205300000000000000000000000000000000000002000000000000000000000000", - "0x5448495320495320534f4d45204d4147494320425954455320464f5220534d54206d3172525867503278704449" - ], - "0x5300000000000000000000000000000000000005": [ - "0x09231c47ddb0c053568721f6c0353242bc7b5a1c0df10313177dc1e74b276faa2c04d2e91730f5101800189436ff5787024849f2793530b45b90924bcf983ff0e6", - "0x091d7fb902c5eb4ff3260d063e26bc3c5ce2be1047b76d934b3b7fd70507b2e3f42b0ca7927cb12208703d723c3cab6d521471ce72b3b8905d7f4a25758dbeda1e", - "0x090131b1d02490bea65fd01440883f72d5cba9b65f9afd2c7ae8184f404611728d0cc00d34005bc36fdbc6d0b8c297535a18d333aee233a64301090d0cedb9c794", - "0x092c088d21dad04812c5d11f3657413417fc9178c80956b3607e0ed38cad10113222f1e06cf539cdf8d5fc53ffdc0b80241aec7d0224228e13281a2af96b130175", - "0x092f9cd5dbb545288ebef2ff64150f82705dd958aa2585a217765f0f4613bec0e63025da172451f519936e1cab88a18320f7b30926c69bd4e9c5669e3f602a1206", - "0x090bade73cb9e022b33dcae5bbf1c6729de308a742cb6b8da2bb6a68ef5a5b05a20ea080a5f83379f12a869ee25d62d5eb085833a95cfeb6b950a3f67139198abd", - "0x092e194247f5d0e3ebbbe7864c5faba72fb98dfbe93d1b19abe7d59f3a0d29f8101c3c95889c38683ffa8af03a5927b5bbf683c34be67a933d01b81190e8a44464", - "0x09010903bf75f61137b5a3c1e11986ace94af35dd5f174e445c2369e65ba703fbe1d082f12dcf52c100d77c768626930747798cc61ee942f19b8f92a893b1686f0", - "0x0923f2348cac7a8270ee159299d78f85392a60e888e7fef0028bc9719d0599f8fd2b5eae7891284b3b6e6b7f105bb77a772475bf800376d22df1206fce1380ffec", - "0x0906b6b6331e77c6d27e574dbcdc9ff7c27e90d7c73bd41b66e2be371fcb03e99c1da8637113514056a5ebb7e1ee460f1ab5b208d77984a076d240aaea3e7d7ed4", - "0x09019cd49766f1bb8c9619165d95cbc8facbd85574e448d62509123eccafaf0ef30ff6e94cd22b65c156a1647afe32f91ce4207dd706aea82b5258bff067aa9be7", - "0x0824f43495b1ba4e7228d55dc717b030b0fa13896bd3a734bfef67c23b8b87294e0069e600590724581f9e58e48034f5ff69c42e973a09ddaa779ac39281aaee96", - "0x062d3d107ea28c4f96516d033c597df368b122d254afa21b3a3af8abd06d8923cd27e0c9270e2f98cf2210f566fc7a0fb1fd164a30e71a70e5d6952b0fefe473f2", - "0x04287b801ba8950befe82147f88e71eff6b85eb921845d754c9c2a165a4ec867910508000000000000000000000000000000000000000000000000070c00000000000000000000000000000000000000000000000000000000000000011027aff22f27a2d718c61ad42281daa1300f867c71a2aa0feef086fdca13890def9917113816eb6dc6302b4e19ce255ee20c79a805220d586dd47ed32dc0ee3912a4876e98632821263ce5f9c3abbbeafc527b525a0b9f7dae7c00dccc0cb0c1621690ab13ae0ed4205300000000000000000000000000000000000005000000000000000000000000", - "0x5448495320495320534f4d45204d4147494320425954455320464f5220534d54206d3172525867503278704449" - ] - }, - "storageProofs": { - "0x5300000000000000000000000000000000000000": { - "0x0000000000000000000000000000000000000000000000000000000000000000": [ - "0x0928c1b4475db146107d12e2e1dd2f4f85f0335adc7ac1ee1ca337ac85ba6ddd030e7221bc5fd3619eeb7826296ca68c3a6917541211714de749e2a4942286fb00", - "0x092f6fe06017ea164d5c4634116c25d75c2a902508081266b6b2e6263f2fa64d092a42d6ad0521264f2a51177b6e9858d570da9babafbcd60a1ff4557aab9df364", - "0x090c7c7411c493a49d6ba8dd17a73473db234b6fea4edd5139d50a1fdddc10243e19023d7fb7e36d95307f3b7d63c7016b2344a9f7e3ebd88490ff6206782d3354", - "0x090c3319b07a9ea4c8e53cb66755550ae46c8b03b7465cf58b5f53e9431f84d2fa06d8c47c51d33148006643e11d0154aab6a34445a21ec63554987052cac95e2d", - "0x072a3417f07098c7623284823416cca5b5b3ea1386b4b76c3b73162daf92562e80133396cd9b7b89b12189622f7b2635fd6d29e6b3bda90a8778bf0ea385ca1cdb", - "0x041d3c5f8c36e5da873d45bfa1d2399a572ac77493ec089cbf88a37b9e944284220101000020cae976896ee7f4e4d031cb49dbd7fe75ccb8f842c1537f9e77e6cda93bbd9e200000000000000000000000000000000000000000000000000000000000000000", - "0x5448495320495320534f4d45204d4147494320425954455320464f5220534d54206d3172525867503278704449" - ] - }, - "0x5300000000000000000000000000000000000002": { - "0x0000000000000000000000000000000000000000000000000000000000000001": [ - "0x0806b33a7f09734bfe1766838f3b9a7e787e082b7e0d1f71b944754fab890d32d719c4b6fecc8df35dbeb90e48cc838e8df15c05c37230403e144af7dfd0ad7e6e", - "0x0827939df271359b10625095c98155c197163484591876ae50bb5e5038e128f7d2104683de906bc930ed2e820251ccabeb0302ec9e481934ff4e09642df724360b", - "0x080964404fbf47c56555c3b0ad50ed3d056c75c0fd7c6f5f45aaa35cba700f99de2c60e31a75eefcdc66dad994396a7e42327a2fd04d5f2628a7efd06bfe288b1b", - "0x0819ae3c28bf8f005032bf57f1487e3a00242c87c1ca79147e7955eafc543d47f30000000000000000000000000000000000000000000000000000000000000000", - "0x0700000000000000000000000000000000000000000000000000000000000000000d373198dbb4e4f57f3b4ad0df77881f63081474a9b88d3d68bf9c51dd9147a0", - "0x0807f400fdc8390d777981fe0778b173b3f6b7598d3c4a65bde149ad8e506974a20000000000000000000000000000000000000000000000000000000000000000", - "0x0700000000000000000000000000000000000000000000000000000000000000002c1a982743c3efe6b7c5e5a4762eee6fa67d14caa96e9104d0f6bf630af59c4d", - "0x08001b5177c3d030cd54cefe54e729be678118c109e1b8200d652b672a59906f520000000000000000000000000000000000000000000000000000000000000000", - "0x08288a9886eedc09f797e7309ff4819600e67fe61720efdb23e949705a7c3bb25b0000000000000000000000000000000000000000000000000000000000000000", - "0x07000000000000000000000000000000000000000000000000000000000000000026bc416c5e2edcb46869614d12adce4c5a05097ffdcf2479b93e07f888539afd", - "0x061ec8cf21010fad928573d381dd513faa13b896e3d94346c8a8e051a67a4e86cc15914a13b341cda11357b40e82430e9fd9b52bd7c53357fd2c4545ecfe03952f", - "0x0426049ba6de63003492eb078a01a8aa4f4a0e67f28f0955c2eba9101d5d2eea5001010000000000000000000000000000000000000000000000000000000000016d054416200000000000000000000000000000000000000000000000000000000000000001", - "0x5448495320495320534f4d45204d4147494320425954455320464f5220534d54206d3172525867503278704449" - ], - "0x0000000000000000000000000000000000000000000000000000000000000002": [ - "0x0806b33a7f09734bfe1766838f3b9a7e787e082b7e0d1f71b944754fab890d32d719c4b6fecc8df35dbeb90e48cc838e8df15c05c37230403e144af7dfd0ad7e6e", - "0x0827939df271359b10625095c98155c197163484591876ae50bb5e5038e128f7d2104683de906bc930ed2e820251ccabeb0302ec9e481934ff4e09642df724360b", - "0x080964404fbf47c56555c3b0ad50ed3d056c75c0fd7c6f5f45aaa35cba700f99de2c60e31a75eefcdc66dad994396a7e42327a2fd04d5f2628a7efd06bfe288b1b", - "0x04020953ad52de135367a1ba2629636216ed5174cce5629d11b5d97fe733f07dcc0101000000000000000000000000000000000000000000000000000000000000000017d4200000000000000000000000000000000000000000000000000000000000000002", - "0x5448495320495320534f4d45204d4147494320425954455320464f5220534d54206d3172525867503278704449" - ], - "0x0000000000000000000000000000000000000000000000000000000000000003": [ - "0x0806b33a7f09734bfe1766838f3b9a7e787e082b7e0d1f71b944754fab890d32d719c4b6fecc8df35dbeb90e48cc838e8df15c05c37230403e144af7dfd0ad7e6e", - "0x0406c50541f08911ad149aa545dd3d606f86ee63c751a795c7d57f0d3f85e6bdeb01010000000000000000000000000000000000000000000000000000000000004a42fc80200000000000000000000000000000000000000000000000000000000000000003", - "0x5448495320495320534f4d45204d4147494320425954455320464f5220534d54206d3172525867503278704449" - ] - } - } - }, - "txStorageTraces": [ - { - "rootBefore": "0x145fe57cdfe23c4c0c912336ab50f5e4c1f81937119012bfbb03c4f43e3a2b72", - "rootAfter": "0x0000000000000000000000000000000000000000000000000000000000000000", - "proofs": { - "0x293F9587bA6d3624Abd648672428E608a36786EA": [ - "0x09231c47ddb0c053568721f6c0353242bc7b5a1c0df10313177dc1e74b276faa2c04d2e91730f5101800189436ff5787024849f2793530b45b90924bcf983ff0e6", - "0x091d7fb902c5eb4ff3260d063e26bc3c5ce2be1047b76d934b3b7fd70507b2e3f42b0ca7927cb12208703d723c3cab6d521471ce72b3b8905d7f4a25758dbeda1e", - "0x090131b1d02490bea65fd01440883f72d5cba9b65f9afd2c7ae8184f404611728d0cc00d34005bc36fdbc6d0b8c297535a18d333aee233a64301090d0cedb9c794", - "0x09116db93cd66e4cf635ed53210c9c7ceb3f341836ec2decca7f6c0095f001eb8d2d26ad5edb662cc7025becc95e28649147936b9d3d12ae631009a01cfbde5a5a", - "0x0900c93c6fdfd6c9edefb96e3d2759b63f850a6b5423ab5d490f8c720e94b033532b21eceb6a06e349cd5d02209b3eccd298861b76779287367170fbc9fb8f6349", - "0x091db20b80f4a409a9d96302f7100949680fb9c572197bc0a3022d51c8498f9fcc1af3c9b2d2de3c443a00109be8b97e9c87bb02b9c74fbd3ae6106a001c186093", - "0x092dc75dd7870f92d804744b0df533a75c1895ccf84a19fe9225ff95d116ecbb381f83830f17b2249e0f8d46e1e22ac652118e14cf6aaf24a3a89cb678b92001f8", - "0x09123616c275b1ac501d982980203896ac42498d3a84d6ce0df1b8a0cdc4d8fefe1008609545ae3b201d087150e37ebb0d3370133210f38fae6342c37091db314f", - "0x092679d3397599592c376b92c4af4ac03233f171e39cf57a272eac3ca77e01659d1bc186f896d23c28d459effa0ff9864bc3679fc99548eeaffb1be24a2a7ac150", - "0x092b03449c2bbab44fae2afb43164f1656c3219dfb06cf68623baa2ff3b3d991130d86b432c7ef866156dcc2fba01e96e5adc83a185002afc8f30642a88e924367", - "0x092496edc7b81f67e73e674640db77ce7255bfd6b26a27227f322955fa5ec3e3730f8d392b02a8ec5896e486ee7780bd56d31caba345df529bec7245b62cdc57fb", - "0x0617d3eb0986210134ee7c9197f3a6b0fdbde6f08f73205e669c74251f5e7749cf0f7e226e94a06aefc5a74feda6f077e57d3b83a7c76d6b8f32dc6533049cbae8", - "0x040c6edd4d48b61c0114d3f3d41f63f6955acc21ea4a283158ff9373012456c8cd0508000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000000000000000000c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4702098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b6486420293f9587ba6d3624abd648672428e608a36786ea000000000000000000000000", - "0x5448495320495320534f4d45204d4147494320425954455320464f5220534d54206d3172525867503278704449" - ], - "0x5300000000000000000000000000000000000005": [ - "0x09231c47ddb0c053568721f6c0353242bc7b5a1c0df10313177dc1e74b276faa2c04d2e91730f5101800189436ff5787024849f2793530b45b90924bcf983ff0e6", - "0x091d7fb902c5eb4ff3260d063e26bc3c5ce2be1047b76d934b3b7fd70507b2e3f42b0ca7927cb12208703d723c3cab6d521471ce72b3b8905d7f4a25758dbeda1e", - "0x090131b1d02490bea65fd01440883f72d5cba9b65f9afd2c7ae8184f404611728d0cc00d34005bc36fdbc6d0b8c297535a18d333aee233a64301090d0cedb9c794", - "0x092c088d21dad04812c5d11f3657413417fc9178c80956b3607e0ed38cad10113222f1e06cf539cdf8d5fc53ffdc0b80241aec7d0224228e13281a2af96b130175", - "0x092f9cd5dbb545288ebef2ff64150f82705dd958aa2585a217765f0f4613bec0e63025da172451f519936e1cab88a18320f7b30926c69bd4e9c5669e3f602a1206", - "0x090bade73cb9e022b33dcae5bbf1c6729de308a742cb6b8da2bb6a68ef5a5b05a20ea080a5f83379f12a869ee25d62d5eb085833a95cfeb6b950a3f67139198abd", - "0x092e194247f5d0e3ebbbe7864c5faba72fb98dfbe93d1b19abe7d59f3a0d29f8101c3c95889c38683ffa8af03a5927b5bbf683c34be67a933d01b81190e8a44464", - "0x09010903bf75f61137b5a3c1e11986ace94af35dd5f174e445c2369e65ba703fbe1d082f12dcf52c100d77c768626930747798cc61ee942f19b8f92a893b1686f0", - "0x0923f2348cac7a8270ee159299d78f85392a60e888e7fef0028bc9719d0599f8fd2b5eae7891284b3b6e6b7f105bb77a772475bf800376d22df1206fce1380ffec", - "0x0906b6b6331e77c6d27e574dbcdc9ff7c27e90d7c73bd41b66e2be371fcb03e99c1da8637113514056a5ebb7e1ee460f1ab5b208d77984a076d240aaea3e7d7ed4", - "0x09019cd49766f1bb8c9619165d95cbc8facbd85574e448d62509123eccafaf0ef30ff6e94cd22b65c156a1647afe32f91ce4207dd706aea82b5258bff067aa9be7", - "0x0824f43495b1ba4e7228d55dc717b030b0fa13896bd3a734bfef67c23b8b87294e0069e600590724581f9e58e48034f5ff69c42e973a09ddaa779ac39281aaee96", - "0x062d3d107ea28c4f96516d033c597df368b122d254afa21b3a3af8abd06d8923cd27e0c9270e2f98cf2210f566fc7a0fb1fd164a30e71a70e5d6952b0fefe473f2", - "0x04287b801ba8950befe82147f88e71eff6b85eb921845d754c9c2a165a4ec867910508000000000000000000000000000000000000000000000000070c00000000000000000000000000000000000000000000000000000000000000011027aff22f27a2d718c61ad42281daa1300f867c71a2aa0feef086fdca13890def9917113816eb6dc6302b4e19ce255ee20c79a805220d586dd47ed32dc0ee3912a4876e98632821263ce5f9c3abbbeafc527b525a0b9f7dae7c00dccc0cb0c1621690ab13ae0ed4205300000000000000000000000000000000000005000000000000000000000000", - "0x5448495320495320534f4d45204d4147494320425954455320464f5220534d54206d3172525867503278704449" - ] - } - } - ], - "executionResults": [ - { - "l1DataFee": "0x36d959c563ee", - "gas": 21000, - "failed": false, - "returnValue": "", - "from": { - "address": "0x293f9587ba6d3624abd648672428e608a36786ea", - "nonce": 0, - "balance": "0xde0b6b3a7640000", - "keccakCodeHash": "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", - "poseidonCodeHash": "0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864", - "codeSize": 0 - }, - "to": { - "address": "0x293f9587ba6d3624abd648672428e608a36786ea", - "nonce": 0, - "balance": "0xde0b6b3a7640000", - "keccakCodeHash": "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", - "poseidonCodeHash": "0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864", - "codeSize": 0 - }, - "accountAfter": [ - { - "address": "0x293f9587ba6d3624abd648672428e608a36786ea", - "nonce": 1, - "balance": "0xde07fce918ba412", - "keccakCodeHash": "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", - "poseidonCodeHash": "0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864", - "codeSize": 0 - }, - { - "address": "0x293f9587ba6d3624abd648672428e608a36786ea", - "nonce": 1, - "balance": "0xde07fce918ba412", - "keccakCodeHash": "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", - "poseidonCodeHash": "0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864", - "codeSize": 0 - }, - { - "address": "0x5300000000000000000000000000000000000005", - "nonce": 0, - "balance": "0x11027e6d744fffec5", - "keccakCodeHash": "0xc6302b4e19ce255ee20c79a805220d586dd47ed32dc0ee3912a4876e98632821", - "poseidonCodeHash": "0x263ce5f9c3abbbeafc527b525a0b9f7dae7c00dccc0cb0c1621690ab13ae0ed4", - "codeSize": 1804 - } - ], - "poseidonCodeHash": "0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864", - "byteCode": "0x", - "structLogs": [] - } - ], - "withdraw_trie_root": "0x20cae976896ee7f4e4d031cb49dbd7fe75ccb8f842c1537f9e77e6cda93bbd9e", - "startL1QueueIndex": 1658 - } -} diff --git a/prover/src/aggregator/prover.rs b/prover/src/aggregator/prover.rs index 78b6d86d2..f193d96b1 100644 --- a/prover/src/aggregator/prover.rs +++ b/prover/src/aggregator/prover.rs @@ -1,40 +1,38 @@ use crate::{ common, - config::{AGG_DEGREES, LAYER3_DEGREE, LAYER4_DEGREE}, - io::{read_all, serialize_vk}, - utils::read_env_var, + config::{LayerId, AGG_DEGREES, LAYER3_DEGREE, LAYER4_DEGREE}, + consts::{AGG_VK_FILENAME, CHUNK_PROTOCOL_FILENAME}, + io::{force_to_read, serialize_vk, try_to_read}, BatchProof, ChunkProof, }; use aggregator::{ChunkHash, MAX_AGG_SNARKS}; use anyhow::{bail, Result}; -use once_cell::sync::Lazy; use sha2::{Digest, Sha256}; use snark_verifier_sdk::Snark; -use std::{iter::repeat, path::Path}; - -static CHUNK_PROTOCOL_FILENAME: Lazy = - Lazy::new(|| read_env_var("CHUNK_PROTOCOL_FILENAME", "chunk.protocol".to_string())); +use std::iter::repeat; #[derive(Debug)] pub struct Prover { // Make it public for testing with inner functions (unnecessary for FFI). pub inner: common::Prover, pub chunk_protocol: Vec, + vk: Option>, } impl Prover { pub fn from_dirs(params_dir: &str, assets_dir: &str) -> Self { let inner = common::Prover::from_params_dir(params_dir, &AGG_DEGREES); + let chunk_protocol = force_to_read(assets_dir, &*CHUNK_PROTOCOL_FILENAME); - let chunk_protocol_path = format!("{assets_dir}/{}", *CHUNK_PROTOCOL_FILENAME); - if !Path::new(&chunk_protocol_path).exists() { - panic!("File {chunk_protocol_path} must exist"); + let vk = try_to_read(assets_dir, &*AGG_VK_FILENAME); + if vk.is_none() { + log::warn!("{} doesn't exist in {}", *AGG_VK_FILENAME, assets_dir); } - let chunk_protocol = read_all(&chunk_protocol_path); Self { inner, chunk_protocol, + vk, } } @@ -56,8 +54,10 @@ impl Prover { } pub fn get_vk(&self) -> Option> { - // TODO: replace `layer4` string with an enum value. - self.inner.pk("layer4").map(|pk| serialize_vk(pk.get_vk())) + self.inner + .pk(LayerId::Layer4.id()) + .map(|pk| serialize_vk(pk.get_vk())) + .or_else(|| self.vk.clone()) } // Return the EVM proof for verification. diff --git a/prover/src/aggregator/verifier.rs b/prover/src/aggregator/verifier.rs index 7dfc20de1..da32576f4 100644 --- a/prover/src/aggregator/verifier.rs +++ b/prover/src/aggregator/verifier.rs @@ -1,8 +1,8 @@ use crate::{ common, config::{LAYER4_CONFIG_PATH, LAYER4_DEGREE}, - io::read_all, - utils::read_env_var, + consts::{AGG_VK_FILENAME, DEPLOYMENT_CODE_FILENAME}, + io::force_to_read, BatchProof, }; use aggregator::CompressionCircuit; @@ -11,14 +11,8 @@ use halo2_proofs::{ plonk::VerifyingKey, poly::kzg::commitment::ParamsKZG, }; -use once_cell::sync::Lazy; use snark_verifier_sdk::verify_evm_calldata; -use std::{env, path::Path}; - -static AGG_VK_FILENAME: Lazy = - Lazy::new(|| read_env_var("AGG_VK_FILENAME", "agg_vk.vkey".to_string())); -static DEPLOYMENT_CODE_FILENAME: Lazy = - Lazy::new(|| read_env_var("DEPLOYMENT_CODE_FILENAME", "evm_verifier.bin".to_string())); +use std::env; #[derive(Debug)] pub struct Verifier { @@ -42,14 +36,8 @@ impl Verifier { } pub fn from_dirs(params_dir: &str, assets_dir: &str) -> Self { - let vk_path = format!("{assets_dir}/{}", *AGG_VK_FILENAME); - let deployment_code_path = format!("{assets_dir}/{}", *DEPLOYMENT_CODE_FILENAME); - if !(Path::new(&vk_path).exists() && Path::new(&deployment_code_path).exists()) { - panic!("File {vk_path} and {deployment_code_path} must exist"); - } - - let raw_vk = read_all(&vk_path); - let deployment_code = read_all(&deployment_code_path); + let raw_vk = force_to_read(assets_dir, &*AGG_VK_FILENAME); + let deployment_code = force_to_read(assets_dir, &*DEPLOYMENT_CODE_FILENAME); env::set_var("COMPRESSION_CONFIG", &*LAYER4_CONFIG_PATH); let inner = common::Verifier::from_params_dir(params_dir, *LAYER4_DEGREE, &raw_vk); diff --git a/prover/src/consts.rs b/prover/src/consts.rs new file mode 100644 index 000000000..2300606ee --- /dev/null +++ b/prover/src/consts.rs @@ -0,0 +1,11 @@ +use crate::utils::read_env_var; +use once_cell::sync::Lazy; + +pub static AGG_VK_FILENAME: Lazy = + Lazy::new(|| read_env_var("AGG_VK_FILENAME", "agg_vk.vkey".to_string())); +pub static CHUNK_PROTOCOL_FILENAME: Lazy = + Lazy::new(|| read_env_var("CHUNK_PROTOCOL_FILENAME", "chunk.protocol".to_string())); +pub static CHUNK_VK_FILENAME: Lazy = + Lazy::new(|| read_env_var("CHUNK_VK_FILENAME", "chunk_vk.vkey".to_string())); +pub static DEPLOYMENT_CODE_FILENAME: Lazy = + Lazy::new(|| read_env_var("DEPLOYMENT_CODE_FILENAME", "evm_verifier.bin".to_string())); diff --git a/prover/src/io.rs b/prover/src/io.rs index e09fa6c4e..c75402311 100644 --- a/prover/src/io.rs +++ b/prover/src/io.rs @@ -74,6 +74,21 @@ pub fn read_file(folder: &mut PathBuf, filename: &str) -> Vec { buf } +pub fn try_to_read(dir: &str, filename: &str) -> Option> { + let mut path = PathBuf::from(dir); + path.push(filename); + + if path.exists() { + Some(read_all(&path.to_string_lossy())) + } else { + None + } +} + +pub fn force_to_read(dir: &str, filename: &str) -> Vec { + try_to_read(dir, filename).unwrap_or_else(|| panic!("File {filename} must exist in {dir}")) +} + pub fn write_file(folder: &mut PathBuf, filename: &str, buf: &[u8]) { folder.push(filename); let mut fd = std::fs::File::create(folder.as_path()).unwrap(); diff --git a/prover/src/lib.rs b/prover/src/lib.rs index 3bf0d4865..8a046b38a 100644 --- a/prover/src/lib.rs +++ b/prover/src/lib.rs @@ -1,6 +1,7 @@ pub mod aggregator; pub mod common; pub mod config; +pub mod consts; mod evm_verifier; pub mod inner; pub mod io; diff --git a/prover/src/test_util.rs b/prover/src/test_util.rs index f86a109a6..256df5028 100644 --- a/prover/src/test_util.rs +++ b/prover/src/test_util.rs @@ -1,6 +1,5 @@ use crate::utils::{get_block_trace_from_file, read_env_var}; use glob::glob; -use once_cell::sync::Lazy; use types::eth::BlockTrace; pub mod mock_plonk; @@ -10,10 +9,9 @@ pub use proof::{ gen_and_verify_batch_proofs, gen_and_verify_chunk_proofs, gen_and_verify_normal_and_evm_proofs, }; +pub const ASSETS_DIR: &str = "./test_assets"; pub const PARAMS_DIR: &str = "./test_params"; -pub static TEST_INIT_GEN_PK: Lazy = Lazy::new(|| read_env_var("TEST_INIT_GEN_PK", false)); - pub fn parse_trace_path_from_mode(mode: &str) -> &'static str { let trace_path = match mode { "empty" => "./tests/traces/bridge/01.json", diff --git a/prover/src/zkevm/prover.rs b/prover/src/zkevm/prover.rs index 05fa622f4..37814b492 100644 --- a/prover/src/zkevm/prover.rs +++ b/prover/src/zkevm/prover.rs @@ -1,6 +1,11 @@ use crate::{ - common, config::ZKEVM_DEGREES, io::serialize_vk, utils::chunk_trace_to_witness_block, - zkevm::circuit::normalize_withdraw_proof, ChunkHash, ChunkProof, + common, + config::{LayerId, ZKEVM_DEGREES}, + consts::CHUNK_VK_FILENAME, + io::{serialize_vk, try_to_read}, + utils::chunk_trace_to_witness_block, + zkevm::circuit::normalize_withdraw_proof, + ChunkHash, ChunkProof, }; use anyhow::Result; use types::eth::BlockTrace; @@ -9,27 +14,26 @@ use types::eth::BlockTrace; pub struct Prover { // Make it public for testing with inner functions (unnecessary for FFI). pub inner: common::Prover, -} - -impl From for Prover { - fn from(inner: common::Prover) -> Self { - Self { inner } - } + vk: Option>, } impl Prover { - pub fn from_params_dir(params_dir: &str, gen_pk: bool, output_dir: Option<&str>) -> Self { - let mut inner = common::Prover::from_params_dir(params_dir, &ZKEVM_DEGREES); - if gen_pk { - inner.gen_chunk_pk(output_dir).unwrap(); + pub fn from_dirs(params_dir: &str, assets_dir: &str) -> Self { + let inner = common::Prover::from_params_dir(params_dir, &ZKEVM_DEGREES); + + let vk = try_to_read(assets_dir, &*CHUNK_VK_FILENAME); + if vk.is_none() { + log::warn!("{} doesn't exist in {}", *CHUNK_VK_FILENAME, assets_dir); } - inner.into() + Self { inner, vk } } pub fn get_vk(&self) -> Option> { - // TODO: replace `layer2` string with an enum value. - self.inner.pk("layer2").map(|pk| serialize_vk(pk.get_vk())) + self.inner + .pk(LayerId::Layer2.id()) + .map(|pk| serialize_vk(pk.get_vk())) + .or_else(|| self.vk.clone()) } pub fn gen_chunk_proof( diff --git a/prover/src/zkevm/verifier.rs b/prover/src/zkevm/verifier.rs index 2bc896271..48f14ff8c 100644 --- a/prover/src/zkevm/verifier.rs +++ b/prover/src/zkevm/verifier.rs @@ -1,8 +1,8 @@ use crate::{ common, config::{LAYER2_CONFIG_PATH, LAYER2_DEGREE}, - io::read_all, - utils::read_env_var, + consts::CHUNK_VK_FILENAME, + io::force_to_read, ChunkProof, }; use aggregator::CompressionCircuit; @@ -11,11 +11,7 @@ use halo2_proofs::{ plonk::VerifyingKey, poly::kzg::commitment::ParamsKZG, }; -use once_cell::sync::Lazy; -use std::{env, path::Path}; - -static CHUNK_VK_FILENAME: Lazy = - Lazy::new(|| read_env_var("CHUNK_VK_FILENAME", "chunk_vk.vkey".to_string())); +use std::env; #[derive(Debug)] pub struct Verifier { @@ -35,12 +31,7 @@ impl Verifier { } pub fn from_dirs(params_dir: &str, assets_dir: &str) -> Self { - let vk_path = format!("{assets_dir}/{}", *CHUNK_VK_FILENAME); - if !Path::new(&vk_path).exists() { - panic!("File {vk_path} must exist"); - } - - let raw_vk = read_all(&vk_path); + let raw_vk = force_to_read(assets_dir, &*CHUNK_VK_FILENAME); env::set_var("COMPRESSION_CONFIG", &*LAYER2_CONFIG_PATH); common::Verifier::from_params_dir(params_dir, *LAYER2_DEGREE, &raw_vk).into() diff --git a/prover/tests/aggregation_tests.rs b/prover/tests/aggregation_tests.rs index 20d11ec9f..13bb68203 100644 --- a/prover/tests/aggregation_tests.rs +++ b/prover/tests/aggregation_tests.rs @@ -1,8 +1,6 @@ use prover::{ aggregator::Prover, - test_util::{ - gen_and_verify_batch_proofs, load_block_traces_for_test, PARAMS_DIR, TEST_INIT_GEN_PK, - }, + test_util::{gen_and_verify_batch_proofs, load_block_traces_for_test, ASSETS_DIR, PARAMS_DIR}, utils::{chunk_trace_to_witness_block, init_env_and_log}, zkevm, ChunkHash, ChunkProof, }; @@ -35,8 +33,7 @@ fn gen_chunk_hashes_and_proofs( output_dir: &str, trace_paths: &[String], ) -> Vec<(ChunkHash, ChunkProof)> { - let mut zkevm_prover = - zkevm::Prover::from_params_dir(PARAMS_DIR, *TEST_INIT_GEN_PK, Some(&output_dir)); + let mut zkevm_prover = zkevm::Prover::from_dirs(PARAMS_DIR, ASSETS_DIR); log::info!("Constructed zkevm prover"); let chunk_traces: Vec<_> = trace_paths diff --git a/prover/tests/chunk_tests.rs b/prover/tests/chunk_tests.rs index 6c65f3ade..d8657a6de 100644 --- a/prover/tests/chunk_tests.rs +++ b/prover/tests/chunk_tests.rs @@ -1,7 +1,5 @@ use prover::{ - test_util::{ - gen_and_verify_chunk_proofs, load_block_traces_for_test, PARAMS_DIR, TEST_INIT_GEN_PK, - }, + test_util::{gen_and_verify_chunk_proofs, load_block_traces_for_test, ASSETS_DIR, PARAMS_DIR}, utils::{chunk_trace_to_witness_block, init_env_and_log}, zkevm::Prover, }; @@ -20,15 +18,9 @@ fn test_chunk_prove_verify() { let witness_block = chunk_trace_to_witness_block(chunk_trace).unwrap(); log::info!("Got witness block"); - let mut zkevm_prover = - Prover::from_params_dir(PARAMS_DIR, *TEST_INIT_GEN_PK, Some(&output_dir)); + let mut zkevm_prover = Prover::from_dirs(PARAMS_DIR, ASSETS_DIR); log::info!("Constructed zkevm prover"); - if *TEST_INIT_GEN_PK { - assert!(!zkevm_prover.get_vk().unwrap().is_empty()); - log::info!("Chunk VK is available after init"); - } - // Load or generate compression wide snark (layer-1). let layer1_snark = zkevm_prover .inner