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

ark_bn254 benches and derived gas parameters #2

Merged
merged 12 commits into from
Dec 4, 2023

Conversation

zjma
Copy link
Collaborator

@zjma zjma commented Dec 2, 2023

In this PR

  • ark_bn254 benches.
  • Scripts to calculate gas parameters from bench results.
  • Calculated bn254 gas parameters.

@zjma zjma changed the base branch from main to bn256 December 2, 2023 23:37
@zjma
Copy link
Collaborator Author

zjma commented Dec 3, 2023

@nanne007 you can merge this into your PR

@nanne007 nanne007 merged commit 9aaa429 into zkmove:bn256 Dec 4, 2023
23 of 28 checks passed
nanne007 added a commit that referenced this pull request Dec 13, 2023
* [feat][aptos-stdlib] crypto algebra bn254

Signed-off-by: caojiafeng <funfriendcjf@gmail.com>

* scripts: fix update_algebra_gas_params.py

Signed-off-by: caojiafeng <funfriendcjf@gmail.com>

* add bn254 to default features to make unit test pass

* fix a bug mentioned in the comments

* add test for bn254

* bn254: add test and doc

* ark_bn254 benches and derived gas parameters (#2)

* [feat][aptos-stdlib] crypto algebra bn254

Signed-off-by: caojiafeng <funfriendcjf@gmail.com>

* scripts: fix update_algebra_gas_params.py

Signed-off-by: caojiafeng <funfriendcjf@gmail.com>

* add bn254 to default features to make unit test pass

* fix a bug mentioned in the comments

* initial

* update

* initial gas param

* benches for fq and fq2

* it compiles

* gas script now also specifies quantity types

* update scripts

---------

Signed-off-by: caojiafeng <funfriendcjf@gmail.com>
Co-authored-by: caojiafeng <funfriendcjf@gmail.com>

* resolve comments

* doc: `cargo run -p aptos-framework release` to generate doc

* address comments, and regenerate doc

* update doc

* update doc

* lint, fix ut

* lint

* address comments from `alinush`

Signed-off-by: caojiafeng <funfriendcjf@gmail.com>

* delete bn254_fq2 related code

* address comments on bench

Signed-off-by: caojiafeng <funfriendcjf@gmail.com>

* lint, also hardcode BN254 Gt generator to save cold start time

* revert debugging stuff

* update gas version

* lint

---------

Signed-off-by: caojiafeng <funfriendcjf@gmail.com>
Co-authored-by: zhoujunma <zjma@users.noreply.github.com>
Co-authored-by: zhoujun.ma <zhoujun@aptoslabs.com>
nanne007 pushed a commit that referenced this pull request Mar 6, 2024
* jwk types update

* update

* update

* jwk txn and execution

* update

* consensus ensure jwk txns are expected

* update

* fix dummy

* update

* update

* update

* update

* update

* update

* remove dummy txns

* check voting power than verify signature

* fix warnings

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* finish debug

* fmt
nanne007 pushed a commit that referenced this pull request Mar 6, 2024
* types update from randomnet

* update

* lint

* real dkg and rounding

* rounding

---------

Co-authored-by: danielxiangzl <xiangzhuolun@gmail.com>
nanne007 pushed a commit that referenced this pull request Jun 6, 2024
…#12462)

* [compiler-v2] Making v2 the basis of the prover (step #1)

This adds the missing parts to let compiler v2 fully support the specification language, and switches the prover to use v2 as the basis for verification of v1 bytecode. There is one further step needed to run the prover also on the code generated by v2 but that one is smaller than here. Notice that with this, we are dogfooding the v2 compiler frontend in production with the Move prover. There is no switching back and forth, code for the v1 prover integration has been removed. In more detail this does the following:

- There are two new env processors, the spec_checker and the spec_rewriter:
    - `spec_checker` checks the correct use of Move functions in the specification language. Those functions must be 'pure' and not depend on state or use certain other constructs. The checker is to be run as part of the regular compiler chain.
    - `spec_rewriter` rewrites specification expressions by converting used Move functions into specification functions, and doing other transformations to lift a Move expression into the specification language. This is only run by the prover itself.
- Inlining has been extended to deal with specification constructs.
- To support the inlining refactoring and the new processors, a new module `rewrite_target` is introduced which allows to collect functions and specification elements in a program in a unified fashion, rewriting them, and writing back to the environment. This new data structure has been inspired by the current design of the inliner and naturally extends it.
- A lot of ugliness has been ripped out of the model builder infrastructure (e.g. `TryImplAsSpec` mode is gone, as this is now handled by the `spec_rewriter`). More should come in step #2.
- Multiple test cases have been added.
- The prover driver has been adapted to use the new components.

* Fixing some unit tests

* Making hopefully all tests pass:

- Adding tuple support to the specification language as they are created by the inliner.
- Fixing an issue in memory usage calculation
- Adding a flag `--aptos` to the prover command line for easier debugging, avoiding the CLI.

* Disabling a condition for CI because of timeout.

* Rebasing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants