Skip to content
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

Add aggregation functions and tests #179

Merged
merged 15 commits into from
Jul 31, 2023
Merged

Add aggregation functions and tests #179

merged 15 commits into from
Jul 31, 2023

Conversation

silathdiir
Copy link
Contributor

@silathdiir silathdiir commented Jul 24, 2023

  • Testing updates on servers.

Separate from PR #160

Summary

  1. Add aggregator Prover and Verifier.

  2. Add aggregation-tests.

  3. Update zkevm-prove and zkevm-verify bin commands.

Test

  • make test-inner-prove could pass.
  • make test-chunk-prove could pass.
  • make test-agg-prove could pass.
  • bin/zkevm_prove and zkevm_verify could pass.

TODO (may fix in another PR)

@silathdiir silathdiir marked this pull request as draft July 24, 2023 09:54
@silathdiir silathdiir mentioned this pull request Jul 25, 2023
11 tasks
@silathdiir silathdiir force-pushed the agg-funs-and-tests branch 2 times, most recently from a2e00ad to ca7078f Compare July 27, 2023 03:27
@silathdiir silathdiir marked this pull request as ready for review July 28, 2023 10:59
@silathdiir silathdiir changed the title [WIP] Add aggregation functions and tests Add aggregation functions and tests Jul 28, 2023
@lispc
Copy link
Collaborator

lispc commented Jul 30, 2023

we must give evm proof to roller coordinator. Since it is the evm proof that is verified on chain. So we have 2 choice here

(1) give both evm proof and normal proof to roller coordinator, then the roller coordinator verifies normal proof, stores evm proof into db and later publish evm proof on chain
(2) give only evm proof to roller coordinator. the roller coordinator verifies evm proof, stores evm proof into db and later publish evm proof on chain. I recommand this way, but one thing i am concern is you regenerate YUL&BIN inside the Verifier::evm_verify. It may be slow. So i have several solution for this: (A) change pub unsafe extern "C" fn init_agg_verifier(params_dir: *const c_char, vk_path: *const c_char) to pub unsafe extern "C" fn init_agg_verifier(params_dir: *const c_char, vk_path: *const c_char, bytecode_bin_path: *const c_char) or pub unsafe extern "C" fn init_agg_verifier(params_dir: *const c_char, assets_dir: *const c_char), just load the BIN from disk instead regenerating it inside verifier (B) inside Verifier::new, create bytecode bin using gen_evm_verifier, the num_instance is in fact all the same, so just hard code it (C) cache deployment_code inside Verifier struct, inside Verifier::evm_verify, if deployment_code is None, generate and store it inside struct, if deployment_code is Some(xx), use it without regenerating.

btw inside roller coordinator, verification may be multi thread. So if we choose (C) above, we may need deployment_code: Arc<Mutex<Option<Vec<u8>>>?

@silathdiir
Copy link
Contributor Author

we must give evm proof to roller coordinator. Since it is the evm proof that is verified on chain. So we have 2 choice here
...

Suppose to fix to fn init_agg_verifier(params_dir: *const c_char, assets_dir: *const c_char) and load both vk and bytecode BIN from assets_dir.

lispc
lispc previously approved these changes Jul 31, 2023
@lispc lispc merged commit 1f1d1d9 into main Jul 31, 2023
3 checks passed
@lispc lispc deleted the agg-funs-and-tests branch July 31, 2023 07:55
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.

None yet

2 participants