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 Actions and Reducer production warning. #1011

Merged
merged 5 commits into from
Jul 2, 2024

Conversation

ymekuria
Copy link
Contributor

@ymekuria ymekuria commented Jun 27, 2024

Closes #1013

This PR adds a warning about the current limitation of the o1js reducer api. A note was also added that work is in progress to mitigate the current limitation.

Copy link

vercel bot commented Jun 27, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 2, 2024 6:31pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
07-oracles ⬜️ Ignored (Inspect) Visit Preview Jul 2, 2024 6:31pm

@@ -15,6 +15,7 @@ keywords:
---

:::caution Warning
Actions and Reducers are still in development and currently are not safe to use in production applications.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd prefer if this caveat refered to the Reducer API from o1js in particular, and not to the general concept of actions and reducers.

At the protocol level, safe use of actions is very possible, if you implement a better reducer (the upcoming BatchReducer being an example).

Also, we should say why Reducer is not safe to use: Because the reduce() method breaks (completely) if more than a hard-coded number of actions are pending (default: 32).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd prefer if this caveat refered to the Reducer API from o1js in particular, and not to the general concept of actions and reducers.

Good idea. Do you think this location is still an appropriate place to add the caveat?

Also, we should say why Reducer is not safe to use: Because the reduce() method breaks (completely) if more than a hard-coded number of actions are pending (default: 32).

This was the plan. I was deciding if it made sense to either have a short description in this location with the caveat or to link to a longer description somewhere else, and where a long description would live in the docs if we went that direction.

@mitschabaude I was also working on adding similar warnings to some of the examples in the o1js repo. Maybe it makes sense to add the caveat(temporary until we completely update the reducer) to the o1js reducer doc comments.

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you think this location is still an appropriate place to add the caveat?

Yes definitely, it's the right place!

This was the plan. I was deciding if it made sense to either have a short description in this location with the caveat or to link to a longer description somewhere else, and where a long description would live in the docs if we went that direction.

Gotcha, both works. A longer description could live as a new "security best practice" (subsection on the zkapp security docs) here: https://docs.minaprotocol.com/zkapps/writing-a-zkapp/introduction-to-zkapps/secure-zkapps#best-practices-for-zkapp-security

@ymekuria ymekuria marked this pull request as ready for review July 2, 2024 02:57
@ymekuria ymekuria requested a review from a team as a code owner July 2, 2024 02:57
@ymekuria ymekuria merged commit 7760cd4 into main Jul 2, 2024
4 checks passed
@ymekuria ymekuria deleted the feature/actions-reducers-warning branch July 2, 2024 18:35
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.

Add reducer limitation warning
2 participants