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 txnVersion to verification key permission #1208

Merged
merged 9 commits into from
Nov 27, 2023
Merged

Conversation

Trivo25
Copy link
Member

@Trivo25 Trivo25 commented Oct 30, 2023

o1js implementation of the protocol change described by this RFC

This change enables developers to flag contracts as immutable but not prevent them from deadlocking with future protocol changes. In addition to the permission type a developer wants to specify for setVerificationKey, it is now possible to also specify a txnVersion: UInt32 which will be stored on-chain as part of the zkApp accounts permission field. If the txnVersion matches the current protocol version, permissions of type Proof and Impossible act normal. If the txnVersion is older than the current protocol version, the permission falls back to Signature automatically, so that now broken smart contracts can be upgraded using a Signatures.

TODO: docs MinaProtocol/docs2#750

companion of MinaProtocol/mina#14407

bindings o1-labs/o1js-bindings#195

},
"approveRegistrations": {
"rows": 1146,
"digest": "197ce95e1895f940278034d20ab24274"
"rows": 1147,
Copy link
Member Author

Choose a reason for hiding this comment

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

I am actually a bit surprised by this change - this change shouldn't impact this as far as I understand, but maybe something on the Mina branch changed how snarky works 🤔

Copy link
Collaborator

Choose a reason for hiding this comment

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

the new transaction version becomes part of the hash input when hashing the account update. since the constraints don't change by a lot, it seems the number of poseidon rounds doesn't increase, but what does increase potentially is the number of operations for packing the new UInt32 into the field elements that are hashed (well only if the addition is not part of a chain of added constants already).
Also, every new constant adds half a row. We probably didn't use the constant 3 before in this circuit. I think this is what causes the constraint increase in most of these methods
🤓

Copy link
Member Author

Choose a reason for hiding this comment

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

Thats right! Didnt think about that at all

},
"approveRegistrations": {
"rows": 1146,
"digest": "197ce95e1895f940278034d20ab24274"
"rows": 1147,
Copy link
Collaborator

Choose a reason for hiding this comment

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

the new transaction version becomes part of the hash input when hashing the account update. since the constraints don't change by a lot, it seems the number of poseidon rounds doesn't increase, but what does increase potentially is the number of operations for packing the new UInt32 into the field elements that are hashed (well only if the addition is not part of a chain of added constants already).
Also, every new constant adds half a row. We probably didn't use the constant 3 before in this circuit. I think this is what causes the constraint increase in most of these methods
🤓

@Trivo25 Trivo25 merged commit 8e52615 into berkeley Nov 27, 2023
10 checks passed
@Trivo25 Trivo25 deleted the feature/vk-txnversion branch November 27, 2023 17:15
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