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

Adding upgradability to features overview #1057

Merged
merged 4 commits into from
Oct 15, 2024
Merged

Conversation

45930
Copy link
Contributor

@45930 45930 commented Oct 15, 2024

Adding a short article about upgradability to the zkapps/feature-overview section of the docs.

This is inspired by DFST's example code shared here: https://discord.com/channels/484437221055922177/1207271738388516884/1291820682828710021

https://github.com/zkcloudworker/zkcloudworker-tests/blob/main/tests/vk.test.ts

I realized we don't have an example showing how to actually upgrade a smart contract in the docs. Only references to the permission to do so.

In addition to the article, I added a new directory in the examples called feature-overview, which has an npm test script that we can run in CI. Other snippets of feature overview code could be added there to be included in CI as well.

@45930 45930 requested a review from a team as a code owner October 15, 2024 17:12
Copy link

vercel bot commented Oct 15, 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 Oct 15, 2024 8:36pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
07-oracles ⬜️ Ignored (Inspect) Visit Preview Oct 15, 2024 8:36pm

@45930 45930 merged commit ff309fb into main Oct 15, 2024
2 of 3 checks passed
@45930 45930 deleted the 2024-10-add-upgrade-example branch October 15, 2024 20:35
@boray
Copy link
Contributor

boray commented Oct 15, 2024

The example code isn’t linked in the document. Why not include a reference?

@45930
Copy link
Contributor Author

45930 commented Oct 16, 2024

@boray it's something I considered, but I think it distracts from the main point. The code is slightly different from the example, and it's not all necessary to understand the main point of the article. We could add it someday if we think it's needed.

I included it as a test anyways because that will still give us an alert if the example becomes outdated.

Comment on lines +92 to +95
update.update.verificationKey = {
isSome: Bool(true),
value: verificationKey,
};
Copy link
Contributor

Choose a reason for hiding this comment

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

there's a nicer way to interact with the update field of an account update:

update.account.verificationKey.set(verificationKey);

in general documented here: https://docs.minaprotocol.com/zkapps/writing-a-zkapp/feature-overview/on-chain-values#setting-account-fields

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.

4 participants