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

chore: Use Noir javascript packages to execute the private kernel circuit init using the typescript generated types #2763

Merged
merged 18 commits into from
Oct 11, 2023

Conversation

kevaundray
Copy link
Contributor

Please provide a paragraph or two giving a summary of the change, including relevant motivation and context.

Checklist:

Remove the checklist to signal you've completed it. Enable auto-merge if the PR is ready to merge.

  • If the pull request requires a cryptography review (e.g. cryptographic algorithm implementations) I have added the 'crypto' tag.
  • I have reviewed my diff in github, line by line and removed unexpected formatting changes, testing logs, or commented-out code.
  • Every change is related to the PR description.
  • I have linked this pull request to relevant issues (if any exist).

@kevaundray kevaundray changed the base branch from master to feature_branch/private-kernel October 10, 2023 15:01
@kevaundray
Copy link
Contributor Author

A few changes were made here:

  • The typescript generator was modified to typecheck arrays at compile time. typescript started to complain about this, so we had to cast these types in type_conversion

  • Monomorphized types do not actually specify that they have been monomorphized in the abi.json, so the typescript generator was not catching this. I added this to the bugs list with an example. To fix, I modified the Noir code to effectively monomorphize the two structs ContractLeafMembership and FunctionLeafMembership.

  • The typescript generator was changed to make the Return type a tye alias for the typescript generated return type, having an interface with a value field was not correct. Ideally we do a runtime check here, instead of the downcast, but for now its okay

// This is not great as we are exporting from tests.
// Its okay for now and before merging into master, we should
// remove this line.
export {makePrivateKernelInputsInit} from '../tests/factories.js';
Copy link
Contributor Author

@kevaundray kevaundray Oct 11, 2023

Choose a reason for hiding this comment

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

I think this is okay tech debt at the moment -- until we want to merge into master, without it we will need to manually make an instance of PrivateKernelInputsInit in noir-private-kernel in order to have tests

@kevaundray kevaundray changed the title chore: Parse generated ts types in abiEncode chore: Use Noir javascript packages to execute the private kernel circuit init using the typescript generated types Oct 11, 2023
@kevaundray kevaundray marked this pull request as ready for review October 11, 2023 01:05
@sirasistant sirasistant merged commit de628ee into feature_branch/private-kernel Oct 11, 2023
2 checks passed
@sirasistant sirasistant deleted the kw/abi-types-encoding branch October 11, 2023 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants