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

Async circuits, pt 2 - witness and transaction callback #1468

Merged
merged 12 commits into from
Mar 7, 2024

Conversation

mitschabaude
Copy link
Member

@mitschabaude mitschabaude commented Feb 28, 2024

This PR adds the two remaining dependencies to support async contract methods:

  • introducing Provable.asyncWitness()
    • this depends on the bindings and snarky changes
    • needed because we run methods in a witness block when calling contracts from other contracts
  • make the Mina.transaction callback async
    • note: I require the callback to be async. The reasoning is that 90% of uses need to be async anyway, because they call contracts. If we supported non-async callbacks, it would just become easier for developers to overlook that they have to await their contract calls now (with now, I mean with the next PR)

Since these two changes ended up creating a huge diff, and the next PR will do so again, I chose to defer actual async methods to yet another PR

snarky: o1-labs/snarky#839
mina: to be seen if this can be included in an existing PR
bindings: o1-labs/o1js-bindings#253

@mitschabaude mitschabaude changed the title Async circuits, pt 2 Async circuits, pt 2 - witness and transaction callback Feb 29, 2024
Copy link
Member Author

@mitschabaude mitschabaude left a comment

Choose a reason for hiding this comment

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

most of the PR is just adding asnyc - a few comments to highlight actual changes to review:

Copy link
Member Author

Choose a reason for hiding this comment

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

some actual changes here

Copy link
Member Author

Choose a reason for hiding this comment

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

introducing async witness

Copy link
Member Author

Choose a reason for hiding this comment

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

introducing async witness

@mitschabaude mitschabaude marked this pull request as ready for review February 29, 2024 09:23
src/snarky.d.ts Outdated
Copy link
Member Author

Choose a reason for hiding this comment

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

additions to snarky-ml interface

): Promise<Transaction>;
function transaction(
senderOrF: DeprecatedFeePayerSpec | (() => void),
fOrUndefined?: () => void
senderOrF: DeprecatedFeePayerSpec | (() => Promise<void>),
Copy link
Member

Choose a reason for hiding this comment

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

Might be about time that we remove the old deprecated private key as fee payer spec

Copy link
Member Author

Choose a reason for hiding this comment

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

good idea. I'll do an API cleanup PR before v1 that removes all the long deprecated stuff

Base automatically changed from feature/async-circuits to main March 7, 2024 09:17
@mitschabaude mitschabaude merged commit 61fea3b into main Mar 7, 2024
13 checks passed
@mitschabaude mitschabaude deleted the feature/async-methods branch March 7, 2024 10:08
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