Skip to content

feat: Kernel fix & test improvements/refactoring - #239

Merged
dbanks12 merged 13 commits into
masterfrom
db/refactor_pkernel_tests_fix_native_pkernel
Apr 13, 2023
Merged

feat: Kernel fix & test improvements/refactoring#239
dbanks12 merged 13 commits into
masterfrom
db/refactor_pkernel_tests_fix_native_pkernel

Conversation

@dbanks12

@dbanks12 dbanks12 commented Apr 13, 2023

Copy link
Copy Markdown
Contributor

Description

Status

Contents

  • Kernel tests have been refactored to use helper functions.
  • Hash/tree functions have been moved into helpers in hash.hpp (for kernel at least).
  • Fixed native kernel circuit which was not calling any contract logic.
  • Changed the way args are passed to private circuit calls so that we can use a std::function type to write functions that accept any circuit function as input.

Checklist:

  • I have reviewed my diff in github, line by line.
  • Every change is related to the PR description.
  • I have linked this pull request to the issue(s) that it resolves.
  • There are no unexpected formatting changes, superfluous debug logs, or commented-out code.
  • There are no circuit changes, OR specifications in /specs have been updated.
  • There are no circuit changes, OR a cryptographer has been assigned for review.
  • I've updated any terraform that needs updating (e.g. environment variables) for deployment.
  • The branch has been rebased against the head of its merge target.
  • I'm happy for the PR to be merged at the reviewer's next convenience.
  • New functions, classes, etc. have been documented according to the doxygen comment format. Classes and structs must have @brief describing the intended functionality.
  • If existing code has been modified, such documentation has been added or updated.

Note
If you are updating the submodule, please make sure you do it in its own special PR and avoid making changes to the submodule as a part of other PRs.
To update a submodule, you can run the following commands:

$ git submodule update --recursive

Alternatively, you can select a particular commit in barretenberg/aztec3 that you wish to point to:

$ cd barretenberg
$ git pull origin aztec3        # This will point to the latest commit in `barretenberg/aztec3`
$ git checkout <commit_hash>    # Use this if you wish to point to a particular commit.
$ cd ..
$ git add . && git commit -m <commit_msg>
$ git push

@dbanks12
dbanks12 changed the base branch from db/zero_init_structs_arrays to master April 13, 2023 00:49
@dbanks12
dbanks12 marked this pull request as ready for review April 13, 2023 17:50
Comment thread cpp/src/aztec3/circuits/hash.hpp
Comment thread cpp/src/aztec3/circuits/kernel/private/.test.cpp
Comment on lines +96 to +97
// TODO: this fails intermittently, with:
// bigfield multiply range check failed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this TODO has been fixed, so this comment can be removed.

Comment thread cpp/src/aztec3/circuits/kernel/private/.test.cpp
Comment thread cpp/src/aztec3/circuits/kernel/private/.test.cpp
Comment thread cpp/src/aztec3/circuits/kernel/private/.test.cpp
NT::Proof mock_kernel_proof = mock_kernel_prover.construct_proof();
// info("\nmock_kernel_proof: ", mock_kernel_proof.proof_data);

std::shared_ptr<NT::VK> mock_kernel_vk = mock_kernel_composer.compute_verification_key();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iAmMichaelConnor this is the big chunk we should be able to remove once we have the special kernel version for the initial iteration. Won't need to compute the mock kernel anymore.

@dbanks12
dbanks12 merged commit 5ae96a0 into master Apr 13, 2023
@dbanks12
dbanks12 deleted the db/refactor_pkernel_tests_fix_native_pkernel branch April 13, 2023 19:32
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.

Refactor private kernel tests with helper functions Add checks in kernel that contract_address and contract_tree_root are sane

2 participants