Skip to content

Commit

Permalink
updating upgradability article and o1js audits list
Browse files Browse the repository at this point in the history
  • Loading branch information
Test committed Oct 18, 2024
1 parent fe8980b commit 121716b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 25 deletions.
2 changes: 1 addition & 1 deletion docs/zkapps/o1js/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Start your o1js journey by learning about [basic zk programming concepts](/zkapp

## Audits of o1js

* **Third-party audit (Q1/Q2 2024)**. An audit by an external security firm is ongoing and on track to complete in Q2 2024. Results will be shared when available.
* [**Veridise external audit (Q3 2024)**](https://github.com/o1-labs/o1js/blob/a09c5167c4df64f879684e5af14c59cf7a6fce11/audits/VAR_o1js_240318_o1js_V3.pdf). We engaged Veridise, a security auditing company, to do a full audit of o1js version 1. Veridise spent 39 person-weeks reviewing o1js in depth, and all issues of medium severity and higher were fixed.

* [**Internal audit (Q1 2024)**](https://github.com/o1-labs/o1js/files/15192821/Internal.o1js.audit.Q1.2024.pdf). In March 2024, the o1js team spent roughly two person-weeks to conduct an internal audit of parts of the o1js code base. The audit focused on reviewing core provable code. A number of issues were found and fixed.

Expand Down
18 changes: 6 additions & 12 deletions docs/zkapps/writing-a-zkapp/feature-overview/upgradability.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,11 @@ const contractAddress = zkAppKey.toPublicKey();
const upgradeTx = await Mina.transaction({ sender, fee },
async () => {
const update = AccountUpdate.createSigned(contractAddress);
update.update.verificationKey = {
isSome: Bool(true),
value: verificationKey,
};
update.account.verificationKey.set(verificationKey);
}
);
await tx.sign([senderKey, zkAppKey]).prove();
await tx.send();
await upgradeTx.sign([senderKey, zkAppKey]).prove();
await upgradeTx.send();
```

And just like that, when the transaction is applied to the blockchain, the verification key at the ZkApp address will be updated from `"27729068461170601362912907281403262888852363473424470267835507636847418791713"` to `"18150279532259194644722165513074833862035641840431153413486908511595437348455"`!
Expand Down Expand Up @@ -149,14 +146,11 @@ const contractAddress = zkAppKey.toPublicKey();
const upgradeTx = await Mina.transaction({ sender, fee },
async () => {
const update = AccountUpdate.createSigned(contractAddress);
update.update.verificationKey = {
isSome: Bool(true),
value: verificationKey,
};
update.account.verificationKey.set(verificationKey);
}
);
await tx.sign([senderKey, zkAppKey]).prove();
await tx.send();
await upgradeTx.sign([senderKey, zkAppKey]).prove();
await upgradeTx.send();
```

### State Variables
Expand Down
15 changes: 3 additions & 12 deletions examples/zkapps/feature-overview/src/upgradability/upgrade.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,7 @@ test('Initial contract data has correct state', async () => {

tx = await Mina.transaction({ sender: feepayerAddress, fee }, async () => {
const update = AccountUpdate.createSigned(zkApp.address);
update.update.verificationKey = {
isSome: Bool(true),
value: v2Contract.verificationKey,
};
update.account.verificationKey.set(v2Contract.verificationKey);
});
await tx.sign([senderKey, addKey]).prove();
await tx.send().wait();
Expand All @@ -100,10 +97,7 @@ test('Initial contract data has correct state', async () => {

tx = await Mina.transaction({ sender: feepayerAddress, fee }, async () => {
const update = AccountUpdate.createSigned(zkApp.address);
update.update.verificationKey = {
isSome: Bool(true),
value: v3Contract.verificationKey,
};
update.account.verificationKey.set(v3Contract.verificationKey);
});
await tx.sign([senderKey, addKey]).prove();
await tx.send().wait();
Expand Down Expand Up @@ -158,10 +152,7 @@ test('Initial contract data has correct state', async () => {

tx = await Mina.transaction({ sender: feepayerAddress, fee }, async () => {
const update = AccountUpdate.createSigned(unsafeAddAddress);
update.update.verificationKey = {
isSome: Bool(true),
value: v3ContractUnsafe.verificationKey,
};
update.account.verificationKey.set(v3ContractUnsafe.verificationKey);
});
await tx.sign([senderKey, unsafeZkAppAccount.key]).prove();
await tx.send().wait();
Expand Down

0 comments on commit 121716b

Please sign in to comment.