Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@
"name": "gnosisguild",
"url": "https://github.com/gnosisguild"
},
"license": "LGPL-3.0-only"
"license": "LGPL-3.0-only",
"packageManager": "pnpm@10.7.1+sha512.2d92c86b7928dc8284f53494fb4201f983da65f0fb4f0d40baafa5cf628fa31dae3e5968f12466f17df7e97310e30f343a648baea1b9b350685dafafffdf5808"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright 2022 Aztec
// SPDX-License-Identifier: LGPL-3.0-only
//
// This file is provided WITHOUT ANY WARRANTY;
// without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE.
pragma solidity >=0.8.21;

uint256 constant N = 524288;
Expand Down
63 changes: 63 additions & 0 deletions examples/CRISP/patches/@aztec__bb.js@3.0.0-nightly.20251104.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
diff --git a/dest/browser/crs/net_crs.js b/dest/browser/crs/net_crs.js
index 752d48255a066027de44bcc5867647a717711ece..f9395f00ddb82cdb3559ed153342f5cf51bdee21 100644
--- a/dest/browser/crs/net_crs.js
+++ b/dest/browser/crs/net_crs.js
@@ -65,7 +65,7 @@ export class NetCrs {
return new Response(new Uint8Array([]));
}
const g1End = this.numPoints * 64 - 1;
- return await retry(() => fetch('https://crs.aztec.network/g1.dat', {
+ return await retry(() => fetch('https://crs.aztec-cdn.foundation/g1.dat', {
headers: {
Range: `bytes=0-${g1End}`,
},
@@ -76,7 +76,7 @@ export class NetCrs {
* Fetches the appropriate range of points from a remote source
*/
async fetchG2Data() {
- return await retry(() => fetch('https://crs.aztec.network/g2.dat', {
+ return await retry(() => fetch('https://crs.aztec-cdn.foundation/g2.dat', {
cache: 'force-cache',
}), makeBackoff([5, 5, 5]));
}
@@ -125,7 +125,7 @@ export class NetGrumpkinCrs {
return new Response(new Uint8Array([]));
}
const g1End = this.numPoints * 64 - 1;
- return await fetch('https://crs.aztec.network/grumpkin_g1.dat', {
+ return await fetch('https://crs.aztec-cdn.foundation/grumpkin_g1.dat', {
headers: {
Range: `bytes=0-${g1End}`,
},
diff --git a/src/crs/net_crs.ts b/src/crs/net_crs.ts
index 51ce21ad57d8363323e6a14144bf3888e2937f45..4519a02eb205d6a14680552c9a26352e50293c3d 100644
--- a/src/crs/net_crs.ts
+++ b/src/crs/net_crs.ts
@@ -78,7 +78,7 @@ export class NetCrs {
const g1End = this.numPoints * 64 - 1;
return await retry(
() =>
- fetch('https://crs.aztec.network/g1.dat', {
+ fetch('https://crs.aztec-cdn.foundation/g1.dat', {
headers: {
Range: `bytes=0-${g1End}`,
},
@@ -94,7 +94,7 @@ export class NetCrs {
private async fetchG2Data(): Promise<Response> {
return await retry(
() =>
- fetch('https://crs.aztec.network/g2.dat', {
+ fetch('https://crs.aztec-cdn.foundation/g2.dat', {
cache: 'force-cache',
}),
makeBackoff([5, 5, 5]),
@@ -153,8 +153,7 @@ export class NetGrumpkinCrs {
}

const g1End = this.numPoints * 64 - 1;
-
- return await fetch('https://crs.aztec.network/grumpkin_g1.dat', {
+ return await fetch('https://crs.aztec-cdn.foundation/grumpkin_g1.dat', {
headers: {
Range: `bytes=0-${g1End}`,
},
2 changes: 1 addition & 1 deletion examples/CRISP/server/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ FEE_TOKEN_ADDRESS="0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0"
# After this interval, the computation phase starts automatically
# After activation + this interval, ciphernodes are then not responsing to
# any more decryption requests
E3_DURATION=70
E3_DURATION=100
E3_THRESHOLD_MIN=2
E3_THRESHOLD_MAX=5

Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@
"typescript": "5.8.3",
"undici-types": "6.19.8",
"viem": "2.38.6"
},
"patchedDependencies": {
"@aztec/bb.js@3.0.0-nightly.20251104": "examples/CRISP/patches/@aztec__bb.js@3.0.0-nightly.20251104.patch"
}
Comment thread
cedoor marked this conversation as resolved.
},
"lint-staged": {
Expand Down
9 changes: 1 addition & 8 deletions packages/enclave-contracts/.solhint.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"extends": "solhint:recommended",
"plugins": ["prettier"],
"rules": {
"code-complexity": ["error", 8],
"compiler-version": ["error", ">=0.8.27"],
Expand All @@ -10,12 +9,6 @@
"no-console": "off",
"not-rely-on-time": "off",
"gas-custom-errors": "off",
"one-contract-per-file": "off",
"prettier/prettier": [
"error",
{
"endOfLine": "auto"
}
]
"one-contract-per-file": "off"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -890,5 +890,5 @@
"deployedLinkReferences": {},
"immutableReferences": {},
"inputSourceName": "project/contracts/interfaces/IBondingRegistry.sol",
"buildInfoId": "solc-0_8_28-1274269bf8b5435b6fb6eba99e4eb3854e5d9864"
"buildInfoId": "solc-0_8_28-d7b7e823e5eb177cd42a96206dc5c5f8387609a9"
}
Original file line number Diff line number Diff line change
Expand Up @@ -590,5 +590,5 @@
"deployedLinkReferences": {},
"immutableReferences": {},
"inputSourceName": "project/contracts/interfaces/ICiphernodeRegistry.sol",
"buildInfoId": "solc-0_8_28-1274269bf8b5435b6fb6eba99e4eb3854e5d9864"
"buildInfoId": "solc-0_8_28-d7b7e823e5eb177cd42a96206dc5c5f8387609a9"
}
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,11 @@
"internalType": "uint256",
"name": "e3Id",
"type": "uint256"
},
{
"internalType": "bytes32",
"name": "committeePublicKeyHash",
"type": "bytes32"
}
],
"name": "onCommitteePublished",
Expand Down Expand Up @@ -1197,5 +1202,5 @@
"deployedLinkReferences": {},
"immutableReferences": {},
"inputSourceName": "project/contracts/interfaces/IEnclave.sol",
"buildInfoId": "solc-0_8_28-1274269bf8b5435b6fb6eba99e4eb3854e5d9864"
"buildInfoId": "solc-0_8_28-d7b7e823e5eb177cd42a96206dc5c5f8387609a9"
}
5 changes: 4 additions & 1 deletion packages/enclave-contracts/contracts/Enclave.sol
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,8 @@ contract Enclave is IEnclave, OwnableUpgradeable {

/// @inheritdoc IEnclave
function onCommitteePublished(
uint256 e3Id
uint256 e3Id,
bytes32 committeePublicKeyHash
) external onlyCiphernodeRegistry {
// DKG complete, key published
E3Stage current = _e3Stages[e3Id];
Expand All @@ -686,6 +687,8 @@ contract Enclave is IEnclave, OwnableUpgradeable {
}
_e3Stages[e3Id] = E3Stage.KeyPublished;

e3s[e3Id].committeePublicKey = committeePublicKeyHash;

emit CommitteeFormed(e3Id);
emit E3StageChanged(
e3Id,
Expand Down
3 changes: 2 additions & 1 deletion packages/enclave-contracts/contracts/interfaces/IEnclave.sol
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,8 @@ interface IEnclave {
/// @notice Called by CiphernodeRegistry when committee public key is published (DKG complete).
/// @dev Updates E3 lifecycle to KeyPublished stage.
/// @param e3Id ID of the E3.
function onCommitteePublished(uint256 e3Id) external;
/// @param committeePublicKeyHash Hash of the committee public key.
function onCommitteePublished(uint256 e3Id, bytes32 committeePublicKeyHash) external;

/// @notice Called by authorized contracts to mark an E3 as failed with a specific reason.
/// @dev Updates E3 lifecycle to Failed stage with the given reason.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ contract CiphernodeRegistryOwnable is ICiphernodeRegistry, OwnableUpgradeable {
c.publicKey = publicKeyHash;
publicKeyHashes[e3Id] = publicKeyHash;
// Progress E3 to KeyPublished stage
enclave.onCommitteePublished(e3Id);
enclave.onCommitteePublished(e3Id, publicKeyHash);
emit CommitteePublished(e3Id, nodes, publicKey);
}

Expand Down
60 changes: 24 additions & 36 deletions packages/enclave-contracts/tasks/ciphernode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,14 @@ export const ciphernodeAdd = task(
const [signer] = await ethers.getSigners();
console.log(`Registering ciphernode: ${signer.address}`);

const { deployAndSaveBondingRegistry } = await import(
"../scripts/deployAndSave/bondingRegistry"
);
const { deployAndSaveEnclaveTicketToken } = await import(
"../scripts/deployAndSave/enclaveTicketToken"
);
const { deployAndSaveEnclaveToken } = await import(
"../scripts/deployAndSave/enclaveToken"
);
const { deployAndSaveMockStableToken } = await import(
"../scripts/deployAndSave/mockStableToken"
);
const { deployAndSaveBondingRegistry } =
await import("../scripts/deployAndSave/bondingRegistry");
const { deployAndSaveEnclaveTicketToken } =
await import("../scripts/deployAndSave/enclaveTicketToken");
const { deployAndSaveEnclaveToken } =
await import("../scripts/deployAndSave/enclaveToken");
const { deployAndSaveMockStableToken } =
await import("../scripts/deployAndSave/mockStableToken");
const { bondingRegistry } = await deployAndSaveBondingRegistry({ hre });
const { enclaveToken } = await deployAndSaveEnclaveToken({ hre });
const { enclaveTicketToken } = await deployAndSaveEnclaveTicketToken({
Expand Down Expand Up @@ -166,9 +162,8 @@ export const ciphernodeRemove = task(
const [signer] = await ethers.getSigners();
console.log(`Deregistering ciphernode: ${signer.address}`);

const { deployAndSaveBondingRegistry } = await import(
"../scripts/deployAndSave/bondingRegistry"
);
const { deployAndSaveBondingRegistry } =
await import("../scripts/deployAndSave/bondingRegistry");
const { bondingRegistry } = await deployAndSaveBondingRegistry({ hre });

const bondingRegistryConnected = bondingRegistry.connect(signer);
Expand Down Expand Up @@ -227,14 +222,12 @@ export const ciphernodeMintTokens = task(
);
}

const { deployAndSaveEnclaveToken } = await import(
"../scripts/deployAndSave/enclaveToken"
);
const { deployAndSaveEnclaveToken } =
await import("../scripts/deployAndSave/enclaveToken");
const { enclaveToken } = await deployAndSaveEnclaveToken({ hre });

const { deployAndSaveMockStableToken } = await import(
"../scripts/deployAndSave/mockStableToken"
);
const { deployAndSaveMockStableToken } =
await import("../scripts/deployAndSave/mockStableToken");
const { mockStableToken } = await deployAndSaveMockStableToken({
hre,
});
Expand Down Expand Up @@ -341,19 +334,16 @@ export const ciphernodeAdminAdd = task(
console.log(`Admin wallet: ${adminWallet.address}`);
console.log(`Registering ciphernode: ${ciphernodeAddress}`);

const { deployAndSaveBondingRegistry } = await import(
"../scripts/deployAndSave/bondingRegistry"
);
const { deployAndSaveBondingRegistry } =
await import("../scripts/deployAndSave/bondingRegistry");
const { bondingRegistry } = await deployAndSaveBondingRegistry({ hre });

const { deployAndSaveEnclaveToken } = await import(
"../scripts/deployAndSave/enclaveToken"
);
const { deployAndSaveEnclaveToken } =
await import("../scripts/deployAndSave/enclaveToken");
const { enclaveToken } = await deployAndSaveEnclaveToken({ hre });

const { deployAndSaveMockStableToken } = await import(
"../scripts/deployAndSave/mockStableToken"
);
const { deployAndSaveMockStableToken } =
await import("../scripts/deployAndSave/mockStableToken");
const { mockStableToken: mockUSDC } = await deployAndSaveMockStableToken({
hre,
});
Expand Down Expand Up @@ -546,13 +536,11 @@ export const updateSubmissionWindow = task(
})
.setAction(async () => ({
default: async ({ newWindow }, hre) => {
const { deployAndSaveCiphernodeRegistryOwnable } = await import(
"../scripts/deployAndSave/ciphernodeRegistryOwnable"
);
const { deployAndSaveCiphernodeRegistryOwnable } =
await import("../scripts/deployAndSave/ciphernodeRegistryOwnable");

const { deployAndSavePoseidonT3 } = await import(
"../scripts/deployAndSave/poseidonT3"
);
const { deployAndSavePoseidonT3 } =
await import("../scripts/deployAndSave/poseidonT3");
const poseidonT3 = await deployAndSavePoseidonT3({ hre });

const { ciphernodeRegistry } =
Expand Down
35 changes: 14 additions & 21 deletions packages/enclave-contracts/tasks/enclave.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,10 @@ export const requestCommittee = task(
const connection = await hre.network.connect();
const { ethers } = connection;

const { deployAndSaveEnclave } = await import(
"../scripts/deployAndSave/enclave"
);
const { deployAndSaveMockStableToken } = await import(
"../scripts/deployAndSave/mockStableToken"
);
const { deployAndSaveEnclave } =
await import("../scripts/deployAndSave/enclave");
const { deployAndSaveMockStableToken } =
await import("../scripts/deployAndSave/mockStableToken");

const { enclave } = await deployAndSaveEnclave({
hre,
Expand Down Expand Up @@ -210,9 +208,8 @@ export const enableE3 = task("enclave:enableE3", "Enable an E3 program")
})
.setAction(async () => ({
default: async ({ e3Address }, hre) => {
const { deployAndSaveEnclave } = await import(
"../scripts/deployAndSave/enclave"
);
const { deployAndSaveEnclave } =
await import("../scripts/deployAndSave/enclave");

const { enclave } = await deployAndSaveEnclave({
hre,
Expand Down Expand Up @@ -258,13 +255,11 @@ export const publishCommittee = task(
})
.setAction(async () => ({
default: async ({ e3Id, nodes, publicKey, publicKeyHash }, hre) => {
const { deployAndSaveCiphernodeRegistryOwnable } = await import(
"../scripts/deployAndSave/ciphernodeRegistryOwnable"
);
const { deployAndSaveCiphernodeRegistryOwnable } =
await import("../scripts/deployAndSave/ciphernodeRegistryOwnable");

const { deployAndSavePoseidonT3 } = await import(
"../scripts/deployAndSave/poseidonT3"
);
const { deployAndSavePoseidonT3 } =
await import("../scripts/deployAndSave/poseidonT3");
const poseidonT3 = await deployAndSavePoseidonT3({ hre });

const { ciphernodeRegistry } =
Expand Down Expand Up @@ -336,9 +331,8 @@ export const publishCiphertext = task(
})
.setAction(async () => ({
default: async ({ e3Id, data, dataFile, proof, proofFile }, hre) => {
const { deployAndSaveEnclave } = await import(
"../scripts/deployAndSave/enclave"
);
const { deployAndSaveEnclave } =
await import("../scripts/deployAndSave/enclave");

const { enclave } = await deployAndSaveEnclave({
hre,
Expand Down Expand Up @@ -408,9 +402,8 @@ export const publishPlaintext = task(
})
.setAction(async () => ({
default: async ({ e3Id, data, dataFile, proof, proofFile }, hre) => {
const { deployAndSaveEnclave } = await import(
"../scripts/deployAndSave/enclave"
);
const { deployAndSaveEnclave } =
await import("../scripts/deployAndSave/enclave");

const { enclave } = await deployAndSaveEnclave({
hre,
Expand Down
5 changes: 2 additions & 3 deletions packages/enclave-contracts/tasks/program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ export const publishInput = task(
})
.setAction(async () => ({
default: async ({ e3Id, data, dataFile, programAddress }, hre) => {
const { deployAndSaveMockProgram } = await import(
"../scripts/deployAndSave/mockProgram"
);
const { deployAndSaveMockProgram } =
await import("../scripts/deployAndSave/mockProgram");
const { MockE3Program__factory } = await import("../types");

const { ethers } = await hre.network.connect();
Expand Down
Loading
Loading