From 433b966ba427ba783097c146d3571d3f57babbfa Mon Sep 17 00:00:00 2001 From: 0xjei Date: Thu, 28 May 2026 10:38:29 +0200 Subject: [PATCH 1/6] fix missing active preset json artifact for template --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3766272c19..978c5b02bd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1036,6 +1036,7 @@ jobs: packages/enclave-contracts/cache packages/enclave-contracts/types crates/wasm/dist + circuits/bin/.active-preset.json circuits/bin/recursive_aggregation/wrapper/threshold/target circuits/bin/threshold/target retention-days: 1 @@ -1156,6 +1157,7 @@ jobs: ls -la templates/default/target/debug/e3-support-scripts-dev || echo "support scripts not found" ls -la packages/enclave-contracts/dist || echo "SDK dist not found" ls -la crates/wasm/dist || echo "WASM dist not found" + ls -la circuits/bin/.active-preset.json || echo "circuit preset stamp not found" echo "Support scripts permissions:" ls -la templates/default/target/debug/e3-support-scripts-dev From fe2f4416394812a6f287a8d852e6e3007f1d95f6 Mon Sep 17 00:00:00 2001 From: 0xjei Date: Thu, 28 May 2026 10:49:47 +0200 Subject: [PATCH 2/6] suggestion from coder --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 978c5b02bd..b06b5dd871 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1040,7 +1040,7 @@ jobs: circuits/bin/recursive_aggregation/wrapper/threshold/target circuits/bin/threshold/target retention-days: 1 - if-no-files-found: warn + if-no-files-found: error build_crisp_sdk: needs: [detect_changes] @@ -1157,7 +1157,7 @@ jobs: ls -la templates/default/target/debug/e3-support-scripts-dev || echo "support scripts not found" ls -la packages/enclave-contracts/dist || echo "SDK dist not found" ls -la crates/wasm/dist || echo "WASM dist not found" - ls -la circuits/bin/.active-preset.json || echo "circuit preset stamp not found" + test -f circuits/bin/.active-preset.json || (echo "ERROR: circuit preset stamp not found" && exit 1) echo "Support scripts permissions:" ls -la templates/default/target/debug/e3-support-scripts-dev From 6e45119e766f7ebe38d6789775d9cd59dcaf3370 Mon Sep 17 00:00:00 2001 From: 0xjei Date: Thu, 28 May 2026 11:16:09 +0200 Subject: [PATCH 3/6] include hidden files and update deployed addresses --- .github/workflows/ci.yml | 1 + templates/default/deployed_contracts.json | 66 ++++++++--------------- templates/default/enclave.config.yaml | 16 +++--- 3 files changed, 32 insertions(+), 51 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b06b5dd871..1cd0868a3d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1029,6 +1029,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: sdk-artifacts + include-hidden-files: true path: | packages/enclave-sdk/dist packages/enclave-contracts/dist diff --git a/templates/default/deployed_contracts.json b/templates/default/deployed_contracts.json index 2bb29ced8a..9a88530760 100644 --- a/templates/default/deployed_contracts.json +++ b/templates/default/deployed_contracts.json @@ -1,21 +1,21 @@ { "localhost": { "PoseidonT3": { - "blockNumber": 17, + "blockNumber": 4, "address": "0x3333333C0A88F9BE4fd23ed0536F9B6c427e3B93" }, "MockUSDC": { "constructorArgs": { "initialSupply": "1000000" }, - "blockNumber": 18, + "blockNumber": 5, "address": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512" }, "EnclaveToken": { "constructorArgs": { "owner": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" }, - "blockNumber": 19, + "blockNumber": 6, "address": "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0" }, "EnclaveTicketToken": { @@ -24,7 +24,7 @@ "registry": "0x0000000000000000000000000000000000000001", "owner": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" }, - "blockNumber": 21, + "blockNumber": 8, "address": "0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9" }, "SlashingManager": { @@ -32,7 +32,7 @@ "initialDelay": "172800", "admin": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" }, - "blockNumber": 11, + "blockNumber": 9, "address": "0x5FC8d32690cc91D4c39d9d3abcBD16989F875707" }, "CiphernodeRegistryOwnable": { @@ -47,7 +47,7 @@ "proxyAdminAddress": "0x9bd03768a7DCc129555dE410FF8E85528A4F88b5", "implementationAddress": "0x0165878A594ca255338adfa4d48449f69242Eb8F" }, - "blockNumber": 12, + "blockNumber": 11, "address": "0xa513E6E4b8f2a923D98304ec87F64353C4D5C853" }, "BondingRegistry": { @@ -69,7 +69,7 @@ "proxyAdminAddress": "0x8aCd85898458400f7Db866d53FCFF6f0D49741FF", "implementationAddress": "0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6" }, - "blockNumber": 13, + "blockNumber": 12, "address": "0x8A791620dd6260079BF849Dc5567aDC3F2FdC318" }, "Enclave": { @@ -89,8 +89,8 @@ "proxyAdminAddress": "0x1F708C24a0D3A740cD47cC0444E9480899f3dA7D", "implementationAddress": "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e" }, - "blockNumber": 27, - "address": "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e" + "blockNumber": 16, + "address": "0xA51c1fc2f0D1a1b8494Ed1FE312d7C3a78Ed91C0" }, "E3RefundManager": { "constructorArgs": { @@ -105,52 +105,32 @@ "proxyAdminAddress": "0x8e80FFe6Dc044F4A766Afd6e5a8732Fe0977A493", "implementationAddress": "0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82" }, - "blockNumber": 29, - "address": "0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82" + "blockNumber": 18, + "address": "0x9A676e781A523b5d0C0e43731313A708CB607508" }, "MockComputeProvider": { - "blockNumber": 31, - "address": "0x9E545E3C0baAB3E08CdfD552C960A1050f373042" + "blockNumber": 51, + "address": "0x5eb3Bc0a489C5A8288765d2336659EbCA68FCd00" }, "MockDecryptionVerifier": { - "blockNumber": 32, - "address": "0xa82fF9aFd8f496c3d6ac40E2a0F282E47488CFc9" + "blockNumber": 53, + "address": "0x36C02dA8a0983159322a80FFE9F24b1acfF8B570" }, "MockPkVerifier": { - "blockNumber": 33, - "address": "0x1613beB3B2C4f22Ee086B2b38C1476A3cE7f78E8" + "blockNumber": 54, + "address": "0x809d550fca64d94Bd9F66E60752A544199cfAC3D" }, "MockE3Program": { - "blockNumber": 34, - "address": "0x851356ae760d987E095750cCeb3bC6014560891C" - }, - "ZKTranscriptLib": { - "blockNumber": 36, - "address": "0x95401dc811bb5740090279Ba06cfA8fcF6113778" - }, - "DecryptionAggregatorVerifier": { - "blockNumber": 37, - "address": "0x998abeb3E57409262aE5b751f60747921B33613E" - }, - "DkgAggregatorVerifier": { - "blockNumber": 38, - "address": "0x70e0bA845a1A0F2DA3359C97E0285013525FFC49" - }, - "BfvDecryptionVerifier": { - "blockNumber": 39, - "address": "0x4826533B4897376654Bb4d4AD88B7faFD0C98528" - }, - "BfvPkVerifier": { - "blockNumber": 41, - "address": "0x0E801D84Fa97b50751Dbf25036d067dCf18858bF" + "blockNumber": 55, + "address": "0x4c5859f0F772848b2D91F1D83E2Fe57935348029" }, "ImageID": { - "address": "0x5eb3Bc0a489C5A8288765d2336659EbCA68FCd00", - "blockNumber": 44 + "address": "0x82e01223d51Eb87e16A03E24687EDF0F294da6f1", + "blockNumber": 60 }, "MyProgram": { - "address": "0x36C02dA8a0983159322a80FFE9F24b1acfF8B570", - "blockNumber": 46 + "address": "0x2bdCC0de6bE1f7D2ee689a0342D76F52E8EFABa3", + "blockNumber": 62 } } } \ No newline at end of file diff --git a/templates/default/enclave.config.yaml b/templates/default/enclave.config.yaml index 3b92a5ae62..9ed50163ec 100644 --- a/templates/default/enclave.config.yaml +++ b/templates/default/enclave.config.yaml @@ -3,26 +3,26 @@ chains: rpc_url: "ws://localhost:8545" contracts: e3_program: - address: "0x8f86403A4DE0BB5791fa46B8e795C547942fE4Cf" - deploy_block: 32 + address: "0x2bdCC0de6bE1f7D2ee689a0342D76F52E8EFABa3" + deploy_block: 62 enclave: - address: "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e" + address: "0xA51c1fc2f0D1a1b8494Ed1FE312d7C3a78Ed91C0" deploy_block: 16 ciphernode_registry: address: "0xa513E6E4b8f2a923D98304ec87F64353C4D5C853" - deploy_block: 12 + deploy_block: 11 bonding_registry: address: "0x8A791620dd6260079BF849Dc5567aDC3F2FdC318" - deploy_block: 13 + deploy_block: 12 slashing_manager: address: "0x5FC8d32690cc91D4c39d9d3abcBD16989F875707" deploy_block: 11 fee_token: address: "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512" - deploy_block: 6 + deploy_block: 5 e3_program: - address: "0x0E801D84Fa97b50751Dbf25036d067dCf18858bF" - deploy_block: 51 + address: "0x2bdCC0de6bE1f7D2ee689a0342D76F52E8EFABa3" + deploy_block: 62 program: dev: true # Default profile: multithread uses (logical CPUs - 1) Rayon workers and the same concurrent job From 25d905ea71f9b8262554c265f2d04b17c5fdc63b Mon Sep 17 00:00:00 2001 From: 0xjei Date: Thu, 28 May 2026 11:22:33 +0200 Subject: [PATCH 4/6] remove duplicated e3 program --- templates/default/enclave.config.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/templates/default/enclave.config.yaml b/templates/default/enclave.config.yaml index 9ed50163ec..784aff2d81 100644 --- a/templates/default/enclave.config.yaml +++ b/templates/default/enclave.config.yaml @@ -20,9 +20,6 @@ chains: fee_token: address: "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512" deploy_block: 5 - e3_program: - address: "0x2bdCC0de6bE1f7D2ee689a0342D76F52E8EFABa3" - deploy_block: 62 program: dev: true # Default profile: multithread uses (logical CPUs - 1) Rayon workers and the same concurrent job From e6edb092c9bf3799752569fe5f260f1f78eeb6e0 Mon Sep 17 00:00:00 2001 From: 0xjei Date: Thu, 28 May 2026 12:09:31 +0200 Subject: [PATCH 5/6] walk back till root --- .../src/circuits/assert-micro-circuits.ts | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/packages/enclave-sdk/src/circuits/assert-micro-circuits.ts b/packages/enclave-sdk/src/circuits/assert-micro-circuits.ts index 051ba9c494..4efb7ce9c7 100644 --- a/packages/enclave-sdk/src/circuits/assert-micro-circuits.ts +++ b/packages/enclave-sdk/src/circuits/assert-micro-circuits.ts @@ -4,7 +4,7 @@ // without even the implied warranty of MERCHANTABILITY // or FITNESS FOR A PARTICULAR PURPOSE. -import { readFileSync } from 'node:fs' +import { existsSync, readFileSync } from 'node:fs' import { dirname, resolve } from 'node:path' import { fileURLToPath } from 'node:url' @@ -13,7 +13,23 @@ import { SDKError } from '../utils' /** Matches `IEnclave.CommitteeSize.Micro` and `DEFAULT_E3_CONFIG.committeeSize`. */ export const SDK_CIRCUIT_COMMITTEE = 'micro' -const ACTIVE_PRESET_PATH = resolve(dirname(fileURLToPath(import.meta.url)), '../../../../circuits/bin/.active-preset.json') +function findActivePath(): string { + // Walk up from the bundle file (depth varies: dist/ vs dist/crypto/ etc.) + // until we find the package root (directory containing package.json), then + // go up two more levels to the monorepo root where circuits/bin lives. + let dir = dirname(fileURLToPath(import.meta.url)) + while (true) { + if (existsSync(resolve(dir, 'package.json'))) { + return resolve(dir, '../../circuits/bin/.active-preset.json') + } + const parent = dirname(dir) + if (parent === dir) break + dir = parent + } + throw new SDKError('Could not locate SDK package root', 'SDK_CIRCUIT_STAMP_MISSING') +} + +const ACTIVE_PRESET_PATH = findActivePath() let checked = false From 05e5444c8c8742480ccc00a383544d0013276792 Mon Sep 17 00:00:00 2001 From: 0xjei Date: Thu, 28 May 2026 12:19:23 +0200 Subject: [PATCH 6/6] fix sdk preset path for external install --- .../src/circuits/assert-micro-circuits.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/enclave-sdk/src/circuits/assert-micro-circuits.ts b/packages/enclave-sdk/src/circuits/assert-micro-circuits.ts index 4efb7ce9c7..a5c1ba8043 100644 --- a/packages/enclave-sdk/src/circuits/assert-micro-circuits.ts +++ b/packages/enclave-sdk/src/circuits/assert-micro-circuits.ts @@ -13,13 +13,20 @@ import { SDKError } from '../utils' /** Matches `IEnclave.CommitteeSize.Micro` and `DEFAULT_E3_CONFIG.committeeSize`. */ export const SDK_CIRCUIT_COMMITTEE = 'micro' -function findActivePath(): string { +function findActivePath(): string | null { // Walk up from the bundle file (depth varies: dist/ vs dist/crypto/ etc.) - // until we find the package root (directory containing package.json), then - // go up two more levels to the monorepo root where circuits/bin lives. + // until we find the package root (directory containing package.json). let dir = dirname(fileURLToPath(import.meta.url)) while (true) { if (existsSync(resolve(dir, 'package.json'))) { + // Bundled preset shipped inside the package takes priority (future use). + const bundled = resolve(dir, '.active-preset.json') + if (existsSync(bundled)) return bundled + + // When installed under node_modules the monorepo root is not available; + // skip the check rather than resolving into an unrelated project tree. + if (dir.includes('node_modules')) return null + return resolve(dir, '../../circuits/bin/.active-preset.json') } const parent = dirname(dir) @@ -42,6 +49,8 @@ export function assertSdkMicroCircuits(): void { if (checked) return checked = true + if (ACTIVE_PRESET_PATH === null) return + let raw: string try { raw = readFileSync(ACTIVE_PRESET_PATH, 'utf-8')