-
Notifications
You must be signed in to change notification settings - Fork 11
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
The default permission setup might make it impossible to ever upgrade the token contract #112
Comments
This is a very good point. |
Unless I’m missing something this isn’t fixable and is a limitation of Mina. Linked pre-MIP is relevant. access permission needs to be ignored in some cases or you could split it into two permissions |
I think that makes sense. We’ll probably need to make some changes at the protocol level to fix this. |
DAMN that's a great find @Comdex. I agree it needs a protocol-level fix. @mrmr1993 @nholland94 hope you saw this -- once there is a vk-breaking hard fork, all contracts with access=proof are broken, because the verification key update (using a signature) can't go through, and neither can any proof for the outdated vk |
Is a short-term workaround to change the |
With |
Unfortunately, we can't set the permissions to change the verification key to |
For anyone following this: there is also a discussion on Discord, see https://discord.com/channels/484437221055922177/1311633212769960009/1311633212769960009. At the moment, we're trying to get a short term solution to this for the fungible tokens, while also looking at the necessary protocol changes to fix the root cause. I'll update as we progress. |
We've been tracking this issue for a while on the O(1) side. There's an easy fix, and it's part of the plan for the next hard fork. |
Thanks @mrmr1993, that's good news! What I still want to change is adding access management to the updateVerificationKey method, in order to enable making the contract upgradable before a breaking change to the protocol. That way, people can upgrade to keep up to date with fixes and improvements in o1js. |
See #113. |
With #113, Together with @mrmr1993's message above that the |
The default permission settings of the current token standard contract are configured this way:
mina-fungible-token/FungibleToken.ts
Lines 73 to 77 in 7f2427a
The
access
permission is set toProof,
and if I am not mistaken, this requires the correspondingAccountUpdate
of the token contract to include a proof in order to be accepted by the network. However, the permission forsetVerificationKey
will change to Signature after the protocol upgrade. This means that updating the VerificationKey will require signature authorization. Since anAccountUpdate
cannot simultaneously include both proof and signature authorization, and with updates to permissions being disallowed, this would likely result in the token contract being permanently unupgradable.The
access
permission has the highest priority, which means that when it is set toProof
, other permissions set toSignature
will become invalidThe text was updated successfully, but these errors were encountered: