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

Allow updating the verification key (requiring a signature from the admin) #113

Merged
merged 3 commits into from
Dec 13, 2024

Conversation

kantp
Copy link
Collaborator

@kantp kantp commented Dec 10, 2024

Originally, the token contract could only be updated after an incompatible change of the protocol. This reduces the amount of trust in the deployer, but it did not allow updating the contract in order to be compatible with new versions of o1js.

We're changing the default behaviour to allow updates of the verification key, as long as the admin contract grants permission (which in the default admin contract will be granted if the transaction has been signed by the admin key).

This PR does two things:

- it adds a method `canChangeVerificationKey` to the admin contract, to check permissions for
changing the verification key. This method is called from `updateVerificationKey` in the token
contract.

- The deploy arguments for the token contract now have a new field, `allowUpdates`. If that is set
to `true`, updates of the verification key will be allowed also during the current protocol version.

This allows updating the token contract, for example when there is a new version of o1js.
Copy link
Collaborator

@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.

I reviewed only the contract changes, and they make sense to me

@kantp kantp added this pull request to the merge queue Dec 13, 2024
Merged via the queue into main with commit 92b27bc Dec 13, 2024
3 checks passed
@kantp kantp deleted the kantp/allow-updates branch December 13, 2024 15:34
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.

2 participants